/* Движок: устройство HUD (окна, песочница, чат, содержание) без оформления. Оформление — в теме курса (site.theme). */
/* ---------- иконки ---------- */
.ic { width: 1.2em; height: 1.2em; vertical-align: -0.22em; flex: 0 0 auto; }
.section-title.has-ic::before { content: none; }
.section-title .ic { width: 1.5em; height: 1.5em; margin-right: 10px; padding: 5px; box-sizing: content-box; }
/* титульная: герой с ассистентом */
.hero { display: flex; align-items: center; justify-content: center; gap: 28px; flex-wrap: wrap; margin-bottom: 6px; }
.hero img { width: 150px; height: auto; }
.hero-text { flex: 1 1 360px; min-width: 0; }
.hero-text .main-title { text-align: left; margin-top: 4px; }
@media (max-width: 640px) {
    .hero { gap: 6px; }
    .hero-text .main-title { text-align: center; }
    .hero img { width: 120px; }
}
/* ---------- кнопки «вход» и «тема» (theme.js, auth.js) ----------
   десктоп: в окне «Карта» (ряд .ctx-tools; у свёрнутой «Карты» — на её кнопке);
   телефон/планшет: вход — в шапке над контентным блоком справа (#top-tools, на средней линии декора, по правому краю блока),
   тема — квадратная, под кнопкой меню в углу блока; при прокрутке остаётся под кнопкой меню */
