/* Вход, регистрация и онбординг — раунд 2 (29.10.2026), по макету
   docs/design/onboarding_r2/ (снимки shots/*.png, кадры анимаций w2.css).
   Цвета — только токены `templates/_tokens.html`, поэтому тёмная тема приходит сама.
   Детали набора — `templates/_kit.html` (.k-btn, .k-tile, .k-input, .k-chip); здесь
   только раскладка экранов и то, чего в наборе нет. Классы макета `w-*` — образец,
   свои имена: `au-*` (вход), `ob-*` (онбординг), `pl-*` (план). */

/* ── Движение (кадры из макета w2.css под своими именами) ───────────────── */
@keyframes ob-in    { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes ob-in-back { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes ob-out   { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(-28px); } }
@keyframes ob-out-back { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(28px); } }
@keyframes ob-up    { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ob-fade  { from { opacity: 0; } to { opacity: 1; } }
@keyframes ob-shrink { from { opacity: 1; transform: none; } to { opacity: 0; transform: scale(.94); } }
@keyframes ob-pop   { 0% { transform: scale(.97); } 60% { transform: scale(1.01); } 100% { transform: scale(1); } }
@keyframes ob-tick  { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
@keyframes ob-flash { 0% { background: var(--accent-tint); } 100% { background: transparent; } }
@keyframes ob-spin  { to { transform: rotate(360deg); } }
@keyframes ob-grow  { from { opacity: 0; max-height: 0; } to { opacity: 1; max-height: 120px; } }

/* ⚠️ `backwards`, а не `both` (раунд 3): с `both` конечный `transform` оставался на
   элементе навсегда, каждое поле становилось отдельным слоем, и поле «Школа»
   рисовалось поверх списка города (щелчок попадал в него, а не в вариант). */
.ob-anim-up { animation: ob-up .4s cubic-bezier(.2, .7, .2, 1) backwards; }
.ob-d1 { animation-delay: .06s; } .ob-d2 { animation-delay: .12s; }
.ob-d3 { animation-delay: .18s; } .ob-d4 { animation-delay: .24s; }
.ob-d5 { animation-delay: .30s; } .ob-d6 { animation-delay: .36s; }

/* Только для экранного диктора. */
.ob-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden;
         clip: rect(0 0 0 0); white-space: nowrap; margin: 0; padding: 0; border: 0; }

/* ══ Вход и регистрация (`body.au`) ════════════════════════════════════════ */
/* Страница: полоса с логотипом (`_auth_top.html`, раунд 4: шапки сайта здесь нет) →
   середина → подвал с документами в потоке.
   `_auth_style.html` центрирует тело для старых экранов (экран согласия); здесь
   тело — колонка во всю ширину. */
body.au { display: flex; flex-direction: column; align-items: stretch;
          justify-content: flex-start; min-height: 100vh; padding: 0; }
body.au > .site-version { align-self: stretch; }
body.au { --legal-foot-left: 16px; }
/* Кружок Telegram не закрывает последние ссылки и возрастную метку. */
body.au > .legal-foot, body.au > .site-version ~ .legal-foot { padding-right: 80px; }
/* Полоса с логотипом (раунд 4). На широком экране лежит поверх фона, своей высоты не
   берёт: логотип слева вверху, карточка справа, левая колонка по центру высоты — они
   не пересекаются, а 52 px нужны регистрации, чтобы влезть в окно 1536×730. */
body.au { position: relative; }
.au-top { position: absolute; top: 0; left: 0; z-index: 2; height: 68px; display: flex;
          align-items: center; padding: 0 40px; }
@media (max-width: 760px) {
  .au-top { position: static; flex-shrink: 0; height: 56px; padding: 0 16px; }
  /* В шапке онбординга на узком экране логотип спрятан (место под прогресс), здесь — нет. */
  .au-top .ob-logo { display: inline-flex; }
}
.au-main { flex: 1; display: flex; align-items: center; justify-content: center;
           gap: 88px; width: 100%; max-width: 1180px; margin: 0 auto;
           padding: 4px 32px; }
.au-main--single { gap: 0; }

/* Левая колонка: заголовок и пункты (вход) или шаги (регистрация). */
.au-pitch { flex: 0 1 470px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.au-pitch-h { margin: 0; font-size: 40px; font-weight: 600; line-height: 1.15;
              letter-spacing: -.015em; color: var(--text); }
.au-pitch-h em { font-style: normal; color: var(--accent-ink); }
.au-points, .au-steps { list-style: none; margin: 0; padding: 0; display: flex;
                        flex-direction: column; gap: 14px; }
.au-points li { display: flex; gap: 14px; align-items: center; font-size: 15.5px; font-weight: 500; }
.au-point-ico { width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--r-card);
                background: var(--surface); border: var(--line, 1px) solid var(--border);
                display: inline-flex; align-items: center; justify-content: center;
                color: var(--accent-ink); }
.au-steps li { display: flex; gap: 14px; align-items: center; font-size: 16px; font-weight: 600; }
.au-step-n { width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--r-pill);
             background: var(--surface); border: 1px solid var(--border); color: var(--text2);
             display: inline-flex; align-items: center; justify-content: center;
             font-size: 14px; font-weight: 600; }
