/* ===== Programmator v6.9 — мобильная оболочка тренажёров (подключается после v67.css) ===== */
.v69-taskbar,.v69-dock{display:none}
.v69-sheet[hidden]{display:none}

html.v69-mobile body{padding-bottom:calc(var(--v69-dock-h,140px) + 18px)!important}
html.v69-mobile .page-head{display:none!important}
html.v69-mobile .wrap.layout{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:14px!important;padding:12px 16px 24px!important}
html.v69-mobile #topic-list{display:none!important}
html.v69-mobile .wrap.layout>#topic-list~*,html.v69-mobile #question-view{grid-column:1!important;min-width:0!important}
html.v69-mobile #feedback-fab,html.v69-mobile #v67-board-fab,html.v69-mobile #ege-py-fab{display:none!important}

/* убираем дубли и «рамки в рамках» */
html.v69-mobile .demo-topbar,html.v69-mobile #demo-tag{display:none!important}
html.v69-mobile section[id^="task-"]>h1,html.v69-mobile section[id^="task-"]>p.sub,html.v69-mobile section[id^="task-"] .card>.badge{display:none!important}
html.v69-mobile .demo-panel,html.v69-mobile section[id^="task-"] .card{background:transparent!important;border:none!important;box-shadow:none!important;padding:0!important}
html.v69-mobile .demo-body{padding:0!important}
html.v69-mobile .demo-question,html.v69-mobile section[id^="task-"] .q-text{font-family:var(--sans)!important;font-size:17px!important;line-height:1.55!important}