#top-tools { position: relative; height: 0; z-index: 5; }
#top-tools.free { position: fixed; top: 8px; right: 8px; height: auto; display: flex; gap: 8px; z-index: 1002; }
#top-tools:not(.free) > #auth-toggle { position: absolute; right: 0; bottom: calc(var(--strip-h, 44px) / 2 - 20px); }
#theme-toggle { flex: none; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; padding: 0; }
#theme-toggle .ic { width: 18px; height: 18px; }
@media (max-width: 1023px) {
    .slide > h2:first-child { margin-top: -8px; padding-right: 56px; min-height: 44px; }   /* заголовок в одну строку с кнопкой меню справа, чуть выше */
}
/* телефон/планшет: вход и тема лежат в выезжающей панели меню, под шапкой */
.toc-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; }
.toc-tools:empty { display: none; }
html body .toc-tools #theme-toggle { width: 40px; height: 40px; border: none; border-radius: 12px; background: var(--h-btn, rgba(0, 0, 0, .07)); color: var(--h-text, inherit); box-shadow: none; }
.toc-tools #theme-toggle .ic { width: 20px; height: 20px; }
html body .toc-tools #auth-toggle { flex: 1 1 auto; justify-content: flex-start; width: auto; height: 40px; min-width: 0; max-width: none; padding: 0 10px 0 4px; gap: 10px; border: none; border-radius: 12px; background: var(--h-btn, rgba(0, 0, 0, .07)); box-shadow: none; color: var(--h-text, inherit); font-size: 15px; font-weight: 600; }
html body .toc-tools #auth-toggle:not(.in) { padding: 0 12px 0 10px; border-radius: 12px; width: auto; }
.toc-tools #auth-toggle .auth-name { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc-tools #auth-toggle .auth-av { margin: 0; }
.toc-tools #auth-toggle .auth-av.sm { width: 32px; height: 32px; }
.toc-tools #auth-toggle .ic { width: 18px; height: 18px; color: var(--h-gold, inherit); }
/* ряд кнопок внутри «Карты» (десктоп) */
.ctx-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 0; }
.ctx-tools:empty { display: none; }
.ctx-tools-pill { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
.ctx-tools-pill:empty { display: none; }
/* в окне «Карта» кнопки плоские, как родные .hud-btn: тема — такая же квадратная кнопка, профиль — не кнопка, а аватарка с именем */
.ctx-tools #theme-toggle, .ctx-tools-pill #theme-toggle { width: 26px; height: 26px; border: none; border-radius: 8px; background: var(--h-btn); color: var(--h-text); box-shadow: none; }
.ctx-tools #theme-toggle:hover, .ctx-tools-pill #theme-toggle:hover { background: var(--h-btn-h); filter: none; }
.ctx-tools #theme-toggle .ic, .ctx-tools-pill #theme-toggle .ic { width: 15px; height: 15px; }
.ctx-tools #auth-toggle, .ctx-tools-pill #auth-toggle { width: auto; height: 28px; min-width: 0; max-width: 190px; padding: 0 8px 0 2px; gap: 8px; border: none; border-radius: 8px; background: transparent; box-shadow: none; color: var(--h-text); font-size: 13.5px; font-weight: 600; }
.ctx-tools #auth-toggle:not(.in), .ctx-tools-pill #auth-toggle:not(.in) { width: auto; padding: 0 8px 0 6px; border-radius: 8px; }
.ctx-tools #auth-toggle:hover, .ctx-tools-pill #auth-toggle:hover { background: var(--h-btn); filter: none; }
.ctx-tools #auth-toggle .auth-av, .ctx-tools-pill #auth-toggle .auth-av { margin: 0; }
.ctx-tools #auth-toggle .auth-av.sm, .ctx-tools-pill #auth-toggle .auth-av.sm { width: 24px; height: 24px; font-size: 10px; }
.ctx-tools #auth-toggle .ic, .ctx-tools-pill #auth-toggle .ic { width: 16px; height: 16px; color: var(--h-gold); }
.ctx-tools-pill #auth-toggle .auth-name { max-width: 80px; }
/* ============================================================
   HUD десктопа
   ============================================================ */
.hud-layer { display: none; }
@media (min-width: 1024px) {
    #toc-sidebar, #toc-toggle, #toc-backdrop { display: none !important; }
    body.toc-on { padding-left: 0 !important; }
    .hud-layer { display: block; }
    body { padding: 2px 24px 90px; }
/* сверху место занимает корона слайда (44px) */
    body.hud-gutter { padding-right: 392px; }
/* основной контент: «стекло» с золотой кромкой (цвета — из темы) */
    .slide { position: relative; z-index: 1; max-width: none; width: 100%; margin: 0 auto; padding: 34px 48px 40px; }
    .slide > p, .theory-block > p, .task > p { max-width: 80ch; }
    a.back, a.forward { padding: 9px 20px; }
}
/* /min-width:1024px */
/* ============================================================
   Окна HUD: общие стили (десктоп — плавающие окна, телефон — шторки)
   ============================================================ */
.hud-win { position: fixed; z-index: 1040; }
.hud-win.hud-front { z-index: 1060; }
.hud-win.pai { z-index: 1100; }
.hud-frame { display: flex; flex-direction: column; overflow: hidden; width: 100%; height: 100%; }
.hud-head { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 9px 10px 9px 14px; cursor: grab; user-select: none; touch-action: none; }
.hud-head:active { cursor: grabbing; }
.hud-title { flex: 1; display: flex; align-items: center; gap: 8px; }
.hud-btn { min-width: 26px; height: 26px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 6px; }
.hud-btn .ic { width: 15px; height: 15px; }
.hud-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.hud-pill { display: none; align-items: center; gap: 8px; cursor: pointer; user-select: none; touch-action: none; padding: 9px 16px 9px 12px; }
.hud-win.collapsed .hud-frame { display: none; }
.hud-win.collapsed .hud-pill { display: inline-flex; }
/* ---------- «Карта» ---------- */
.ctx-progress { padding: 10px 14px 4px; }
.ctx-progress .bar { height: 8px; overflow: hidden; }
.ctx-progress .bar > i { display: block; height: 100%; width: 0; transition: width .4s ease; }
.ctx-search { margin: 8px 12px; position: relative; }
.ctx-search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; pointer-events: none; }
.ctx-search input { width: 100%; padding: 8px 12px 8px 34px; }
.ctx-list { flex: 1; overflow-y: auto; padding: 2px 8px 8px; scroll-behavior: smooth; }
.ctx-list::-webkit-scrollbar { width: 8px; }
.ctx-sec { margin: 10px 6px 4px; display: flex; align-items: center; gap: 7px; }
.ctx-sec .ic { width: 15px; height: 15px; }
.ctx-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; margin: 1px 0; }
.ctx-item .tick { width: 16px; flex: 0 0 16px; display: inline-grid; place-items: center; }
.ctx-item .tick .ic { width: 14px; height: 14px; }
.ctx-foot { display: flex; }
.ctx-foot .ctx-all { flex: 1; text-align: center; padding: 10px 4px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.ctx-item.res { display: block; padding: 8px 10px; }
.ctx-item .r-t { display: block; }
.ctx-item .r-s { display: block; }
.ctx-item .r-x { display: block; margin-top: 2px; }
.ctx-item mark { padding: 0 1px; }
/* ---------- ассистент ---------- */
.pai-av { position: relative; cursor: pointer; width: 118px; height: 118px; touch-action: none; user-select: none; }
.pai-av img { position: absolute; left: 50%; bottom: -4px; width: 104%; height: auto; transform: translateX(-50%); pointer-events: none; }
.pai-bubble { position: absolute; right: 100%; top: 6px; margin-right: 12px; width: 210px; padding: 9px 12px; display: none; }
.hud-win.collapsed .pai-bubble.show { display: block; }
@media (min-width: 1024px) {                                   /* десктоп: реплика всплывает над ассистентом, а не закрывает «Песочницу» слева от него */
    .pai-bubble { right: 0; top: auto; bottom: 100%; margin: 0 0 10px; }
}
.pai-head-av { position: relative; display: inline-block; flex: 0 0 auto; width: 34px; height: 34px; overflow: hidden; }
.pai-head-av img { position: absolute; left: 50%; top: -56%; width: 176%; /* лицо по центру кружка; срезается нимб, а не подбородок */
    height: auto; transform: translateX(-50%); }
.pai-head-sm { width: 26px; height: 26px; }
.term-row { display: inline-flex; align-items: center; gap: 8px; vertical-align: middle; }
.term-in { min-width: 12ch; width: 22ch; max-width: 60vw; padding: 3px 8px; }
/* введённое пользователем в выводе программы: бледнее и на подложке, чтобы не путать с тем, что напечатала сама программа */
.code-out .ti { padding: 0 3px; margin: 0 -1px; }
.term-eof { padding: 2px 9px; cursor: pointer; }
.pai-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pai-m { max-width: 88%; padding: 8px 12px; white-space: pre-wrap; word-break: break-word; }
.pai-m.bot { align-self: flex-start; }
.pai-m.me { align-self: flex-end; }
.pai-m.bot code { padding: 0 4px; }
.pai-m .pai-code { margin: 6px 0 2px; padding: 8px 10px; white-space: pre; overflow-x: auto; }
.pai-m.bot .pai-code code { padding: 0; background: none; font: inherit; text-shadow: none; white-space: pre; }
/* записанные во вкладку файлы тестов: карточка под ответом */
.pai-edit { margin: 8px 0 2px; padding: 8px 10px; white-space: normal; }
.pai-edit-n { font-weight: 700; }
.pai-edit-note { margin-top: 4px; font-size: 12px; }
.pai-edit-b { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.pai-edit-btn { padding: 4px 11px; cursor: pointer; }
.pai-m.bot a.pai-link { text-underline-offset: 2px; }
/* схемы ассистента (рисует dg.js): светлая карточка внутри пузыря, по клику открывается крупно */
.pai-m.bot.has-dg { width: 96%; max-width: 96%; }
.pai-dg { margin: 8px 0 4px; padding: 7px 7px 6px; white-space: normal; cursor: zoom-in; }
.pai-dg .dg-t { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; }
.pai-dg .dg-t span { min-width: 0; overflow-wrap: anywhere; }
.pai-dg .dg-ic { flex: none; width: 24px; height: 24px; }
.pai-dg svg.dg-s { display: block; width: 100%; height: auto; }
.pai-dg figcaption { margin-top: 5px; }
.pai-dg .dg-tbl { overflow-x: auto; }
.pai-dg table { width: 100%; text-align: center; }
.pai-dg th, .pai-dg td { padding: 4px 6px; }
.pai-dg tbody th { width: 2.6em; }
.dg-zoom { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; padding: 16px; overflow: auto; cursor: zoom-out; }
.dg-zoom .pai-dg { width: min(780px, 100%); margin: 0; padding: 14px 14px 12px; cursor: zoom-out; }
.dg-zoom .pai-dg .dg-ic { width: 34px; height: 34px; }
.pai-m.typing { opacity: .7; }
.pai-form { display: flex; gap: 6px; padding: 8px; }
.pai-form input { flex: 1; padding: 8px 12px; }
.pai-form button { padding: 0 14px; cursor: pointer; display: grid; place-items: center; }
.pai-form button:disabled { opacity: .5; cursor: progress; }
.pai-form button .ic { width: 17px; height: 17px; }
.pai-note { padding: 0 12px 8px; }
.hud-win.pai .hud-pill { display: none !important; }
.hud-win.pai.collapsed .pai-av { display: block; }
.hud-win.pai:not(.collapsed) .pai-av { display: none; }
/* ---------- песочница ---------- */
.code-win:not(.collapsed):not(.max) { overflow: hidden; }
/* ручки изменения размера: края и углы окна (только десктоп) */
.hud-rz { position: absolute; z-index: 5; touch-action: none; }
.hud-win.collapsed .hud-rz, .hud-win.max .hud-rz { display: none; }
.rz-e { top: 14px; bottom: 14px; right: -4px; width: 9px; cursor: ew-resize; }
.rz-w { top: 14px; bottom: 14px; left: -4px; width: 9px; cursor: ew-resize; }
.rz-s { left: 14px; right: 14px; bottom: -4px; height: 9px; cursor: ns-resize; }
.rz-se { right: -4px; bottom: -4px; width: 18px; height: 18px; cursor: nwse-resize; }
.rz-sw { left: -4px; bottom: -4px; width: 18px; height: 18px; cursor: nesw-resize; }
.rz-se::after, .rz-sw::after { content: ""; position: absolute; bottom: 7px; width: 9px; height: 9px; opacity: .8; }
.rz-se::after { right: 7px; }
.rz-sw::after { left: 7px; }
@media (max-width: 1023px) {
    .hud-rz { display: none !important; }
}
.code-win.max { inset: 2.5vh 2.5vw !important; width: auto !important; height: auto !important; z-index: 1055; }
.code-ed { flex: 1; min-height: 0; margin: 10px 10px 0; padding: 10px; resize: none; tab-size: 4; white-space: pre; }
.code-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.code-run { padding: 7px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.code-run .ic { width: 14px; height: 14px; }
.code-run:disabled { opacity: .6; cursor: progress; }
.code-bar .hud-btn { width: auto; padding: 0 10px; gap: 5px; }
.code-out { flex: 0 0 auto; margin: 0 10px 10px; padding: 8px 10px; max-height: 32%; overflow: auto; white-space: pre-wrap; min-height: 40px; }
.code-stdin { margin: 8px 10px 0; padding: 8px 10px; resize: vertical; }
.code-stdin[hidden], .code-files[hidden] { display: none; }
.code-files { margin: 0 10px 6px; }
.pre-run { position: absolute; top: 8px; right: 8px; padding: 3px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; opacity: 0; transition: opacity .15s; }
.pre-run .ic { width: 12px; height: 12px; }
pre:hover .pre-run, .pai-cw:hover .pre-run, .pre-run:focus { opacity: 1; }
.pai-cw { position: relative; }
.code-ed-host { flex: 1 1 auto; min-height: 90px; margin: 10px 10px 0; position: relative; overflow: hidden; }
.code-ed-host .code-ed { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; }
.code-ed-host .CodeMirror { position: absolute; inset: 0; height: 100%; }
html body .CodeMirror-hints { z-index: 1200 !important; padding: 4px; max-height: 14em; }
html body .CodeMirror-hints li.CodeMirror-hint { padding: 3px 8px; display: flex; align-items: center; gap: 8px; }
.ph-ico { width: 16px; text-align: center; flex: 0 0 16px; }
.ph-kind { margin-left: auto; padding-left: 16px; }
.ph-detail { overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
/* ============================================================
   Телефон и планшет (<1024px): ассистент и песочница — нижние «шторки»
   ============================================================ */
@media (max-width: 1023px) {
    .hud-layer { display: block; }
    .ctx-win { display: none !important; }
/* вместо «Карты» — боковое содержание (toc.js) */
/* свёрнутое: кнопки-«запуски» в правом нижнем углу; положение задаёт CSS, а не JS */
    .hud-win.collapsed { left: auto !important; top: auto !important; width: auto !important; height: auto !important; right: 14px !important; z-index: 1085; }
    .hud-win.pai.collapsed { bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; }
    .hud-win.code-win.collapsed { bottom: calc(14px + env(safe-area-inset-bottom, 0px)) !important; }
    .pai-av { width: 76px; height: 76px; }
    .pai-bubble { width: min(210px, 56vw); }
    .hud-pill { padding: 11px 16px 11px 13px; }
/* раскрытое: шторка снизу; над экранной клавиатурой (переменные ставит hud.js из visualViewport) */
    .hud-win:not(.collapsed) { left: 0 !important; right: 0 !important; top: auto !important; width: auto !important; bottom: var(--sheet-bottom, 0px) !important; height: var(--normal-h) !important; z-index: 1200; }
    .hud-win:not(.collapsed) .hud-frame { padding-bottom: env(safe-area-inset-bottom, 0px); }
    .hud-head { cursor: default; padding: 12px 12px 12px 16px; }
    .hud-btn { min-width: 36px; height: 36px; }
    [data-max], [data-reset] { display: none !important; }
    body.m-both .code-win:not(.collapsed) { top: 0 !important; bottom: auto !important; }
/* экранная клавиатура открыта: печатающее окно стоит над клавиатурой — обычной высоты, если помещается, иначе занимает всё свободное место;
       второе окно на это время прячется */
    body.kb-open .hud-win:not(.collapsed) { top: auto !important; bottom: var(--sheet-bottom, 0px) !important; height: min(var(--normal-h), var(--vvh, 100dvh)) !important; }
    body.kb-open.kb-active-any.m-both .hud-win:not(.collapsed):not(.kb-active) { visibility: hidden; }
/* панель инструментов редактора (только сенсорные экраны) */
    .code-toolwrap { display: block; position: relative; flex: 0 0 auto; }
    .code-tools { display: flex; gap: 5px; padding: 7px 8px 0; }
    .code-tools button, .code-more button { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
    .code-tools button { position: relative; flex: 1 1 0; min-width: 0; height: 42px; padding: 0; touch-action: none; }
    .code-tools .ic { width: 20px; height: 20px; }
    .code-tools button.has-menu::after { content: ""; position: absolute; right: 5px; bottom: 5px; opacity: .65; }
    .code-more { position: absolute; bottom: calc(100% + 4px); z-index: 5; max-height: 48vh; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 8px 10px 10px; }
    .code-more.wide { left: 8px; right: 8px; }
    .code-more.narrow { right: auto; min-width: 150px; max-width: calc(100% - 16px); }
    .code-more[hidden] { display: none; }
    .more-h { margin: 6px 0 4px; }
    .more-h:first-child { margin-top: 0; }
    .more-g { display: flex; flex-wrap: wrap; gap: 6px; }
    .code-more button { min-width: 42px; height: 40px; padding: 0 12px; gap: 8px; touch-action: manipulation; }
    .code-more button .ic { width: 18px; height: 18px; }
    .code-more button span { white-space: nowrap; }
    .code-more.narrow { padding: 6px 8px; }
    .code-more.narrow .more-g { display: flex; flex-direction: column; gap: 3px; }
/* меню по долгому тапу — один столбец: удобно вести пальцем вверх-вниз */
    .code-more.narrow button { height: 34px; justify-content: flex-start; }
    .code-ed-host .CodeMirror-lines { padding-bottom: 64px; }
/* запас под последней строкой: туда можно тапнуть, чтобы начать новую */
    body.m-both .code-ed-host { min-height: 60px; }
    body.m-both .code-out { max-height: 30%; }
    .code-win:not(.collapsed):not(.max) { resize: none; min-width: 0; min-height: 0; }
    #sheet-backdrop { position: fixed; inset: 0; z-index: 1150; opacity: 0; pointer-events: none; transition: opacity .2s; }
    #sheet-backdrop.on { opacity: 1; pointer-events: auto; }
    .pai-form input { padding: 11px 14px; }
    .pai-form button { padding: 0 18px; }
    .pai-msgs { padding: 14px; }
    .pai-m { max-width: 92%; }
    .code-bar { flex-wrap: wrap; }
    .code-run { padding: 10px 18px; }
    .code-bar .hud-btn { height: 38px; }
    .code-ed-host { min-height: 120px; }
    .code-out { max-height: 38%; }
/* на сенсорных экранах наведения нет — кнопка «в песочницу» видна всегда */
/* кнопка «в песочницу»: отступ до края блока сверху равен просвету до первой строки снизу (7px / ~7px) */
    .pre-run { opacity: 1; top: 7px; right: 8px; height: 32px; box-sizing: border-box; padding: 0 13px; }
    .pre-run .ic { width: 14px; height: 14px; }
    pre[class*="language-"] { padding-top: 40px; }
/* автодополнение: крупнее под палец */
    html body .CodeMirror-hints li.CodeMirror-hint { padding: 8px 10px; }
}
/* ============================================================
   Боковое содержание телефона/планшета (toc.js): прогресс, поиск, иконки
   ============================================================ */
#toc-toggle .ic { width: 22px; height: 22px; }
.toc-x .ic { width: 16px; height: 16px; }
.toc-progress { padding: 10px 14px 2px; }
.toc-bar { height: 7px; overflow: hidden; }
.toc-bar > i { display: block; height: 100%; }
.toc-search { position: relative; margin: 8px 12px; }
.toc-search .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; pointer-events: none; }
.toc-search input { width: 100%; padding: 10px 12px 10px 34px; }
.toc-sec-title .ic { width: 18px; height: 18px; }
.toc-items a { display: flex; align-items: center; gap: 6px; }
.toc-tick { display: inline-grid; place-items: center; margin-left: -20px; width: 16px; }
.toc-tick .ic { width: 13px; height: 13px; }
.toc-foot { display: flex; }
.toc-foot .toc-all { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 6px; }
.toc-results { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px; }
.toc-res { display: block; padding: 9px 10px; }
.toc-res .r-t { display: block; }
.toc-res .r-s { display: block; }
.toc-res .r-x { display: block; margin-top: 2px; }
.toc-res mark { padding: 0 1px; }
.toc-empty { padding: 16px; text-align: center; }
/* телефон: пока открыта боковая панель, плавающие кнопки и «гамбургер» не должны её перекрывать */
body.toc-drawer #toc-toggle, body.toc-drawer .hud-win.collapsed { visibility: hidden; }
/* панель инструментов редактора скрыта на десктопе */
.code-toolwrap { display: none; }
@media (max-width: 1023px) {
    .code-toolwrap { display: block; }
}
/* телефон: когда одна шторка открыта, свёрнутое второе окно — компактный оверлей (аватар ассистента / «Код») в свободной области сверху справа,
   как на десктопе; пока открыта экранная клавиатура, оверлей скрыт */
@media (max-width: 1023px) {
    body[data-sheet="code"] .hud-win.pai.collapsed,
    body[data-sheet="pai"] .code-win.collapsed { bottom: auto !important; top: calc(14px + env(safe-area-inset-top, 0px)) !important; z-index: 1250; }
    body.kb-open .hud-win.collapsed { visibility: hidden; }
}
/* полоска подсказок автодополнения на телефоне (над панелью инструментов) */
.code-sugg { display: none; }
@media (max-width: 1023px) {
    .code-sugg:not([hidden]) { display: flex; gap: 6px; padding: 7px 10px 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .code-sugg::-webkit-scrollbar { display: none; }
    .code-sugg .sg { flex: 0 0 auto; height: 36px; padding: 0 14px; cursor: pointer; }
}
/* «Поделиться» и страница просмотра ссылки */
.code-sharebox { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 10px 8px; }
.code-sharebox .sh-note { flex: 1 0 100%; margin: 0; }
.code-sharebox .sh-new { padding: 0; cursor: pointer; }
.code-sharebox[hidden] { display: none; }
.code-sharebox .sh-url { flex: 1; min-width: 0; padding: 6px 10px; }
.code-sharebox .sh-copy { flex: 0 0 auto; padding: 0 12px; cursor: pointer; }
.sh-out { margin: 10px 0 0; padding: 10px 12px; white-space: pre-wrap; }
.sh-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.sh-hint { flex: 1 1 260px; }
[hidden] { display: none !important; }
/* «Сообщить об ошибке» / «Пожаловаться»: кнопка в конце страницы и диалог */
.page-foot { clear: both; margin-top: 30px; padding-top: 14px; text-align: center; }
.rep-open { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; cursor: pointer; }
.rep-open .ic { width: 15px; height: 15px; }
.rep-dlg { width: min(460px, 92vw); padding: 0; }
.rep-form { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 16px; }
.rep-form h3 { margin: 0; }
.rep-form label { display: flex; flex-direction: column; gap: 5px; }
.rep-form select, .rep-form textarea { padding: 9px 11px; }
.rep-form textarea { resize: vertical; min-height: 84px; }
/* список открывается системным окном: без своих цветов в тёмной теме светлый текст на белом */
.rep-key { display: none; margin-left: 6px; padding: 0 6px; }
@media (hover: hover) and (min-width: 1024px) {
    .rep-key { display: inline-block; }
}
.rep-form label.rep-attach { flex-direction: row; align-items: center; gap: 8px; }
.rep-form label[hidden] { display: none; }
.rep-note { margin: 0; }
.rep-status { margin: 0; min-height: 1.3em; }
.rep-btns { display: flex; justify-content: flex-end; gap: 10px; }
.rep-btns button { padding: 8px 18px; cursor: pointer; }
.rep-btns button:disabled { opacity: .55; cursor: progress; }
/* ---- размер шрифта кода на телефоне: ступени (база — на ступень меньше прежнего), меняются щипком (hud.js) ---- */
@media (max-width: 1023px) {
    .CodeMirror, pre[class*="language-"], .code-out { touch-action: pan-x pan-y; }
}
/* ---- «захват» (кнопка в панели редактора): подсветка режима и захваченного фрагмента ---- */
.code-ed-host.cm-capturing::after { content: ""; position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.code-ed-host.cm-capturing .CodeMirror { cursor: crosshair; }
/* ---- вкладки окна песочницы и вкладка «Тесты» ---- */
.code-tabs { display: flex; gap: 6px; padding: 8px 10px 0; flex: 0 0 auto; }
.code-tabs button { padding: 5px 14px; cursor: pointer; }
.code-tabs .tt-cnt { opacity: .75; }
.code-win.tab-tests :is(.code-ed-host, .code-ftabs, .code-toolwrap, .code-bar, .code-out, .code-files, .code-sharebox, .code-lintres, .code-sent) { display: none !important; }
.code-tests { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 8px 10px 10px; gap: 8px; overflow: hidden; }
.code-tests[hidden] { display: none; }
.tt-head { display: flex; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; }
.tt-run { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; cursor: pointer; }
.tt-run:disabled { opacity: .55; cursor: progress; }
.tt-run .ic { width: 15px; height: 15px; }
.tt-head .hud-btn { height: 34px; padding: 0 12px; }
.tt-sum { flex: 0 0 auto; min-height: 1.2em; }
.tt-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.tt-empty { margin: 4px 0; }
.tt-case { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.tt-top { display: flex; align-items: center; gap: 8px; }
.tt-chip { flex: 1; }
.tt-del { width: 26px; height: 26px; cursor: pointer; display: grid; place-items: center; }
.tt-del .ic { width: 13px; height: 13px; }
.tt-case label { display: flex; flex-direction: column; gap: 3px; }
.tt-case textarea { padding: 6px 8px; resize: vertical; min-height: 40px; }
.tt-res { display: flex; flex-direction: column; gap: 4px; }
.tt-blk { display: flex; flex-direction: column; gap: 2px; }
.tt-blk pre { margin: 0; padding: 6px 8px; white-space: pre-wrap; word-break: break-word; max-height: 140px; overflow: auto; }
@media (max-width: 1023px) {
    body.kb-open .code-tabs { display: none; }
}
/* подсветка расхождений вывода с ожидаемым (вкладка «Тесты» и блок «Прогон» у ассистента); цвета с прозрачностью — годятся и на тёмном, и на светлом фоне */
.df { white-space: pre-wrap; word-break: break-word; }
.tt-blk pre.df { max-height: 240px; }
.df-l { display: block; position: relative; padding-left: 2.8em; min-height: 1.4em; }
.df-l[data-n]::before { content: attr(data-n); position: absolute; left: 0; width: 2.2em; text-align: right; opacity: .45; user-select: none; }
.df-caret { display: inline-block; width: 0; height: 1.25em; vertical-align: text-bottom; margin: 0 -1px; }
.df-gap { opacity: .55; }
.df-note { margin-top: 2px; }
/* доказательство прогона под ответом ассистента (внутри светлого «пузыря») */
.pai-runs { margin-top: 8px; padding-top: 6px; }
.pai-runs summary { cursor: pointer; }
.pai-runs-b { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.pr-row { padding: 5px 8px; }
.pr-top { margin-bottom: 2px; }
.pr-line { display: flex; gap: 6px; align-items: baseline; }
.pr-lbl { flex: 0 0 auto; min-width: 62px; }
.pr-ref > summary { cursor: pointer; }
.pr-ref .pai-code { margin: 5px 0 2px; max-height: 240px; overflow: auto; }
.pr-line pre, .pr-code pre { margin: 0; white-space: pre-wrap; word-break: break-word; padding: 0 !important; }
.pr-code pre { padding: 5px 7px !important; max-height: 160px; overflow: auto; }
.pr-add { align-self: flex-start; padding: 5px 12px; cursor: pointer; }

/* проверка кода линтерами: группа «кнопка + шестерёнка», окошко выбора проверок и список найденного (оформление — в теме курса) */
.code-lintgrp { position: relative; display: inline-flex; align-items: stretch; }
.code-lintgrp .code-lint { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.code-lintgrp .code-lintcfg { padding: 0 8px; border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 1px; }
.code-lintgrp .ic { width: 14px; height: 14px; }
.lint-pop { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 40; box-sizing: border-box; width: min(340px, 86vw); max-height: min(62vh, 380px); overflow-y: auto; padding: 10px 12px; }
.lint-pop[hidden] { display: none; }
.lp-head { font-weight: 700; margin-bottom: 6px; }
.lp-row { display: flex; align-items: flex-start; gap: 8px; padding: 5px 0; cursor: pointer; }
.lp-row input { flex: none; margin-top: 3px; width: 16px; height: 16px; }
.lp-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lp-txt i { font-style: normal; font-size: 11.5px; }
.lp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding-top: 8px; font-size: 12px; }
.lp-reset { cursor: pointer; background: none; border: none; padding: 4px 0; font: inherit; text-decoration: underline; }
.code-lintres { box-sizing: border-box; max-height: 9.5em; overflow-y: auto; padding: 4px 10px 6px; }
.code-lintres[hidden] { display: none; }
.lr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 0 4px; font-size: 12.5px; }
.lr-x { cursor: pointer; background: none; border: none; padding: 2px 6px; font: inherit; }
.lr-item { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 3px 4px; text-align: left; cursor: pointer; font: inherit; font-size: 12.5px; background: none; border: none; }
.lr-pos { flex: none; min-width: 3.4em; font-family: Consolas, Monaco, monospace; }
.lr-code { flex: none; min-width: 3.2em; font-family: Consolas, Monaco, monospace; font-weight: 700; }
.lr-msg { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 1023px) {
    .lr-item { padding: 7px 4px; }
    .lp-row { padding: 8px 0; }
}

.code-bar { position: relative; container-type: inline-size; }
@container (max-width: 600px) { .code-bar .hud-btn:is(.code-reset, .code-share, .code-save) .bl { display: none; } .code-bar .hud-btn:is(.code-reset, .code-share, .code-save) { padding: 0 9px; } }

/* Панель «инструменты» (Go): результат по разделам — что запускалось и что нашлось */
.code-lintres.grouped { max-height: 13em; }
.lr-stale { display: none; margin-right: auto; padding-left: 10px; font-size: 12px; opacity: .8; }
.code-lintres.stale .lr-stale { display: inline; }
.code-lintres.stale .lr-list, .code-lintres.stale .lr-sec { opacity: .6; }
.lr-sec { margin: 0 0 6px; }
.lr-sech { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 8px; padding: 3px 4px; font-size: 12.5px; }
.lr-st { flex: none; width: 1.2em; text-align: center; font-weight: 700; }
.lr-ok .lr-st { color: #2e9d57; }
.lr-issues .lr-st { color: #d98a00; }
.lr-fail .lr-st { color: #d6402b; }
.lr-cmd { font: 11.5px Consolas, Monaco, monospace; opacity: .65; background: none !important; padding: 0 !important; }
.lr-sum { opacity: .85; }
.lr-fix { margin-left: auto; padding: 2px 11px; cursor: pointer; font: 600 12px "Segoe UI", Arial, sans-serif; border: 1px solid var(--h-line, rgba(127, 127, 127, .4)); border-radius: 8px; background: var(--h-btn, rgba(127, 127, 127, .16)); color: inherit; }
.lr-fix:hover { background: var(--h-btn-h, rgba(127, 127, 127, .28)); }
.lr-raw { margin: 2px 4px 4px 22px; font-size: 12px; }
.lr-raw summary { cursor: pointer; opacity: .8; }
.lr-raw pre { margin: 4px 0 0; max-height: 9em; overflow: auto; white-space: pre-wrap; word-break: break-word; padding: 6px 8px; border-radius: 6px; background: rgba(127, 127, 127, .14); font: 12px/1.4 Consolas, Monaco, monospace; }
.lp-cmd { display: block; margin-top: 2px; font: 11px Consolas, Monaco, monospace; opacity: .7; background: none !important; padding: 0 !important; }
.ftab-bad { margin-left: 6px; padding: 0 6px; border-radius: 9px; background: #d6402b; color: #fff; font: 700 11px/16px "Segoe UI", Arial, sans-serif; font-style: normal; }
@keyframes ftab-fresh { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 214, 102, 0); } 35% { box-shadow: 0 0 0 4px rgba(255, 214, 102, .9); } }
.ftab.fresh { animation: ftab-fresh 1.1s ease 2; }

/* Вкладка «Терминал» песочницы */
.code-win.tab-term :is(.code-ed-host, .code-toolwrap, .code-bar, .code-out, .code-files, .code-sharebox, .code-lintres, .code-sent) { display: none !important; }
.code-term { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 8px 10px 10px; gap: 6px; overflow: hidden; position: relative; }
.code-term[hidden] { display: none; }
.tm-top { display: flex; align-items: center; gap: 6px; }
.tm-title { display: inline-flex; align-items: center; gap: 6px; font: 600 12.5px "Segoe UI", Arial, sans-serif; opacity: .85; }
.tm-title .ic { width: 14px; height: 14px; }
.tm-gap { flex: 1 1 auto; }
.tm-menubtn { font-size: 12.5px; }
.tm-menu { position: absolute; left: 10px; right: 10px; top: 44px; bottom: 10px; z-index: 20; overflow: auto; padding: 8px; border-radius: 12px; background: #161a22; border: 1px solid rgba(160, 180, 220, .3); box-shadow: 0 10px 28px rgba(0, 0, 0, .55); }
.tm-menu[hidden] { display: none; }
.tm-mh { margin: 8px 2px 4px; font: 700 11px "Segoe UI", Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #8d97b3; }
.tm-mh:first-child { margin-top: 0; }
.tm-cardrow { display: flex; align-items: stretch; gap: 4px; margin-bottom: 4px; }
.tm-card { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 7px 10px; border: 1px solid rgba(160, 180, 220, .2); border-radius: 9px; background: rgba(160, 180, 220, .07); color: #dfe6f3; cursor: pointer; }
.tm-card:hover, .tm-card:focus { background: rgba(255, 214, 102, .13); border-color: rgba(255, 214, 102, .5); }
.tm-card code { font: 600 12.5px Consolas, Monaco, monospace; color: #ffd666; word-break: break-all; }
.tm-card b { font: 600 12.5px "Segoe UI", Arial, sans-serif; }
.tm-card span { font: 12px/1.35 "Segoe UI", Arial, sans-serif; color: #98a3ba; }
.tm-del { flex: none; width: 30px; border: 1px solid rgba(160, 180, 220, .2); border-radius: 9px; background: none; color: #98a3ba; cursor: pointer; }
.tm-del:hover { color: #ff9c9c; border-color: #ff9c9c; }
.tm-empty { margin: 2px 2px 6px; font: italic 12px "Segoe UI", Arial, sans-serif; color: #7f8aa0; }
.tm-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tm-add input { flex: 1 1 200px; min-width: 0; padding: 6px 9px; border: 1px solid rgba(160, 180, 220, .3); border-radius: 8px; background: #0f1218; color: #f1f4fa; font: 12.5px Consolas, Monaco, monospace; }
.tm-add .tm-a-lbl { flex-basis: 150px; font-family: "Segoe UI", Arial, sans-serif; }
.tm-add button { flex: none; padding: 6px 14px; border: 0; border-radius: 999px; background: #ffd666; color: #2a2412; font: 700 12.5px "Segoe UI", Arial, sans-serif; cursor: pointer; }
.tm-ins { color: #ffd666; text-decoration: underline dotted; cursor: pointer; }
.tm-ins:hover { text-decoration: underline; }
.tm-screen { flex: 1 1 auto; min-height: 90px; overflow: auto; padding: 8px 10px; border-radius: 10px; background: #12161c; color: #d6dde8; font: 13px/1.5 "JetBrains Mono", "Cascadia Code", Consolas, Monaco, monospace; cursor: text; }
.tm-out { margin: 0; padding: 0; white-space: pre-wrap; word-break: break-word; background: none; color: inherit; font: inherit; }
.tm-row { display: flex; align-items: center; gap: 8px; margin: 0; }
.tm-ps { flex: none; color: #7fd08f; font-weight: 700; white-space: pre; }
.tm-in { flex: 1 1 auto; min-width: 0; padding: 2px 0; border: 0; outline: 0; background: transparent; color: #f1f4fa; caret-color: #ffd666; font: inherit; }
.tm-in::placeholder { color: #667088; }
.tm-in:disabled { opacity: .5; }
.tm-go { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 26px; padding: 0; cursor: pointer; border: 0; border-radius: 8px; background: rgba(255, 214, 102, .16); color: #ffd666; }
.tm-go:disabled { opacity: .4; cursor: default; }
.tm-go .ic { width: 12px; height: 12px; }
.tm-out .tm-ps { font-weight: 700; }
.tm-cmd { color: #f1f4fa; font-weight: 600; }
.tm-txt { color: #cfe3c4; }
.tm-err { color: #ff9c9c; }
.tm-meta { color: #7f8aa0; font-style: italic; }
.tm-loc { color: #8ecbff; text-decoration: underline dotted; cursor: pointer; }
.tm-loc:hover { text-decoration: underline; }
.tm-sugg { flex: none; display: flex; flex-wrap: wrap; gap: 5px; max-height: 84px; overflow: auto; }
.tm-sugg[hidden] { display: none; }
.tm-chip { display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; padding: 3px 9px; border: 1px solid rgba(160, 180, 220, .28); border-radius: 999px; background: rgba(160, 180, 220, .1); color: #dfe6f3; cursor: pointer; font: 12px Consolas, Monaco, monospace; }
.tm-chip b { font-weight: 600; }
.tm-chip i { font: italic 11px "Segoe UI", Arial, sans-serif; color: #98a3ba; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.tm-chip:hover, .tm-chip.on { background: rgba(255, 214, 102, .2); border-color: rgba(255, 214, 102, .6); }
.tm-chip.tm-flag b { color: #ffcf8a; }
.tm-chip.tm-test b { color: #b8d68a; }
.tm-chip.tm-file b, .tm-chip.tm-pkg b { color: #8ecbff; }
.tm-hint { flex: none; min-height: 1.3em; font-size: 12.5px; line-height: 1.35; opacity: .85; }
@media (max-width: 1023px) {
    .tm-screen { font-size: 13px; }
    .tm-in, .tm-add input { font-size: 16px; }
}

/* Блоки кода на странице -> песочница: вкладка-метка, группа, подпись «записано» */
.blk-tab { display: inline-flex; align-items: center; gap: 5px; margin: 8px 0 -1px; padding: 3px 11px; position: relative; z-index: 1; border: 1px solid var(--h-line, rgba(127, 127, 127, .4)); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--h-btn, rgba(127, 127, 127, .16)); color: var(--h-text, inherit); font: 600 12.5px Consolas, Monaco, monospace; }
.blk-tab .ic { width: 13px; height: 13px; }
pre.has-tab { border-top-left-radius: 0 !important; margin-top: 0 !important; }
.blk-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 8px 0 16px; }
.blk-group .blk-tab, .code-sent .blk-tab { margin: 0; border-bottom: 1px solid var(--h-line, rgba(127, 127, 127, .4)); border-radius: 8px; }
.blk-note { font-size: 12.5px; opacity: .7; }
.blk-frame { position: relative; margin: 34px 0 20px; padding: 42px 10px 6px; border: 1px solid var(--h-line, rgba(127, 127, 127, .4)); border-radius: 0 12px 12px 12px; background: rgba(127, 127, 127, .06); }
.blk-frame-t { position: absolute; left: -1px; top: -27px; padding: 4px 16px; border: 1px solid var(--h-line, rgba(127, 127, 127, .4)); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--h-btn, rgba(127, 127, 127, .16)); font: 600 13px "Segoe UI", Arial, sans-serif; }
.blk-frame > .code-section, .blk-frame > pre { margin-bottom: 12px; }
.blk-frame .blk-tab { margin-top: 0; }
.blk-all { position: absolute; top: 8px; right: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; cursor: pointer; border: 1px solid var(--h-line, rgba(127, 127, 127, .5)); border-radius: 999px; background: var(--h-btn, rgba(0, 0, 0, .5)); color: var(--h-text, inherit); font: 600 12px "Segoe UI", Arial, sans-serif; opacity: .55; transition: opacity .15s, background .15s; }
.blk-all .ic { width: 12px; height: 12px; }
.blk-frame:hover .blk-all, .blk-all:focus, .blk-group .blk-all { opacity: 1; }
.blk-all:hover { background: var(--h-gold-fill, rgba(255, 214, 102, .4)); color: #2a2412; }
.blk-group .blk-all { position: static; }
@media (hover: none) { .blk-all { opacity: 1; height: 32px; padding: 0 13px; } }
.code-sent { flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 6px 10px 0; padding: 5px 8px; font-size: 12.5px; border-radius: 8px; background: rgba(80, 190, 120, .16); }
.code-sent[hidden] { display: none; }
.code-sent .blk-tab { padding: 1px 8px; font-size: 12px; }
.sent-rest { opacity: .75; }
.sent-undo, .sent-x { cursor: pointer; background: none; border: none; color: inherit; font: inherit; padding: 2px 6px; }
.sent-undo { margin-left: auto; text-decoration: underline; display: inline-flex; align-items: center; gap: 4px; }
.sent-undo .ic { width: 13px; height: 13px; }

/* Вкладки файлов песочницы (курс включает sandbox.files) */
.code-ftabs { display: flex; align-items: center; gap: 4px; margin: 8px 10px 0; padding-bottom: 2px; overflow-x: auto; flex: 0 0 auto; white-space: nowrap; scrollbar-width: thin; }
.cm-errtip { position: fixed; z-index: 100000; max-width: min(360px, 90vw); padding: 6px 10px; pointer-events: none; white-space: pre-wrap; word-break: break-word; }
.code-tabs[hidden] { display: none; }
.ftab, .ftab-add, .ftab-act { flex: 0 0 auto; cursor: pointer; padding: 4px 11px; font: inherit; }
.ftab { display: inline-flex; align-items: center; gap: 6px; user-select: none; }
.ftab .ft-x { flex: 0 0 auto; width: 16px; height: 16px; margin: 0 -5px 0 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font: 400 15px/16px "Segoe UI", Arial, sans-serif; cursor: pointer; opacity: 0; transition: opacity .12s; }
.ftab:hover .ft-x, .ftab:focus-within .ft-x { opacity: .65; }
.ftab .ft-x:hover { opacity: 1; background: rgba(127, 127, 127, .35); }
@media (hover: none) { .ftab.on .ft-x { opacity: .6; } }
.ftab-edit { padding: 2px 4px; cursor: text; }
.ftab-edit input { padding: 2px 6px; font: inherit; font-size: 16px; background: transparent; color: inherit; border: 0; outline: 0; min-width: 0; }
.ftab-term { margin-left: auto; }
.ftab-term .ft-ps { opacity: .7; font-weight: 700; }
.ftab-undo { flex: 0 0 auto; padding: 0 4px; border: 0; background: none; color: inherit; font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; }
.ftab-act { padding: 4px 7px; }
.ftab-ask { display: inline-flex; gap: 4px; align-items: center; flex: 1 1 auto; min-width: 0; }
.ftab-ask input { flex: 1 1 140px; min-width: 0; padding: 5px 9px; font: inherit; font-size: 16px; }
.ftab-msg { font-size: 12px; opacity: .8; padding-left: 6px; white-space: normal; }
.quest-load { margin: 6px 0 14px; }
.quest-load-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 8px 16px; cursor: pointer; text-align: left; line-height: 1.3; }

/* ============================================================
   Вход и «Мои работы» (auth.js)
   ============================================================ */
/* кнопка-профиль */
#auth-toggle { flex: none; height: 34px; min-width: 34px; max-width: 190px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; padding: 0 12px 0 0; border-radius: 999px; border: 1px solid var(--h-edge, #8e9ab3); background: var(--h-panel-solid, #fff); color: var(--h-gold, #5b6a8a); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); font: 600 14px/1 "Segoe UI", Arial, sans-serif; }
#auth-toggle:not(.in) { padding: 0; width: 34px; border-radius: 50%; }
#auth-toggle:hover { filter: brightness(1.08); }
#auth-toggle .ic { width: 18px; height: 18px; }
#auth-toggle .auth-av { margin: 2px 0 2px 2px; }
#auth-toggle .auth-av.sm { width: 30px; height: 30px; }
.auth-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--h-text, #2f3347); }
@media (max-width: 1023px) {
    #auth-toggle { height: 40px; min-width: 40px; }
    #auth-toggle:not(.in), #auth-toggle.in { padding: 0; width: 40px; border-radius: 50%; }
    #auth-toggle .auth-name { display: none; }
    #auth-toggle .ic { width: 20px; height: 20px; }
    #auth-toggle .auth-av, #auth-toggle.in .auth-av { margin: 0; }
    #auth-toggle .auth-av.sm { width: 38px; height: 38px; }
}
.auth-av { display: inline-grid; place-items: center; flex: none; overflow: hidden; border-radius: 50%; color: #fff; font: 700 12px/1 "Segoe UI", Arial, sans-serif; background: #8e9ab3; }
.auth-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-av.sm { width: 34px; height: 34px; }
.auth-av.md { width: 54px; height: 54px; font-size: 18px; }
.auth-av.lg { width: 60px; height: 60px; font-size: 20px; }
.code-save { white-space: nowrap; }

/* окно */
.auth-ov { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; background: rgba(15, 20, 35, .55); backdrop-filter: blur(3px); }
.auth-box { width: min(480px, 100%); max-height: min(90vh, 780px); display: flex; flex-direction: column; border-radius: 20px; border: 1px solid var(--h-edge, #8e9ab3); background: var(--h-panel-solid, #fff); color: var(--h-text, #2f3347); box-shadow: 0 18px 60px rgba(0, 0, 0, .45); font: 14px/1.45 "Segoe UI", Arial, sans-serif; overflow: hidden; }
.auth-box.wide { width: min(540px, 100%); }
.auth-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--h-line, rgba(0, 0, 0, .11)); }
.auth-title { font-weight: 700; font-size: 16px; color: var(--h-gold, #5b6a8a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-x { border: 0; background: var(--h-btn, rgba(0, 0, 0, .07)); color: inherit; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; padding: 0; }
.auth-x:hover { background: var(--h-btn-h, rgba(0, 0, 0, .13)); }
.auth-x .ic { width: 16px; height: 16px; }
.auth-body { padding: 18px 20px 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-grow { flex: 1; min-width: 0; }
.auth-f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--h-soft, #646b84); }
.auth-f input { font: inherit; font-size: 15px; color: var(--h-text, #2f3347); background: var(--h-field, #fff); border: 1px solid var(--h-line, rgba(0, 0, 0, .2)); border-radius: 10px; padding: 9px 11px; outline: none; }
.auth-f input:focus { border-color: var(--h-gold, #5b6a8a); }
.auth-f input:disabled { opacity: .55; }
/* кнопки: главная — светлая тема: тёмная заливка с белым текстом, тёмная тема: золотая заливка с тёмным текстом */
.auth-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-align: center; border: 0; border-radius: 12px; padding: 11px 16px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; background: #3f4f78; color: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .18), 0 6px 16px rgba(30, 40, 80, .22); transition: filter .12s, transform .12s; }
html[data-theme="dark"] .auth-btn { background: #e3c78a; color: #2a2412; box-shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 6px 16px rgba(0, 0, 0, .35); }
.auth-btn:hover:not(:disabled) { filter: brightness(1.1); }
.auth-btn:active:not(:disabled) { transform: translateY(1px); }
.auth-btn.ghost { background: rgba(0, 0, 0, .07); color: #2f3347; box-shadow: inset 0 0 0 1px var(--h-line, rgba(0, 0, 0, .14)); }
html[data-theme="dark"] .auth-btn.ghost { background: rgba(255, 255, 255, .1); color: #e8ecf6; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.auth-btn.danger { background: transparent; color: #b3402f; box-shadow: inset 0 0 0 1.5px currentColor; }
html[data-theme="dark"] .auth-btn.danger { background: transparent; color: #f0907f; box-shadow: inset 0 0 0 1.5px currentColor; }
.auth-btn.danger.solid { background: #b3402f; color: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
html[data-theme="dark"] .auth-btn.danger.solid { background: #d65a47; color: #fff; }
.auth-btn.busy { opacity: .65; cursor: progress; }
.auth-btn:disabled:not(.busy) { opacity: .42; cursor: not-allowed; box-shadow: none; }
.auth-btn .ic { width: 18px; height: 18px; }
.auth-logo { display: inline-grid; place-items: center; }
.auth-upload { cursor: pointer; }
.auth-social { display: grid; gap: 8px; }
.auth-or { text-align: center; color: var(--h-soft, #646b84); font-size: 12px; }
.auth-links { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }
.auth-link { border: 0; background: none; padding: 0; font: inherit; font-size: 13px; color: var(--h-link, #2f5fb3); cursor: pointer; text-decoration: underline; text-align: left; }
.auth-link.danger { color: #b3402f; }
.auth-note { margin: 0; color: var(--h-soft, #646b84); font-size: 13px; }
.auth-note.strong { color: var(--h-text, #2f3347); font-size: 14px; }
.auth-note.small { font-size: 12px; }
.auth-msg { display: none; border-radius: 8px; padding: 8px 10px; font-size: 13px; background: var(--h-btn, rgba(0, 0, 0, .07)); }
.auth-msg.on { display: block; }
.auth-msg.bad { background: rgba(200, 70, 50, .15); color: #b3402f; }
.auth-mini { border: 0; border-radius: 9px; padding: 6px 11px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; background: var(--h-btn, rgba(0, 0, 0, .07)); color: var(--h-text, #2f3347); }
.auth-mini:hover { background: var(--h-btn-h, rgba(0, 0, 0, .13)); }
.auth-mini.danger { color: #b3402f; }
html[data-theme="dark"] .auth-mini.danger { color: #f0907f; }
.auth-back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 0; font: inherit; font-size: 13px; color: var(--h-link, #2f5fb3); cursor: pointer; }
.auth-back:hover { text-decoration: underline; }

/* «дом пользователя»: шапка, разделы, карточки */
.acc-hero { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 18px; border: 1px solid var(--h-edge, #8e9ab3); background: linear-gradient(135deg, rgba(227, 199, 138, .22), rgba(227, 199, 138, 0) 70%), var(--h-card, rgba(255, 255, 255, .6)); }
.acc-ava { flex: none; padding: 4px; border-radius: 50%; border: 2px solid var(--h-gold, #5b6a8a); line-height: 0; box-shadow: 0 0 20px rgba(227, 199, 138, .35); }
.acc-ava .auth-av { width: 64px; height: 64px; font-size: 22px; }
.acc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.acc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.acc-name { font-size: 20px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-mail { color: var(--h-soft, #646b84); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-via { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 5px; padding: 3px 11px 3px 8px; border-radius: 999px; font-size: 12px; background: var(--h-btn, rgba(0, 0, 0, .07)); }
.acc-via svg { width: 14px; height: 14px; flex: none; }
.acc-sec { display: flex; flex-direction: column; gap: 8px; }
.acc-h { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--h-gold, #5b6a8a); }
.acc-card { padding: 14px; border-radius: 14px; border: 1px solid var(--h-line, rgba(0, 0, 0, .11)); background: var(--h-card, rgba(255, 255, 255, .6)); display: flex; flex-direction: column; gap: 10px; }
.acc-hint { margin: 0; font-size: 12.5px; color: var(--h-soft, #646b84); }
.acc-hint.warn { color: #a8602a; }
html[data-theme="dark"] .acc-hint.warn { color: #e8b27a; }
.acc-save .auth-btn { width: 100%; }
.acc-find, .acc-rename { width: 100%; box-sizing: border-box; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--h-line, rgba(0, 0, 0, .2)); background: var(--h-field, rgba(255, 255, 255, .6)); color: inherit; font: inherit; font-size: 14px; }
.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; padding: 11px 13px; border-radius: 13px; border: 1px solid var(--h-line, rgba(0, 0, 0, .11)); background: var(--h-card, rgba(255, 255, 255, .6)); }
.acc-info { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acc-info strong { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-sub { display: block; font-size: 12px; color: var(--h-soft, #646b84); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-acts { display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }
.acc-empty { margin: 0; padding: 14px; border-radius: 13px; border: 1px dashed var(--h-line, rgba(0, 0, 0, .2)); color: var(--h-soft, #646b84); font-size: 13px; text-align: center; }
.acc-store { display: flex; flex-direction: column; gap: 6px; }
.acc-store span { font-size: 13px; }
.acc-bar { height: 6px; border-radius: 99px; background: var(--h-btn, rgba(0, 0, 0, .09)); overflow: hidden; }
.acc-bar i { display: block; height: 100%; min-width: 3px; border-radius: 99px; background: var(--h-gold, #5b6a8a); }
.acc-sync { display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px; border-radius: 13px; background: var(--h-btn, rgba(0, 0, 0, .06)); font-size: 13px; color: var(--h-soft, #646b84); }
.acc-sync .ic { width: 18px; height: 18px; margin-top: 1px; color: var(--h-gold, #5b6a8a); }
.acc-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 14px; border-top: 1px solid var(--h-line, rgba(0, 0, 0, .11)); }
.acc-warn { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 10px 4px 2px; }
.acc-warn-ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: rgba(200, 70, 50, .14); color: #b3402f; }
html[data-theme="dark"] .acc-warn-ic { color: #f0907f; }
.acc-warn-ic .ic { width: 26px; height: 26px; }
.acc-warn p { margin: 0; font-size: 15px; line-height: 1.5; }
.acc-ask { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 4px; }

/* профиль: выбор аватарки */
.auth-avgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.auth-avtile { box-sizing: border-box; width: 64px; height: 64px; padding: 3px; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; display: grid; place-items: center; line-height: 0; justify-self: center; }
.auth-avtile .auth-av { width: 100%; height: 100%; }
.auth-avtile:hover { border-color: var(--h-edge, #8e9ab3); }
.auth-avtile.on { border-color: var(--h-gold, #5b6a8a); }
.acc-card.acc-prof { flex-direction: row; align-items: flex-start; gap: 16px; }
.acc-prof .acc-ava { margin-top: 18px; }

/* прочее */
#auth-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 2100; max-width: min(92vw, 520px); padding: 10px 16px; border-radius: 12px; font: 14px/1.4 "Segoe UI", Arial, sans-serif; color: #fff; background: #3c4a66; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); transition: opacity .2s, transform .2s; }
#auth-toast.on { opacity: 1; transform: translateX(-50%); }
#auth-toast.bad { background: #a8402f; }
@media (max-width: 520px) {
    .auth-body { padding: 14px 14px 16px; }
    .acc-hero { padding: 12px; gap: 12px; }
    .acc-ava .auth-av { width: 54px; height: 54px; font-size: 19px; }
    .acc-row { flex-direction: column; align-items: stretch; }
    .acc-info { flex: 0 0 auto; }
    .acc-acts { justify-content: flex-start; }
    .acc-card.acc-prof { flex-direction: column; align-items: stretch; }
    .acc-prof .acc-ava { margin: 0; align-self: center; }
}

/* ---------- задачи с собеседований (tasks.js) ---------- */
.code-taskbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 6px 10px; margin-bottom: 6px; border: 1px solid var(--h-line); border-radius: 10px; background: var(--h-card); font-size: 13px; }
.code-taskbar[hidden] { display: none; }
.code-taskbar .tk-bar-t b { color: var(--h-gold); }
.code-taskbar .tk-bar-t i { font-style: normal; color: var(--h-gold); }
.code-taskbar .tk-bar-t small { color: var(--h-soft); }
.code-taskbar .tk-bar-b { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tk-btn { padding: 7px 14px; border: 1px solid var(--h-line); border-radius: 10px; background: var(--h-btn); color: var(--h-text); font: 600 13px/1.2 inherit; font-family: inherit; cursor: pointer; }
.tk-btn:hover:not(:disabled) { background: var(--h-btn-h); }
.tk-btn:disabled { opacity: .45; cursor: not-allowed; }
.tk-btn.ok { background: rgba(47, 168, 79, .2); border-color: rgba(47, 168, 79, .55); }
.tk-btn.danger { background: rgba(229, 72, 77, .15); border-color: rgba(229, 72, 77, .5); }
.tk-btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.tk-sel { padding: 4px 6px; border-radius: 8px; border: 1px solid var(--h-line); background: var(--h-field); color: var(--h-text); font: inherit; font-size: 12px; max-width: 160px; }
.tk-ov { position: fixed; inset: 0; z-index: 2147483000; background: rgba(8, 10, 18, .55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow: auto; }
.tk-card { width: min(560px, 100%); background: var(--h-panel-solid, #fff); color: var(--h-text); border: 1px solid var(--h-edge); border-radius: 16px; box-shadow: var(--h-shadow); }
.tk-card.wide { width: min(820px, 100%); }
.tk-hd { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--h-line); }
.tk-hd b { color: var(--h-gold); font-size: 17px; }
.tk-x { border: 0; background: none; color: var(--h-soft); font-size: 26px; line-height: 1; cursor: pointer; }
.tk-bd { padding: 14px 16px 16px; }
.tk-bd p { margin: 0 0 10px; }
.tk-acts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.tk-topics, .tk-lv { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.tk-chip { padding: 4px 11px; border: 1px solid var(--h-line); border-radius: 999px; background: var(--h-btn); color: var(--h-text); font: 600 12.5px/1.2 inherit; font-family: inherit; cursor: pointer; }
.tk-chip.on { background: var(--h-gold-fill); color: #2a2412; border-color: transparent; }
.tk-btn.dice { margin-left: auto; }
.tk-list { display: grid; gap: 10px; }
.tk-lvh { margin-top: 4px; font-weight: 700; color: var(--h-gold); }
.tk-offer { border: 1px solid var(--h-line); border-left: 4px solid var(--h-gold); border-radius: 12px; padding: 10px 12px; background: var(--h-card); }
.tk-offer.lv2 { border-left-color: #e5a000; } .tk-offer.lv3 { border-left-color: #e5484d; }
.tk-o-h { display: flex; justify-content: space-between; gap: 10px; }
.tk-st { color: var(--h-gold); letter-spacing: 1px; white-space: nowrap; }
.tk-o-i { margin: 4px 0 6px; color: var(--h-text); }
.tk-o-m { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tk-o-m span { padding: 1px 8px; border-radius: 999px; font-size: 11.5px; color: var(--h-soft); border: 1px solid var(--h-line); }
.tk-o-f { display: flex; align-items: center; gap: 12px; }
.tk-o-f .tk-pts { font-weight: 700; color: #3aa85a; }
.tk-o-f .tk-pts small { font-weight: 400; color: var(--h-soft); }
.tk-o-f .tk-t { color: var(--h-soft); font-size: 13px; }
.tk-o-f .tk-btn { margin-left: auto; }
.tk-foot { margin-top: 10px; color: var(--h-soft); font-size: 13px; }
.tk-empty { color: var(--h-soft); }
.tk-md { margin: 8px 0; } .tk-md pre { overflow: auto; max-height: 260px; }
.tk-st-meta { font-size: 13px; color: var(--h-soft); }
.tk-tbl { overflow: auto; margin: 8px 0; } .tk-tbl table { border-collapse: collapse; } .tk-tbl th, .tk-tbl td { border: 1px solid var(--h-line); padding: 4px 10px; text-align: left; }
.tk-out { max-height: 280px; overflow: auto; margin: 8px 0; padding: 10px 12px; background: #1d2026; color: #ffb4b4; border-radius: 10px; font: 12px/1.45 Consolas, Monaco, monospace; white-space: pre-wrap; }
.tk-win { font-size: 40px; font-weight: 800; color: #3aa85a; text-align: center; } .tk-win small { font-size: 16px; color: var(--h-soft); font-weight: 400; }
.tk-review { display: flex; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--h-card); border: 1px solid var(--h-line); }
.tk-review img { width: 44px; height: 44px; border-radius: 50%; flex: none; object-fit: cover; }
.tk-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 2147483100; padding: 10px 16px; border-radius: 12px; background: #2d3350; color: #fff; transition: .2s; max-width: 90vw; }
.tk-toast.show { opacity: 1; transform: translate(-50%, 0); } .tk-toast.bad { background: #b3262b; }
.tk-remind { position: fixed; right: 20px; bottom: 150px; z-index: 2147482000; width: min(340px, calc(100vw - 24px)); display: grid; grid-template-columns: 46px 1fr; gap: 8px 10px; padding: 12px; border-radius: 14px; background: var(--h-panel-solid, #fff); color: var(--h-text); border: 1px solid var(--h-edge); box-shadow: var(--h-shadow); }
.tk-remind img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; grid-row: span 2; }
.tk-rm-b { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 2; }
.tk-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 22px 0 6px; padding: 14px 16px; border: 1px dashed var(--h-edge, #888); border-radius: 14px; background: var(--h-card, rgba(0,0,0,.04)); }
.tk-cta div { display: flex; flex-direction: column; gap: 2px; flex: 1 1 260px; } .tk-cta span { color: var(--h-soft, #666); font-size: 14px; }
.tk-sum { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; } .tk-sum div { flex: 1 1 90px; text-align: center; padding: 10px; border: 1px solid var(--h-line, #ccc); border-radius: 12px; background: var(--h-card, rgba(0,0,0,.04)); }
.tk-sum b { display: block; font-size: 26px; color: var(--h-gold, #333); } .tk-sum span { color: var(--h-soft, #666); font-size: 13px; }
.tk-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--h-line, #ddd); } .tk-row i { font-style: normal; color: var(--h-gold, #555); }
.tk-sub { color: var(--h-soft, #666); font-size: 13px; }
.acc-tasks { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 8px 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--h-card); border: 1px solid var(--h-line); }
@media (max-width: 1023px) { .tk-remind { bottom: 84px; right: 12px; } .tk-ov { padding: 0; } .tk-card, .tk-card.wide { width: 100%; min-height: 100vh; border-radius: 0; } }

/* ---------- задачи: генерация, ачивки, скрытая метка ---------- */
.tk-pend { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px dashed var(--h-edge, #888); border-radius: 12px; color: var(--h-soft); font-size: 13.5px; }
.tk-spin { width: 16px; height: 16px; flex: none; border: 2px solid var(--h-line); border-top-color: var(--h-gold); border-radius: 50%; animation: tk-rot .9s linear infinite; }
@keyframes tk-rot { to { transform: rotate(360deg); } }
.tk-canary { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; user-select: text; }
.tk-md { position: relative; }
.tk-achs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.tk-ach { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--h-line, #ccc); border-radius: 12px; background: var(--h-card, rgba(0,0,0,.04)); opacity: .62; }
.tk-ach.got { opacity: 1; border-color: var(--h-gold, #888); }
.tk-ach > span, .tk-ach > img, .tk-ach-i > span, .tk-ach-i > img { flex: none; width: 40px; height: 40px; font-size: 28px; line-height: 40px; text-align: center; border-radius: 10px; object-fit: cover; }
.tk-ach-b { min-width: 0; flex: 1; } .tk-ach-b b { display: block; font-size: 14px; }
.tk-bar { height: 5px; border-radius: 3px; background: var(--h-line, #ddd); margin: 4px 0 2px; overflow: hidden; } .tk-bar i { display: block; height: 100%; background: var(--h-gold, #666); }
.tk-ach small { color: var(--h-soft, #666); font-size: 12px; }
.tk-dots { display: flex; gap: 3px; margin-top: 3px; flex-wrap: wrap; } .tk-dots u { width: 7px; height: 7px; border-radius: 50%; background: var(--h-line, #ddd); text-decoration: none; } .tk-dots u.on { background: var(--h-gold, #666); }
.tk-ach-new { margin: 10px 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--h-gold); background: var(--h-card); }
.tk-ach-i { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