.au-steps li.is-now .au-step-n { background: var(--accent); border-color: var(--accent);
                                 color: var(--on-accent); }

/* Карточка формы 500 px, мягкая тень (раунд 4: была 420 — шире, чтобы тексты галочек
   легли в меньшее число строк и регистрация влезла в окно 1440×778 без прокрутки;
   вход той же ширины, чтобы вкладки не прыгали). Отступы внутри — 12 px. */
.au-card { flex: 0 0 500px; width: 500px; max-width: 100%; background: var(--surface);
           border: 1px solid var(--border); border-radius: 14px; padding: 20px 32px;
           box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: 12px; }
.au-card--single { flex-basis: 440px; width: 440px; }
.au-card--wide { flex-basis: 520px; width: 520px; }
.au-card-h { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.25; color: var(--text); }
.au-sub { margin-top: 6px; font-size: 14px; color: var(--text2); overflow-wrap: anywhere; }
.au-sub a, .au-switch-line a, .au-forgot { color: var(--accent-ink); }
.au-card .error-list { margin: 0; }

/* Переключатель «Вход | Регистрация». */
.au-seg { display: flex; padding: 3px; border-radius: var(--r-pill);
          background: var(--surface-2); border: 1px solid var(--border); }
.au-seg-item { flex: 1 1 0; height: 36px; display: inline-flex; align-items: center;
               justify-content: center; border-radius: var(--r-pill); font-size: 14px;
               font-weight: 600; color: var(--text2); text-decoration: none;
               transition: background var(--t, .12s), color var(--t, .12s); }
.au-seg-item:hover { color: var(--text); }
.au-seg-item.is-on { background: var(--accent); color: var(--on-accent); }
.au-seg-item:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Поля. */
.au-form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.au-field { display: flex; flex-direction: column; gap: 6px; }
.au-label { display: block; margin: 0; font-size: 13px; font-weight: 500; color: var(--text2); }
.au-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.au-forgot { font-size: 13px; }
/* Под полем пароля, прижата вправо (раунд 3): 6 px промежутка .au-field + 2 = 8 px от поля. */
.au-forgot--under { align-self: flex-end; margin-top: 2px; line-height: 1.3; }
.au .au-input { height: 44px; font-size: 15px; padding: 0 12px; border-radius: var(--r);
                border-width: 1px; box-shadow: none; }
.au .au-input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring);
                      background: var(--surface); }
.au-pw { position: relative; }
.au-pw .au-input { padding-right: 46px; }
.au-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
          width: 34px; height: 34px; border: 0; border-radius: var(--r); background: transparent;
          color: var(--text3); display: inline-flex; align-items: center; justify-content: center;
          cursor: pointer; }
.au-eye[hidden] { display: none; }
.au-eye:hover, .au-eye[aria-pressed="true"] { color: var(--text); background: var(--chip-bg); }
.au .consent { font-size: 13px; line-height: 1.45; margin: 0; }
.au .consent input[type="checkbox"] { width: 18px; height: 18px; margin-top: 1px;
                                       accent-color: var(--accent); cursor: pointer; }
.au-submit { width: 100%; height: 48px; font-size: 15px; font-weight: 600; }
.au-switch-line { margin: 0; text-align: center; font-size: 14px; color: var(--text2); }
.au-switch-line a { font-weight: 600; }
.au-row { display: flex; align-items: center; gap: 12px; }
.au-row .au-submit { flex: 1; }
.au-alt { height: 48px; padding: 0 18px; }