/* подтипы — одна строка спокойных «пилюль», листается пальцем */
html.v69-mobile .subtype-row{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;gap:8px!important;margin:0 -16px 14px!important;padding:0 16px 2px!important;scrollbar-width:none}
html.v69-mobile .subtype-row::-webkit-scrollbar{display:none}
html.v69-mobile .subtype-btn{flex:0 0 auto;height:36px;padding:0 14px!important;border:none!important;border-radius:999px!important;background:rgba(255,255,255,.06)!important;color:#C9CCDC!important;font:500 14px var(--sans)!important;white-space:nowrap}
html.v69-mobile .subtype-btn.active{background:#ECE8DC!important;color:#12152A!important;font-weight:600!important}
html.v69-mobile .v69-typeprefix{display:none}

/* «Подсказка» и «Пропустить» — текстовые кнопки под условием */
html.v69-mobile #hint-row,html.v69-mobile .grid-actions{gap:18px!important;margin-top:6px!important}
html.v69-mobile #hint-row .btn,html.v69-mobile .grid-actions .btn{background:transparent!important;border:none!important;padding:10px 0!important;color:#C9CCDC!important;font:500 15px var(--sans)!important}
html.v69-mobile .demo-actions{justify-content:flex-end}
html.v69-mobile .controls-grid{display:block!important}

/* ---------- строка «Задание N ▾» ---------- */
html.v69-mobile .v69-taskbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px}
.v69-task-btn{display:grid;grid-template-columns:auto auto;justify-content:start;align-items:center;column-gap:6px;row-gap:2px;background:transparent;border:none;padding:4px 0;color:var(--text,#ECE8DC);text-align:left;cursor:pointer;min-height:44px}
.v69-task-title{font:700 22px var(--sans);letter-spacing:-.01em}
.v69-chev{color:#9CA0B8;display:grid}
.v69-task-sub{grid-column:1/-1;font:400 14px var(--sans);color:#A3A7BE}
.v69-task-meta{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex-shrink:0}
.v69-timer{font:500 13px var(--mono,monospace);color:#A3A7BE}
.v69-score{font:500 12px var(--sans);color:#7fd3c6;background:rgba(79,182,166,.12);padding:3px 8px;border-radius:999px;white-space:nowrap}

/* ---------- нижняя панель ответа ---------- */
html.v69-mobile .v69-dock{display:flex;flex-direction:column;gap:10px;position:fixed;left:0;right:0;bottom:0;z-index:9400;padding:10px 16px calc(14px + env(safe-area-inset-bottom));background:#161A31;border-top:1px solid rgba(255,255,255,.08);box-shadow:0 -12px 32px rgba(0,0,0,.28)}
.v69-dock-tools{display:flex;gap:8px}
.v69-tool{height:40px;padding:0 12px;border-radius:12px;display:flex;align-items:center;gap:7px;font:600 14px var(--sans);cursor:pointer}
.v69-tool-board{border:1px solid rgba(79,182,166,.35);background:rgba(79,182,166,.08);color:#7fd3c6}
.v69-tool-py{border:1px solid rgba(242,169,59,.35);background:rgba(242,169,59,.08);color:#F5BE6A}
.v69-dock-slot{display:flex;flex-direction:column;gap:10px}
.v69-dock-row{display:flex;gap:8px;align-items:stretch}
.v69-dock-row #demo-input-row{display:flex;flex-direction:row!important;gap:8px;margin:0!important;flex:1;min-width:0}
.v69-dock-row #demo-input-row[style*="display: none"]{display:none!important}
.v69-dock-row input[type=text],.v69-dock-row textarea{flex:1;min-width:0;height:52px;box-sizing:border-box;padding:0 14px!important;border-radius:14px!important;border:1px solid rgba(255,255,255,.12)!important;background:#0D1022!important;color:#ECE8DC!important;font:500 17px var(--mono,monospace)!important;letter-spacing:.03em}
.v69-dock-row textarea{height:auto;min-height:52px;max-height:30vh;padding:12px 14px!important}
.v69-dock-row .btn{height:52px;padding:0 18px!important;border-radius:14px!important;font:700 16px var(--sans)!important;white-space:nowrap;width:auto!important;flex:0 0 auto}
.v69-dock-row #demo-next,.v69-dock-row [id$="-next"],.v69-dock-row #next-btn{flex:1 1 auto;background:#F2A93B!important;border-color:#F2A93B!important;color:#1A1406!important}
/* сообщение о результате — плашка над полем */
.v69-dock-feedback:not(:has(.yes,.no)){display:none}
.v69-dock-feedback>*{margin:0!important;padding:12px 14px!important;border-radius:14px!important;font:500 15px/1.4 var(--sans)!important}
.v69-dock-feedback .no{background:#2A1F18!important;border:1px solid rgba(242,169,59,.5)!important;color:#FBD9A6!important}
.v69-dock-feedback .yes{background:rgba(79,182,166,.14)!important;border:1px solid rgba(79,182,166,.5)!important;color:#bdeee6!important}

/* Python-окно на телефоне — почти во весь экран и поверх панели ответа */
html.v69-mobile #ege-py-panel{left:8px!important;right:8px!important;top:8px!important;bottom:auto!important;width:auto!important;max-width:none!important;max-height:calc(100dvh - 16px)!important;z-index:9650!important}

/* ---------- выбор задания снизу ---------- */
.v69-sheet{position:fixed;inset:0;z-index:9600}
.v69-sheet-backdrop{position:absolute;inset:0;background:rgba(6,8,18,.62);opacity:0;transition:opacity .2s}
.v69-sheet.open .v69-sheet-backdrop{opacity:1}
.v69-sheet-panel{position:absolute;left:0;right:0;bottom:0;max-height:86dvh;overflow:auto;background:#1A1E38;border-radius:22px 22px 0 0;padding:10px 16px calc(22px + env(safe-area-inset-bottom));box-shadow:0 -20px 60px rgba(0,0,0,.45);display:flex;flex-direction:column;gap:12px;transform:translateY(100%);transition:transform .22s ease;font-family:var(--sans);color:var(--text,#ECE8DC)}
.v69-sheet.open .v69-sheet-panel{transform:none}
.v69-sheet-handle{align-self:center;width:40px;height:5px;border-radius:3px;background:rgba(255,255,255,.22)}
.v69-sheet-head{display:flex;align-items:center;justify-content:space-between}
.v69-sheet-head h2{margin:0;font:700 20px var(--sans)}
.v69-sheet-close{width:44px;height:44px;display:grid;place-items:center;border:none;border-radius:12px;background:rgba(255,255,255,.06);color:#C9CCDC;cursor:pointer}
.v69-legend{display:flex;gap:14px;flex-wrap:wrap;font-size:12px;color:#A3A7BE}
.v69-legend span{display:flex;align-items:center;gap:6px}
.v69-dot{display:inline-block;width:8px;height:8px;border-radius:50%;border:1.5px solid #6B7090;box-sizing:border-box;flex-shrink:0}
.v69-dot.ok{background:#4FB6A6;border-color:#4FB6A6}.v69-dot.err{background:#F2A93B;border-color:#F2A93B}
.v69-group{font-size:13px;color:#A3A7BE;margin-top:4px}
.v69-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.v69-tile{min-height:68px;padding:9px 9px 10px;border-radius:14px;display:flex;flex-direction:column;justify-content:space-between;gap:6px;background:rgba(255,255,255,.05);border:1.5px solid transparent;color:var(--text,#ECE8DC);text-align:left;cursor:pointer;font-family:var(--sans)}
.v69-tile.active{background:rgba(79,182,166,.16);border-color:#4FB6A6}
.v69-tile-top{display:flex;align-items:center;justify-content:space-between}
.v69-tile-n{font:700 18px var(--mono,monospace)}
.v69-tile-name{font-size:11px;line-height:1.25;color:#A3A7BE;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body.v69-sheet-open{overflow:hidden}
.v69-chat-link{cursor:pointer}
/* длинная подсказка в сообщении не должна закрывать задание */
.v69-dock-feedback>*{max-height:20dvh;overflow:auto}
html.v69-mobile .demo-actions .demo-score{display:none!important}
.v69-tile-name{hyphens:auto;-webkit-hyphens:auto;overflow-wrap:anywhere}
/* вариант на телефоне: только панель инструментов внизу */
html.v69-variant-mobile .v69-dock{display:flex;flex-direction:column;gap:10px;position:fixed;left:0;right:0;bottom:0;z-index:9400;padding:10px 16px calc(12px + env(safe-area-inset-bottom));background:#161A31;border-top:1px solid rgba(255,255,255,.08)}
html.v69-variant-mobile #feedback-fab,html.v69-variant-mobile #v67-board-fab,html.v69-variant-mobile #ege-py-fab{display:none!important}
html.v69-variant-mobile body{padding-bottom:calc(var(--v69-dock-h,64px) + 18px)!important}
html.v69-variant-mobile #ege-py-panel{left:8px!important;right:8px!important;top:8px!important;bottom:auto!important;width:auto!important;max-width:none!important;max-height:calc(100dvh - 16px)!important;z-index:9650!important}
/* «Ошибка в задании или идея» — тихая кнопка под заданием (и на десктопе) */
.v69-report{display:inline-flex;align-items:center;gap:7px;margin-top:14px;padding:8px 0;background:transparent;border:none;color:var(--text-dim,#A3A7BE);font:500 14px var(--sans,'Onest',sans-serif);cursor:pointer}
.v69-report:hover{color:var(--text,#ECE8DC)}
html.v69-mobile main{padding-bottom:8px!important}
html.v69-mobile .wrap.layout{padding-bottom:8px!important}
#feedback-modal{z-index:9800!important}