/* «Код из письма»: значок-плитка и шесть ячеек. */
.au-badge { width: 56px; height: 56px; border-radius: 14px; background: var(--accent-tint);
            color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }
.au-cells { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.au-cell { width: 100%; height: 56px; padding: 0; text-align: center; font: inherit;
           font-size: 24px; font-weight: 600; color: var(--text); background: var(--surface);
           border: 1px solid var(--border); border-radius: var(--r-card);
           font-variant-numeric: tabular-nums; caret-color: var(--accent); }
.au-cell:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.au-cell.is-filled { animation: ob-pop .2s ease-out; }
.au-resend-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0; }
.au-resend { font: inherit; font-size: 13px; color: var(--text2); background: none; border: 0;
             padding: 0; cursor: pointer; text-align: left; }
.au-resend:not(:disabled) { color: var(--accent-ink); text-decoration: underline; }
.au-resend:disabled { cursor: default; }

/* «Почти готово»: кто вошёл и что передал сервис. */
.au-who { display: flex; align-items: center; gap: 16px; }
.au-ava { width: 56px; height: 56px; flex-shrink: 0; border-radius: var(--r-pill);
          background: var(--accent-tint); color: var(--accent-ink); display: inline-flex;
          align-items: center; justify-content: center; font-size: 20px; font-weight: 600; }
.au-who-k { font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 2px; }
.au-facts { margin: 0; padding: 12px 16px; border-radius: var(--r-card);
            background: var(--surface-2); border: 1px solid var(--border);
            display: flex; flex-direction: column; gap: 8px; }
.au-fact { display: grid; grid-template-columns: 140px 1fr; gap: 12px; font-size: 14px; }
.au-fact dt { display: flex; align-items: center; gap: 8px; color: var(--text2); }
.au-fact dt svg { color: var(--green); flex-shrink: 0; }
.au-fact dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.au-chip { align-self: flex-start; padding: 4px 10px; border-radius: var(--r-pill);
           border: 1px solid var(--border); font-size: 13px; font-weight: 500; color: var(--text2); }

/* Старые экраны внутри новой страницы (сброс пароля кодом): своя карточка без
   повторного логотипа — логотип уже в шапке сайта. */
.au-main > .login-card { flex: 0 0 440px; width: 440px; max-width: 100%; margin: 0;
                         border-radius: 14px; box-shadow: var(--shadow-pop); padding: 28px 32px; }
.au-main > .login-card .login-logo,
.au-main > .login-card .back-link { display: none; }

/* Телефон: левой колонки нет, карточка без рамки на всю ширину, поля 16 px. */
/* Планшет: две колонки не вмещаются рядом с формой 500 px. */
@media (max-width: 1023px) {
  .au-pitch { display: none; }
  .au-main { gap: 0; }
}
@media (max-width: 900px) {
  .au-main { padding: 32px 24px; }
  .au-pitch-h { font-size: 32px; }
}
@media (max-width: 760px) {
  .au-main { display: block; padding: 20px 16px 28px; }
  .au-pitch, .au-seg { display: none; }
  .au-card, .au-card--single, .au-card--wide, .au-main > .login-card {
    width: 100%; flex: none; padding: 0; border: 0; box-shadow: none; background: transparent; }
  .au-card-h { font-size: 26px; }
  .au-fact { grid-template-columns: 1fr; gap: 2px; }
  .au-row { flex-direction: column-reverse; align-items: stretch; }
}

/* ══ Онбординг (`body.ob`) ═══════════════════════════════════════════════ */
body.ob { margin: 0; min-height: 100vh; display: flex; flex-direction: column;
          background: var(--bg); color: var(--text); font-family: var(--font-ui);
          -webkit-font-smoothing: antialiased; }
body.ob *, body.ob *::before, body.ob *::after { box-sizing: border-box; }

/* Шапка 68 px: логотип · «Назад» + полоса + «N из M» · «Выйти». */
.ob-top { height: 68px; flex-shrink: 0; display: grid; grid-template-columns: 200px 1fr 200px;
          align-items: center; padding: 0 40px; background: var(--surface);
          border-bottom: 1px solid var(--border-soft); }
.ob-logo { display: inline-flex; align-items: center; color: var(--text); text-decoration: none; }
/* ⚠️ РАЗМЕР — ВЫСОТОЙ, ШИРИНА — ИЗ viewBox (раунд 2). В раунде 1 знак держала
   ширина 132 px при `height: auto`, и владелец увидел «знак и буквы съехали». */
.ob-logo-mark { height: 44px; width: auto; display: block; color: var(--text); }
.ob-mid { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 560px;
          justify-self: center; }
.ob-back { width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--r-pill);
           border: 1px solid var(--border); background: var(--surface); color: var(--text);
           display: inline-flex; align-items: center; justify-content: center;
           text-decoration: none; transition: background var(--t, .12s); }
.ob-back:hover { background: var(--chip-bg); }
.ob-back:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.ob-back.is-off { visibility: hidden; }
.ob-bar { flex: 1; height: 8px; border-radius: var(--r-pill); background: var(--chip-bg); overflow: hidden; }
.ob-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent);
              transition: width .5s cubic-bezier(.2, .7, .2, 1); }
.ob-bar-n { font-size: 13px; font-weight: 600; color: var(--text2); min-width: 46px;
            text-align: right; white-space: nowrap; }
.ob-out { justify-self: end; }
.ob-out form { margin: 0; }

/* Тело шага: вопрос слева, «Ваш профиль» справа. */
.ob-main { flex: 1; display: flex; flex-direction: column; width: 100%; }
.ob-body { display: flex; gap: 56px; width: 100%; max-width: 1280px; margin: 0 auto;
           padding: 72px 80px 48px; }
.ob-q { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.ob-h { margin: 0; font-size: 34px; font-weight: 600; line-height: 1.2; letter-spacing: -.015em;
        color: var(--text); outline: none; }
.ob-form { display: flex; flex-direction: column; gap: 28px; margin: 0; }
.ob-err { margin-top: -16px; font-size: 13px; color: var(--error-ink); }
.ob-main > .ob-fine { width: 100%; max-width: 1280px; margin: auto auto 0; padding: 0 80px 16px;
                      font-size: 12px; line-height: 1.5; color: var(--text3); }

/* «Ваш профиль». */
.ob-me { width: 300px; flex-shrink: 0; align-self: flex-start; background: var(--surface);
         border: 1px solid var(--border); border-radius: var(--r-panel); padding: 18px 20px;
         display: flex; flex-direction: column; gap: 12px; }
.ob-me-top { display: flex; align-items: center; gap: 12px; padding-bottom: 12px;
             border-bottom: 1px solid var(--border-soft); min-width: 0; }
.ob-ava { width: 40px; height: 40px; border-radius: var(--r-pill); background: var(--accent-tint);
          color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center;
          font-size: 14px; font-weight: 600; flex-shrink: 0; }
.ob-me-name { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.ob-me ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.ob-me li { display: flex; align-items: baseline; gap: 10px; padding: 8px 6px; margin: 0 -6px;
            border-radius: var(--r); font-size: 14px; }
.ob-me-k { width: 70px; flex-shrink: 0; font-size: 13px; color: var(--text3); }
.ob-me-v { color: var(--text); font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.ob-me-v.is-empty::before { content: ''; display: inline-block; width: 12px; vertical-align: middle;
                            border-top: 1px solid var(--border); }
.ob-me li.is-now .ob-me-k { color: var(--accent-ink); font-weight: 600; }
.ob-me li.is-new { animation: ob-flash 1.6s ease-out both; }
.ob-me li.is-new .ob-me-v { animation: ob-fade .4s ease-out both; }

/* Плитки: подъём при наведении, «пружинка» при нажатии, галочка линией. */
.ob-t { position: relative; font: inherit; color: inherit; text-align: left; cursor: pointer;
        transition: transform var(--t, .12s), border-color var(--t, .12s),
                    box-shadow var(--t, .12s), background var(--t, .12s); }
.ob-t:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
/* Видимый фокус с клавиатуры; у плитки-галочки фокус на скрытом поле внутри. */
.ob-t:focus-visible, .ob-t:has(input:focus-visible) { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.ob-t.is-picking { animation: ob-pop .28s ease-out; }
.ob-t.k-tile--on { background: var(--accent-tint); border-color: var(--accent); border-width: 1px; }
.ob-mark { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px;
           border-radius: var(--r-pill); border: 1.5px solid var(--border); background: var(--surface);
           color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; }
.ob-mark--sq { border-radius: 6px; }
.ob-mark svg { stroke-dasharray: 24; stroke-dashoffset: 24; }
.k-tile--on > .ob-mark { background: var(--accent); border-color: var(--accent); }
.k-tile--on > .ob-mark svg { stroke-dashoffset: 0; }
.k-tile--on.is-picking > .ob-mark svg { animation: ob-tick .25s .05s ease-out both; }
.ob-t input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px;
                               margin: 0; pointer-events: none; }

/* «Кто вы?» */
.ob-role { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ob-role .k-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
                   padding: 28px; min-height: 168px; border-radius: 14px; }
.ob-role .k-tile__name { font-size: 22px; margin: 0; }
.ob-role-ico { width: 64px; height: 64px; border-radius: 16px; background: var(--bg);
               color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }

/* Класс: пять плиток и отдельная пилюля «Уже не школьник». */
.ob-grades { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ob-grade.k-tile { height: 112px; display: flex; flex-direction: column; align-items: center;
                   justify-content: center; gap: 2px; padding: 0; text-align: center; border-radius: 12px; }
.ob-grade-n { font-size: 36px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.ob-grade-c { font-size: 13px; color: var(--text3); }
.ob-grade.k-tile--on .ob-grade-n { color: var(--accent-ink); }
.ob-notpupil { align-self: flex-start; height: 44px; padding: 0 18px; margin-top: -8px;
               border-radius: var(--r-pill); border: 1px dashed var(--border); background: transparent;
               color: var(--text2); font-size: 14px; font-weight: 500; display: inline-flex;
               align-items: center; gap: 8px; }
.ob-notpupil:hover { border-style: solid; color: var(--text); background: var(--surface); box-shadow: none; }
.ob-notpupil.is-on { border-style: solid; border-color: var(--accent); background: var(--accent-tint);
                     color: var(--accent-ink); }

/* Выбранный класс, свёрнутый в пилюлю «10 класс · Изменить». */
.ob-picked { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px;
             height: 40px; padding: 0 6px 0 14px; margin-bottom: -10px; border-radius: var(--r-pill);
             background: var(--accent-tint); color: var(--accent-ink); font-size: 14px; font-weight: 600;
             text-decoration: none; animation: ob-fade .3s ease-out both; }
.ob-picked span { height: 30px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface);
                  color: var(--text2); font-weight: 500; display: inline-flex; align-items: center;
                  font-size: 13px; }
.ob-picked:hover span { color: var(--text); }
.ob-picked:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }

/* Уровень: 2×2, «лесенка» из четырёх столбиков. */
.ob-levels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ob-level.k-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
                   padding: 18px 20px; min-height: 118px; border-radius: 12px; }
.ob-level .k-tile__name { font-size: 17px; padding-right: 28px; margin: 0; }
.ob-level .k-tile__note { font-size: 13.5px; line-height: 1.5; }
.ob-sig { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; margin-bottom: 2px; }
.ob-sig i { width: 5px; border-radius: 2px; background: var(--border); }
.ob-sig i:nth-child(1) { height: 6px; } .ob-sig i:nth-child(2) { height: 9px; }
.ob-sig i:nth-child(3) { height: 12px; } .ob-sig i:nth-child(4) { height: 16px; }
.ob-sig i.on { background: var(--accent); }

/* Цели: логотип, квадратная отметка, можно несколько. */
.ob-goals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ob-goal.k-tile { display: flex; flex-direction: row; align-items: center; gap: 16px;
                  padding: 14px 52px 14px 14px; min-height: 84px; border-radius: 12px; }
.ob-goal.is-wide { grid-column: 1 / -1; }
.ob-goal .ob-mark { top: 50%; margin-top: -11px; right: 16px; }
.ob-goal-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ob-goal .k-tile__name { font-size: 16px; margin: 0; }
.ob-goal .k-tile__note { font-size: 13px; }
/* Логотип БЕЗ плашки (раунд 3, решение владельца 29.10.2026): область 104×64 без
   фона и рамки, знак вписан. ⚠️ Белую плашку не возвращать — сторож
   problems/tests/test_onboarding_r3.py (static/onboarding/logos/README.md). */
.ob-plate { position: relative; width: 104px; height: 64px; flex-shrink: 0; display: inline-flex;
            align-items: center; justify-content: center; }
.ob-plate img { max-width: 100%; max-height: 100%; object-fit: contain; display: block;
                transition: transform var(--t-slow, .2s); }
.ob-t:hover .ob-plate img { transform: scale(1.04); }
.ob-plate-badges { position: absolute; right: -8px; bottom: -8px; display: flex; }
.ob-plate-badges span { width: 26px; height: 26px; border-radius: var(--r-pill); background: var(--surface);
                        border: 1px solid var(--border); display: inline-flex; align-items: center;
                        justify-content: center; padding: 3px; margin-left: -6px; }
.ob-plate-badges img { max-height: 18px; }
/* «Разобраться в экономике» — знак W Weconomics. */
.ob-plate--mark img { width: 76px; height: 56px; }
/* «Пока не решил» — веер из четырёх бледных логотипов. */
.ob-plate--fan { display: block; }
.ob-plate--fan img { position: absolute; max-height: 34px; max-width: 54px; filter: grayscale(1); opacity: .5; transition: opacity .2s; }
.ob-plate--fan img:nth-child(1) { left: 0;    top: 6px;  max-width: 50px; }
.ob-plate--fan img:nth-child(2) { left: 30px; top: 26px; max-width: 46px; max-height: 30px; }
.ob-plate--fan img:nth-child(3) { left: 62px; top: 4px;  max-height: 26px; }
.ob-plate--fan img:nth-child(4) { left: 80px; top: 30px; max-height: 26px; }
.ob-t:hover .ob-plate--fan img { opacity: .75; transform: none; }
/* Тёмная тема: чёрные буквы ВсОШ на тёмном не видны — только под логотипами
   олимпиад светлая подложка. Знак W и веер — без подложки. */
[data-theme="dark"] .ob-plate--olymp { background: var(--brand-cream); border-radius: 10px; padding: 6px; }

/* Пилюли «Откуда узнали» и классы преподавателя. */
.ob-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.ob-pill { height: 48px; padding: 0 20px; border-radius: var(--r-pill); border: 1px solid var(--border);
           background: var(--surface); color: var(--text); font-size: 15px; font-weight: 500;
           display: inline-flex; align-items: center; justify-content: center; }
.ob-pill:hover { transform: translateY(-1px); background: var(--surface-2); box-shadow: none; }
.ob-pill.is-on { border-color: var(--accent); background: var(--accent-tint);
                 color: var(--accent-ink); font-weight: 600; }
.ob-pill--num { width: 56px; height: 44px; padding: 0; }

/* «Где и кого вы учите?» */
.ob-places { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ob-place.k-tile { min-height: 96px; padding: 18px 46px 18px 18px; border-radius: 12px; }
.ob-place .k-tile__name { font-size: 16px; margin: 0; }

/* Поля, «Другое», «Дальше». */
.ob-field { display: flex; flex-direction: column; gap: 6px; max-width: 560px; }
.ob-field[hidden] { display: none; }
.ob-label { font-size: 13px; font-weight: 500; color: var(--text2); }
body.ob .ob-input { height: 52px; font-size: 16px; padding: 0 14px; border-width: 1px;
                    border-radius: var(--r-card); }
.ob-other { display: flex; flex-direction: column; gap: 20px; max-width: 440px; }
.js .ob-other.is-folded { display: none; }
.ob-other.is-opening { animation: ob-grow .2s ease-out both; overflow: hidden; }
.ob-next { align-self: flex-start; height: 48px; padding: 0 30px; font-size: 15px; font-weight: 600; gap: 10px; }
.ob-next-wrap { display: flex; }
.js .ob-next-wrap.is-hidden { display: none; }
.ob-next-wrap.is-showing { animation: ob-up .3s cubic-bezier(.2, .7, .2, 1) both; }
.ob-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ob-later { height: 48px; padding: 0 18px; }
.ob-sr-form { display: none; }

/* «Первая группа»: код приглашения. */
.ob-code-card { max-width: 560px; display: flex; align-items: center; justify-content: space-between;
                gap: 16px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 12px;
                background: var(--surface-2); }
.ob-code-k { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
             color: var(--text2); }
.ob-code { font-size: 26px; font-weight: 600; letter-spacing: .12em; margin-top: 2px;
           font-variant-numeric: tabular-nums; }

/* Смена шага без перезагрузки (onboarding.js): старый уезжает влево и гаснет,
   новый приезжает справа; «Назад» — зеркально; смена этапа класс → уровень. */
.ob-leave { animation: ob-out .2s ease-in both; }
.ob-leave-back { animation: ob-out-back .2s ease-in both; }
.ob-enter { animation: ob-in .32s cubic-bezier(.2, .7, .2, 1) both; }
.ob-enter-back { animation: ob-in-back .32s cubic-bezier(.2, .7, .2, 1) both; }
.ob-stage-out .ob-grades, .ob-stage-out .ob-notpupil, .ob-stage-out .ob-levels,
.ob-stage-out .ob-picked { animation: ob-shrink .2s ease-in both; }

/* ══ Сборка плана ════════════════════════════════════════════════════════ */
.ob-build { flex: 1; min-height: 60vh; display: flex; flex-direction: column; align-items: center;
            justify-content: center; gap: 34px; padding: 40px 16px; }
.ob-build-lines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column;
                  gap: 16px; width: 380px; max-width: 100%; }
.ob-build-lines li { display: flex; align-items: center; gap: 14px; font-size: 17px; font-weight: 500;
                     opacity: 0; animation: ob-up .35s cubic-bezier(.2, .7, .2, 1) forwards;
                     animation-delay: calc(var(--i) * .45s + .2s); }
.ob-bi { position: relative; width: 26px; height: 26px; flex-shrink: 0; }
.ob-bi-spin { position: absolute; inset: 0; border-radius: var(--r-pill); border: 3px solid var(--chip-bg);
              border-top-color: var(--accent);
              animation: ob-spin .8s linear infinite, ob-hide .01s forwards;
              animation-delay: 0s, calc(var(--i) * .45s + .6s); }
.ob-bi-ok { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--accent);
            color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center;
            opacity: 0; animation: ob-okpop .3s ease-out forwards; animation-delay: calc(var(--i) * .45s + .6s); }
@keyframes ob-hide { to { opacity: 0; } }
@keyframes ob-okpop { 0% { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.08); }
                      100% { opacity: 1; transform: scale(1); } }
.ob-build-skip { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ob-build-skip:focus { position: static; width: auto; height: auto; clip: auto; }

/* ══ «План готов» ════════════════════════════════════════════════════════ */
.pl { width: 100%; max-width: 1280px; margin: 0 auto; padding: 30px 80px 32px; display: flex;
      flex-direction: column; gap: 22px; }
.pl-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.pl-head-t { min-width: 0; }
.pl-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.pl-chip { background: var(--accent-tint); border: 1px solid var(--accent-ring); color: var(--accent-ink); }
.pl-edit { font-size: 13px; font-weight: 500; margin-left: 4px; color: var(--accent-ink); }
.pl-start { height: 58px; min-width: 260px; padding: 0 36px; font-size: 17px; font-weight: 600;
            gap: 12px; border-radius: 10px; flex-shrink: 0; }
.pl-grid { display: grid; grid-template-columns: 1.15fr 1fr 1fr; grid-template-rows: auto auto; gap: 16px; }
.pl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-panel);
           padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pl-card--tasks { grid-row: 1 / 3; }
.pl-card--search { grid-column: 2 / 4; }
.pl-card-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pl-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--bg); color: var(--accent-ink);
          display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pl-plate { width: 64px; height: 42px; padding: 5px 7px; border-radius: 10px; background: #ffffff;
            border: 1px solid var(--border-soft); display: inline-flex; align-items: center;
            justify-content: center; flex-shrink: 0; }
.pl-plate img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pl-card-h { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.3; }
.pl-tasks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.pl-tasks li + li { border-top: 1px solid var(--border-soft); }
.pl-task { display: flex; align-items: center; gap: 12px; padding: 11px 10px; margin: 0 -10px;
           border-radius: var(--r); text-decoration: none; color: inherit; transition: background var(--t, .12s); }
.pl-task:hover { background: var(--bg); }
.pl-task:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 0; }
.pl-task-body { min-width: 0; flex: 1; }
/* Название целиком, с переносом по слогам: без обрезки посреди слова (раунд 2). */
.pl-task-t { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.35; hyphens: auto;
             overflow-wrap: break-word; }
.pl-task-m { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 12.5px;
             color: var(--text3); margin-top: 3px; }
.pl-dot { width: 8px; height: 8px; border-radius: var(--r-pill); display: inline-block; }
.pl-stars { color: var(--amber); letter-spacing: 1px; font-weight: 600; }
.pl-stars i { font-style: normal; }
.pl-stars i.off { color: var(--border); }
.pl-go { margin-left: auto; color: var(--text3); flex-shrink: 0; }
.pl-days { display: flex; align-items: baseline; gap: 8px; }
.pl-days b { font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -.02em; color: var(--accent-ink); }
.pl-days span { font-size: 14px; color: var(--text2); }
.pl-sub { font-size: 14px; color: var(--text2); }
.pl-btn { margin-top: auto; }
.pl-btn--auto { align-self: flex-start; }
.pl-query { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 8px 14px;
            border-radius: var(--r-card); border: 1px solid var(--border); background: var(--bg);
            font-size: 15px; color: var(--text2); text-decoration: none; }
.pl-query:hover { color: var(--text); border-color: var(--text3); }
.pl-soon { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: var(--r-card);
           border: 1px dashed var(--border); font-size: 14px; color: var(--text2); }
.pl-soon-chip { flex-shrink: 0; background: transparent; border: 1px solid var(--border); }
.pl-cta { display: none; }
.pl-pd1, .pl-pd2, .pl-pd3, .pl-pd4, .pl-pd5 { animation: ob-up .4s cubic-bezier(.2, .7, .2, 1) both; }
.pl-pd1 { animation-delay: .08s; } .pl-pd2 { animation-delay: .16s; } .pl-pd3 { animation-delay: .24s; }
.pl-pd4 { animation-delay: .32s; } .pl-pd5 { animation-delay: .40s; }

/* ── Узкие экраны ──────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .ob-body { padding: 48px 32px 40px; gap: 32px; }
  .pl { padding: 24px 32px 32px; }
  .ob-main > .ob-fine { padding: 0 32px 16px; }
}
@media (max-width: 960px) {
  .ob-me { display: none; }
  .ob-top { grid-template-columns: auto 1fr auto; gap: 16px; padding: 0 20px; }
  .pl-grid { grid-template-columns: 1fr 1fr; }
  .pl-card--tasks { grid-row: auto; grid-column: 1 / -1; }
  .pl-card--search { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .ob-top { height: 56px; grid-template-columns: 1fr; padding: 0 16px; }
  .ob-logo, .ob-out { display: none; }
  .ob-mid { max-width: none; gap: 12px; }
  .ob-body { padding: 22px 16px 0; }
  .ob-q, .ob-form { gap: 18px; }
  .ob-h { font-size: 26px; }
  .ob-err { margin-top: -6px; }
  .ob-role, .ob-levels, .ob-goals, .ob-places { grid-template-columns: 1fr; }
  .ob-role .k-tile { min-height: 0; padding: 20px; }
  .ob-grades { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ob-grade.k-tile { height: 88px; }
  .ob-goal.is-wide { grid-column: auto; }
  .ob-pill { height: 44px; padding: 0 16px; font-size: 14px; }
  .ob-field, .ob-other { max-width: none; }
  /* «Дальше» прибита к низу экрана; подвал с документами — под ней, в потоке. */
  .ob-next-wrap { position: sticky; bottom: 0; z-index: 4; margin: 0 -16px; padding: 12px 16px 14px;
                  background: var(--surface); border-top: 1px solid var(--border-soft); }
  .ob-next-wrap .ob-next, .ob-other .ob-next, .ob-email .ob-next, .ob-group .ob-next {
    width: 100%; height: 52px; justify-content: center; font-size: 16px; }
  .ob-main > .ob-fine { padding: 16px 16px 12px; }
  .ob-code { font-size: 22px; }
  .pl { padding: 20px 16px 0; }
  .pl-head .pl-start { display: none; }
  .pl-grid { grid-template-columns: 1fr; }
  .pl-card--tasks, .pl-card--search { grid-column: auto; }
  .pl-cta { display: block; position: sticky; bottom: 0; z-index: 4; margin: 0 -16px;
            padding: 12px 16px 14px; background: var(--surface); border-top: 1px solid var(--border-soft); }
  .pl-cta .pl-start { width: 100%; min-width: 0; height: 52px; }
}

/* «Уменьшить движение»: никакого движения, только мгновенная смена. */
@media (prefers-reduced-motion: reduce) {
  body.ob *, body.ob *::before, body.ob *::after,
  body.au *, body.au *::before, body.au *::after {
    animation: none !important; transition: none !important; }
  .ob-build-lines li { opacity: 1; }
  .ob-bi-spin { display: none; }
  .ob-bi-ok { opacity: 1; }
  .ob-mark svg { stroke-dashoffset: 0; }
}
