/*
 * Экселио — стили ядра, общие для всех уровней.
 * Палитра — из макета PDF программы (Ресурсы/Игра/PDF): бумага, дерево, мед, мята,
 * бирюза. Кнопки — желтые с коричневым текстом (решение 29.09.2026 для стиля игр).
 * Окна — «пластилин»: скругления, мягкие тени, светлый блик сверху.
 */

:root {
  --paper: #fbf5ea;
  --paper-2: #f5ecdc;
  --wood: #7a4a2a;
  --wood-dark: #4e2e15;
  --honey: #f2c14e;
  --honey-light: #ffd97a;
  --honey-dark: #c9922a;
  --ink: #3b2a1e;
  --ink-soft: #6b5645;
  --line: #e6d5bb;
  --mint: #cdeedd;
  --mint-ink: #1f7a55;
  --teal: #d3ecf0;
  --teal-ink: #1f6b78;
  --amber: #fbe3c0;
  --amber-ink: #9a5a12;
  --grey: #ece6dc;
  --grey-ink: #8b8175;
  --red: #fbe4dd;
  --red-ink: #a33a24;
  --hud: clamp(40px, 4.2vw, 56px);
  --ui: Inter, "Open Sans", system-ui, sans-serif;
  --text: "Open Sans", Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  background: #2b2118;
  color: var(--ink);
  font: 15px/1.5 var(--text);
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
img { max-width: 100%; }

/* ───────── Сцена ───────── */
#viewport { position: fixed; inset: 0; overflow: hidden; }
#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1440px;
  height: 780px;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  overflow: hidden;
  background: #b48fd0;
}
.screen { position: absolute; inset: 0; }
#world { display: block; width: 1440px; height: 780px; }

.loading {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 18px;
  background: radial-gradient(circle at 50% 40%, #4a3524, #2b2118);
  color: #fbe7c4; font: 600 28px var(--ui); text-align: center;
}
.loading-bar { width: 420px; height: 16px; border-radius: 8px; background: rgba(255,255,255,.12); overflow: hidden; }
.loading-bar i { display: block; width: 40%; height: 100%; border-radius: 8px; background: var(--honey); animation: loadingSlide 1.1s ease-in-out infinite; }
@keyframes loadingSlide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ───────── Карта ───────── */
.map-bg { position: absolute; display: block; max-width: none; user-select: none; }

.pad {
  position: absolute; width: 108px; height: 62px; padding: 0; border: 0; background: none;
  transform: translate(-50%, -50%);
}
.pad-ring { position: absolute; inset: 0; border-radius: 50%; transition: box-shadow .2s; }
.pad-current .pad-ring {
  box-shadow: 0 0 0 5px #ffd66b, 0 0 28px 12px rgba(255, 214, 107, .8);
  animation: padPulse 1.6s ease-in-out infinite;
}
.pad-done .pad-ring { box-shadow: 0 0 0 5px #7fd3a4, 0 0 20px 7px rgba(127, 211, 164, .7); }
.pad-given .pad-ring { box-shadow: 0 0 0 5px #c9bfae, 0 0 14px 5px rgba(201, 191, 174, .6); }
.pad-locked { cursor: not-allowed; }
.pad-locked .pad-ring { background: rgba(60, 40, 30, .14); }
.pad:not(.pad-locked):hover .pad-ring { background: rgba(255, 255, 255, .25); }
.pad:focus-visible { outline: none; }
.pad:focus-visible .pad-ring { outline: 4px solid #fff; outline-offset: 4px; }
.pad-num {
  position: absolute; left: -22px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: #fff8ea; border: 3px solid var(--wood); color: var(--ink);
  font: 800 19px var(--ui); box-shadow: 0 4px 0 rgba(78, 46, 21, .4);
}
.pad-current .pad-num { background: var(--honey-light); }
.pad-done .pad-num { background: var(--mint); }
.pad-given .pad-num { background: var(--grey); }
.pad-locked .pad-num { font-size: 15px; background: var(--grey); }
.pad-tool {
  position: absolute; left: 50%; bottom: 62%; width: 64px; height: 64px; object-fit: contain;
  transform: translateX(-50%); pointer-events: none;
  filter: drop-shadow(2px 5px 4px rgba(59, 42, 30, .4));
  animation: toolBob 2.4s ease-in-out infinite;
}
/* Инструмент «Выдал Мастер» — серый. Полупрозрачность .5 (29.10.2026) прятала его почти целиком; вместо нее
 * стетоскоп перекрашен в синий, чтобы найденный самим не путался с серым (Оля 30.10.2026) */
.pad-given .pad-tool { filter: grayscale(1) drop-shadow(2px 5px 4px rgba(59, 42, 30, .35)); opacity: .9; }

.map-hero { position: absolute; width: 0; height: 0; pointer-events: none; }
.map-hero-img {
  position: absolute; left: 0; bottom: -3px; height: var(--hero-h); width: auto; max-width: none;
  transform: translateX(-50%); transform-origin: 50% 100%;
  animation: heroBob 1.8s ease-in-out infinite;
}
/* Тень обязательна и заметна: два вложенных размытых овала теплого темно-коричневого цвета */
.map-shadow { position: absolute; left: 0; top: 0; border-radius: 50%; transform: translate(-50%, -50%); }
.map-shadow-outer { width: 124px; height: 36px; background: rgba(74, 42, 20, .42); filter: blur(7px); animation: shadowBob 1.8s ease-in-out infinite; }
.map-shadow-inner { width: 66px; height: 17px; background: rgba(58, 32, 14, .68); filter: blur(3px); animation: shadowBob 1.8s ease-in-out infinite; }

@keyframes padPulse { 50% { box-shadow: 0 0 0 7px #ffe08f, 0 0 40px 18px rgba(255, 214, 107, .95); } }
@keyframes toolBob { 50% { transform: translate(-50%, -6px); } }
@keyframes heroBob { 50% { transform: translate(-50%, -5px); } }
@keyframes shadowBob { 50% { transform: translate(-50%, -50%) scale(.9); opacity: .85; } }

/* ───────── HUD (снаружи сцены) ───────── */
.hud {
  position: fixed; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 20;
  display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none;
}
.hud-left, .hud-right { display: flex; gap: 8px; }
.hud-left > *, .hud-right > * { pointer-events: auto; }
.hud[data-mode="map"] .hud-coins, .hud[data-mode="map"] .hud-map { display: none; }
.hud-btn, .hud-coins {
  height: var(--hud); min-width: var(--hud); padding: 0 10px; border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 3px solid var(--wood); background: linear-gradient(#fffaf0, #f1e2c7);
  color: var(--ink); font: 800 calc(var(--hud) * .34) var(--ui);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8), 0 4px 0 rgba(78, 46, 21, .45);
}
.hud-btn:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255,255,255,.8), 0 2px 0 rgba(78,46,21,.45); }
.hud-btn span[aria-hidden] { font-size: calc(var(--hud) * .45); line-height: 1; }
.hud-coins img { height: 64%; width: auto; }
.hud-box img, .hud-map img { height: 82%; width: auto; }
.hud-box.bump { animation: boxBump .55s ease; }
.sound-btn svg, .hud-menu svg { width: 60%; height: 60%; display: block; }
.hud-sound, .hud-menu { padding: 0; }
.hud-sound.off { background: linear-gradient(#f3ece0, #e2d6c2); color: var(--grey-ink); }
.pw-sound {
  flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .16); color: #fff;
}
.pw-sound:hover { background: rgba(255, 255, 255, .28); }
.pw-sound.off { color: rgba(255, 255, 255, .6); }
@keyframes boxBump { 30% { transform: scale(1.25) rotate(-6deg); } 60% { transform: scale(.95) rotate(3deg); } }
@media (max-width: 560px) { .hud-label { display: none; } }

/* ───────── Кнопки ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 14px; padding: 12px 22px;
  background: linear-gradient(#ffdb7e, var(--honey));
  color: #4a2f18; font: 700 16px/1.2 var(--text); text-align: center;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), 0 4px 0 var(--honey-dark), 0 8px 16px rgba(78, 46, 21, .22);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 1px 0 var(--honey-dark), 0 4px 10px rgba(78,46,21,.2); }
.btn:disabled { filter: grayscale(.5) opacity(.7); cursor: default; transform: none; }
.btn:focus-visible, .btn-link:focus-visible, .hud-btn:focus-visible { outline: 3px solid #1f6b78; outline-offset: 3px; }
.btn-sm { padding: 8px 14px; font-size: 14px; border-radius: 12px; }
.btn-big { padding: 14px 36px; font-size: 20px; border-radius: 18px; }
.btn-ghost {
  background: #fffaf0; color: var(--wood);
  box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 var(--line);
}
.btn-teal { background: linear-gradient(#e2f4f7, #bfe3ea); color: var(--teal-ink); box-shadow: inset 0 2px 0 rgba(255,255,255,.7), 0 4px 0 #8cc3cd; }
.btn-danger { background: linear-gradient(#f8c7b8, #ee9c85); color: #5c1d10; box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 4px 0 #c0654c; }
.btn.busy { animation: busy 1s ease-in-out infinite; }
@keyframes busy { 50% { filter: brightness(1.12); } }
.btn-link { border: 0; background: none; padding: 6px 4px; color: var(--amber-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.btn-link.danger { color: var(--red-ink); }

/* ───────── Нижняя панель действий и сенсорные кнопки ───────── */
.actionbar {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 15; display: flex; gap: 10px; align-items: center; justify-content: center;
  width: max-content; max-width: calc(100vw - 24px); flex-wrap: wrap;
}
.btn-run, .btn-action { font-size: 17px; padding: 11px 20px; }
.btn-action { background: linear-gradient(#e2f4f7, #bfe3ea); color: var(--teal-ink); box-shadow: inset 0 2px 0 rgba(255,255,255,.7), 0 4px 0 #8cc3cd, 0 8px 16px rgba(78,46,21,.2); }

.touchpad {
  position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 14;
  display: flex; justify-content: space-between; align-items: flex-end; pointer-events: none;
}
.touchpad button {
  pointer-events: auto; width: 64px; height: 64px; border-radius: 20px;
  border: 3px solid var(--wood); background: rgba(255, 250, 240, .88); color: var(--wood);
  font: 800 22px var(--ui); box-shadow: 0 4px 0 rgba(78, 46, 21, .45);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.touchpad button:active { background: var(--honey-light); transform: translateY(2px); }
.tp-left { display: flex; gap: 10px; }
.touchpad .tp-jump { width: 104px; font-size: 18px; }
body.has-overlay .touchpad, body.has-overlay .actionbar { visibility: hidden; }

/* ───────── Логотип и «во весь экран» ─────────
 * Одинаково в играх и тренажерах тестов программы (решение Оли 02.10.2026, тот же блок —
 * в Ресурсы/Шаблоны/Тренажер тестов Экселио/template.html): логотип школы без подложки,
 * кнопка — как кнопки верхней панели игры. */
.school-logo {
  position: fixed; left: 16px; bottom: 14px; z-index: 12; height: clamp(36px, 5.5vw, 46px); width: auto;
  pointer-events: none;
}
.fs-btn {
  position: fixed; right: 16px; bottom: 14px; z-index: 12;
  width: clamp(40px, 5.5vw, 48px); height: clamp(40px, 5.5vw, 48px);
  display: grid; place-items: center; padding: 0; border-radius: 14px;
  border: 3px solid var(--wood); background: linear-gradient(#fffaf0, #f1e2c7); color: var(--wood);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8), 0 4px 0 rgba(78, 46, 21, .45);
}
.fs-btn:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .8), 0 2px 0 rgba(78, 46, 21, .45); }
.fs-btn svg { width: 55%; height: 55%; }
@media (pointer: coarse) {
  .actionbar { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 76px); }
  .school-logo { left: 50%; transform: translateX(-50%); top: 10px; bottom: auto; height: 34px; }
  .fs-btn { bottom: calc(max(12px, env(safe-area-inset-bottom)) + 80px); }
}
.rotate-hint { display: none; }
@media (pointer: coarse) and (orientation: portrait) {
  body[data-screen="level"] .rotate-hint {
    display: block; position: fixed; left: 50%; top: calc(var(--hud) + 60px); transform: translateX(-50%); z-index: 13;
    width: max-content; max-width: 90vw; padding: 8px 14px; border-radius: 12px;
    background: rgba(251, 245, 234, .92); color: var(--wood); font: 700 14px var(--ui); text-align: center;
  }
}

/* ───────── Окна поверх игры ───────── */
.ov {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 2vh 2vw;
  background: rgba(34, 22, 12, .58); opacity: 0; transition: opacity .18s ease;
}
.ov.ov-shown { opacity: 1; }
.ov.ov-leaving { opacity: 0; }
.ov-panel {
  position: relative; background: var(--paper); border: 4px solid var(--wood); border-radius: 26px;
  max-width: 96vw; max-height: 94vh; overflow: auto;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .7), 0 10px 0 rgba(78, 46, 21, .5), 0 26px 60px rgba(0, 0, 0, .38);
  transform: translateY(14px) scale(.98); transition: transform .2s ease;
}
.ov-shown .ov-panel { transform: none; }
.pw-close {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(59, 42, 30, .08); color: var(--ink); font: 400 30px/1 var(--ui);
  display: grid; place-items: center;
}
.pw-close:hover { background: rgba(59, 42, 30, .16); }
/* Крестик линиями (util.js closeIcon): точно в центре круга, в отличие от символа × */
.x-icon { display: block; width: .55em; height: .55em; }
.x-icon svg { display: block; width: 100%; height: 100%; overflow: visible; }
.x-icon path { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

/* ───────── Окно точки ───────── */
.ov-point .ov-panel { width: min(1100px, 96vw); height: min(900px, 94vh); overflow: hidden; }
.pw { display: flex; flex-direction: column; height: 100%; }
.pw-head {
  flex: none; display: flex; align-items: center; gap: 14px; padding: 8px 14px 8px 12px;
  background: linear-gradient(180deg, #936038, #6e4223); color: #fff7e8;
  border-bottom: 4px solid var(--wood-dark); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .2);
}
.pw-tool { width: 66px; height: 66px; object-fit: contain; flex: none; filter: drop-shadow(2px 4px 4px rgba(0, 0, 0, .35)); }
.pw-tool.grey { filter: grayscale(1) drop-shadow(2px 4px 4px rgba(0,0,0,.35)); }
.pw-titles { flex: 1; min-width: 0; }
.pw-kicker { font: 600 13px var(--ui); opacity: .85; }
.pw-task { margin: 2px 0; font: 700 clamp(17px, 1.9vw, 24px)/1.22 var(--text); }
.pw-head .pw-close { background: rgba(255, 255, 255, .16); color: #fff; }
.pw-head .pw-close:hover { background: rgba(255, 255, 255, .28); }
.pw-mark { flex: none; font: 700 13px var(--ui); padding: 5px 10px; border-radius: 999px; }
.mark-self.pw-mark, .tb-mark.mark-self, .pp-chip.mark-self { background: var(--mint); color: var(--mint-ink); }
.mark-master.pw-mark, .tb-mark.mark-master, .pp-chip.mark-master { background: var(--teal); color: var(--teal-ink); }
.mark-given.pw-mark, .tb-mark.mark-given, .pp-chip.mark-given { background: var(--grey); color: var(--grey-ink); }

/* Шагами (решение 29.09.2026): «1 Теория» → «2 Задача», каждый шаг — свой экран.
 * Карточка теории подстраивается под высоту окна, чтобы шаг теории помещался без прокрутки:
 * --pw-chrome — сколько высоты окна занято вокруг карточки (шапка, переключатели, стрелки,
 * отступы). 05.10.2026 отступы ужаты, чтобы карточка и шрифт на ноутбуке стали крупнее. */
.ov-point { --pw-h: min(900px, 94vh); --pw-chrome: 226px; }
.pw-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 10px 18px 14px; }
.pw-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: 1000px; margin: 0 auto 10px; }
.pw-toolbar .tabs { margin: 0 0 0 auto; }
.steps { display: flex; align-items: center; gap: 6px; }
.step {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 14px 5px 6px; border-radius: 999px;
  border: 2px solid var(--line); background: #fffaf0; color: var(--ink-soft); font: 700 14px var(--ui);
}
.step b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); font-size: 13px; }
.step.on { background: var(--honey-light); border-color: var(--honey-dark); color: #4a2f18; }
.step.on b { background: #fff3cf; }
.step-arrow { color: var(--grey-ink); font-weight: 800; }
.story-pill {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  border: 2px solid #8cc3cd; background: var(--teal); color: var(--teal-ink); font: 700 14px var(--ui);
  animation: busy 1.6s ease-in-out infinite;
}
.pw-theory, .pw-stepped .pw-solve { max-width: 1000px; margin: 0 auto; }
/* --pw-head-extra — на сколько шапка выше обычной (вопрос в две строки), ставит openPoint (Оля 12.11.2026) */
.pw-theory .card-wrap { width: min(100%, calc((var(--pw-h) - var(--pw-chrome) - var(--pw-head-extra, 0px)) * 16 / 9)); margin: 0 auto; }
.cards-nav { max-width: calc((var(--pw-h) - var(--pw-chrome) - var(--pw-head-extra, 0px)) * 16 / 9); margin-left: auto; margin-right: auto; }
.to-task { margin-left: auto; }
.pw-solve { background: #fffdf8; border: 2px solid var(--line); border-radius: 20px; padding: 14px 18px 16px; }
.pw-solve-title { font: 800 13px var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--amber-ink); margin-bottom: 6px; }
/* Точка без карточек: условие с табличкой и ответ рядом */
.pw-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; max-width: 1060px; margin: 0 auto; align-items: start; }
.pw-no-cards .pw-toolbar { max-width: 1060px; }
.pw-no-cards .tk-statement { background: #fffdf8; border: 2px solid var(--line); border-radius: 20px; padding: 14px 18px; }
@media (max-width: 900px) { .pw-grid { display: block; } .pw-grid .pw-solve { margin-top: 14px; } }
@media (max-width: 760px) {
  .ov-point { padding: 0; --pw-h: 100vh; }
  .pw-theory .card-wrap, .cards-nav { width: 100%; max-width: none; }
  .steps .step { padding-right: 10px; }
  .ov-point .ov-panel { width: 100vw; height: 100%; max-width: none; max-height: none; border-radius: 0; border-width: 0; }
  .pw-tool { width: 52px; height: 52px; }
  .pw-mark { display: none; }
  .pw-body { padding: 12px; }
}

.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab {
  border: 2px solid var(--line); background: #fffaf0; color: var(--ink-soft);
  border-radius: 999px; padding: 6px 16px; font: 700 14px var(--ui);
}
.tab.on { background: var(--honey-light); border-color: var(--honey-dark); color: #4a2f18; }

/* Карточка теории: основа уровня + текст поверх пустой панели */
.card-wrap { container-type: inline-size; }
/* Фон — на случай медленного интернета: пока основа карточки грузится, видна деревянная рамка
 * с бумажной панелью, а не пустое белое поле */
.card-view {
  position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; box-shadow: 0 6px 16px rgba(78, 46, 21, .25);
  background: linear-gradient(#f7eedd, #f7eedd) 34.5% 12.5% / 59.8% 73.7% no-repeat, linear-gradient(135deg, #8a5a33, #6e4223);
}
.card-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-master { display: none; }
/* Размер шрифта — от ширины карточки. Не влез текст — point.js уменьшает его: у карточек
 * точки — общим множителем --card-fit по самой полной (fitCardGroup), у одиночной — по шагам
 * (fitCardText). Не влез и на 70% — тонкая прокрутка внутри доски, а не обрезанный текст
 * (26.10.2026: карточки точек 4–5 второго этажа после черновой вычитки длиннее доски). */
.card-text {
  position: absolute; padding: 3cqi 3.2cqi 2.4cqi; overflow: hidden auto; scrollbar-width: thin;
  color: var(--ink); font-size: calc(clamp(11px, 1.95cqi, 21px) * var(--card-fit, 1)); line-height: 1.38;
}
.card-text.dense { font-size: calc(clamp(10px, 1.8cqi, 19px) * var(--card-fit, 1)); line-height: 1.36; }
.cards-slot { position: relative; }
.cards-probe { position: absolute; left: 0; right: 0; top: 0; visibility: hidden; pointer-events: none; }
.card-text h3 { margin: 0 0 .45em; font: 700 1.28em/1.2 var(--text); color: #5a3419; }
.card-body p { margin: 0 0 .5em; }
.card-body ul, .card-body ol { margin: 0 0 .5em; padding-left: 1.2em; }
.card-body li { margin-bottom: .22em; }
.card-body a, .pp-table a { color: var(--teal-ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .18em; }
.pp-table td + td a { font-weight: 400; text-decoration: none; }
.card-body a:hover { color: #0f4d58; }
.card-body code { font-family: Consolas, monospace; background: #f1e6d2; padding: 0 .2em; border-radius: .2em; }
/* Заголовки в подбор и выделения — тем же коричневым, что заголовок карточки, как в «Как играть»
 * (Оля 21.10.2026: темный жирный рядом с коричневым заголовком смотрелся неаккуратно) */
.card-body b { color: #5a3419; }
.card-body .bad { color: #8a3a26; }
.card-body .good { color: #1f5a3c; }
/* Реплика, которую студент пишет нейросети, — на белой плашке, чтобы ее было видно сразу
 * (Оля 21.10.2026). Внутри без кавычек: плашка сама показывает, что это промпт. */
.card-body .say {
  margin: .15em 0 .6em; padding: .35em .75em; border-radius: .55em; background: #fff;
  box-shadow: 0 .12em .45em rgba(78, 46, 21, .12);
}
.card-body .say-hint { color: #8a7a68; font-style: italic; } /* что вставить в промпт самому */
/* Второй этаж: доска металлическая, коричневый текст на сером не читается (Оля 27.10.2026) —
 * текст темно-серый; обычный тем же цветом, что заголовки и выделения: к углам доска темнеет, и более
 * светлый текст там читался тяжело (Оля 29.10.2026). Запасной фон, пока грузится основа, — тоже металл */
[data-level="floor2"] .card-text { color: #1e2327; }
/* Текст на доске второго этажа крупнее: поля внутри доски поуже, строки чуть плотнее (Оля 27.10.2026 — не
 * резать карточки). По бокам 3cqi — строки не заходят на заклепки в углах доски. */
[data-level="floor2"] .card-view .card-text { padding: 2.2cqi 3cqi 1.6cqi; line-height: 1.32; }
[data-level="floor2"] .card-view .card-text.dense { line-height: 1.3; }
[data-level="floor2"] .card-text h3, [data-level="floor2"] .card-body b { color: #1e2327; }
[data-level="floor2"] .card-body .say-hint { color: #686e74; }
[data-level="floor2"] .card-body code { background: #e4e7ea; }
[data-level="floor2"] .card-view {
  background: linear-gradient(#d9dcdf, #d9dcdf) 35.5% 9% / 62% 80% no-repeat, linear-gradient(135deg, #6f8a74, #4f6655);
}
/* Лента бонуса на стальной доске — зеленая, в цвет рамы, как плашка на обложке теста урока 4: медовая
 * хороша на дереве, а на металле не смотрится (Оля 30.10.2026) */
[data-level="floor2"] .card-ribbon { background: #5f7a65; color: #fff; }
/* Крыша: карточки длинные — поля текста уже, строки плотнее. С 09.11.2026 планшет больше (roof.js, cardPanel),
 * запасной фон, пока грузится основа, — под новый лист */
[data-level="roof"] .card-view .card-text { padding: 1cqi 1.6cqi .6cqi; line-height: 1.32; }
[data-level="roof"] .card-view {
  background: linear-gradient(#f7eedd, #f7eedd) 89% 55% / 74% 78% no-repeat, linear-gradient(135deg, #8a5a33, #6e4223);
}
.card-ribbon { display: inline-block; margin-bottom: .4em; padding: .2em .8em; border-radius: 999px; background: var(--honey); color: #4a2f18; font: 800 .78em var(--ui); }
@container (max-width: 560px) {
  .card-view { aspect-ratio: auto; background: var(--paper); border: 5px solid var(--wood); padding: 12px; }
  .card-bg { display: none; }
  .card-master { display: block; float: right; width: 84px; margin: 0 0 6px 8px; }
  .card-text { position: static; width: auto !important; height: auto !important; padding: 0; overflow: visible; font-size: 15px !important; }
  .card-text.dense { font-size: 14px !important; }
  /* Второй этаж: без этого оставалась металлическая подложка доски — зеленое поле с серым
   * прямоугольником посередине, и текст листа ложился поверх них (прохождение 28.10.2026,
   * окно 960×540). Лист — светлый металл в зеленой раме, как у лупы */
  [data-level="floor2"] .card-view { background: #e3e6e9; border-color: #5f7a65; }
  [data-level="floor2"] .card-view .card-text { padding: 0; }
  /* Крыша: то же, что на втором этаже, — без этого текст ложился на коричневую доску слева от листа
   * (прохождение 10.11.2026, окно 960×540). Лист бумаги в коричневой раме планшета */
  [data-level="roof"] .card-view { background: var(--paper); border-color: #6e4223; }
  [data-level="roof"] .card-view .card-text { padding: 0; }
}

/* Лупа: «Крупнее» в углу карточки, по нажатию — доска во все окно (point.js, openCardZoom) */
.card-zoomable { cursor: zoom-in; }
.card-zoom-btn {
  position: absolute; right: 1.6%; bottom: 3%; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 9px; border-radius: 999px; border: 2px solid var(--wood); background: rgba(255, 250, 240, .94);
  color: #5a3419; font: 700 14px var(--ui); box-shadow: 0 3px 0 rgba(78, 46, 21, .35); cursor: zoom-in;
}
.card-zoom-btn:hover { background: #fff; }
.card-zoom-btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
/* Карточка-лист на узком экране: значок — под текстом справа, а не поверх Мастера */
@container (max-width: 560px) {
  .card-zoom-btn { position: static; clear: both; display: flex; width: max-content; margin: 10px 0 0 auto; }
}
.ov-zoom { padding: 34px 28px 26px; cursor: zoom-out; }
.ov-zoom .ov-panel {
  width: min(1120px, 100%); max-width: none; max-height: none; overflow: visible;
  height: min(760px, calc(100vh - 60px)); height: min(760px, calc(100dvh - 60px));
  background: #f7eedd; border: 14px solid #8a5a33; border-radius: 18px;
  box-shadow: inset 0 0 0 3px #6e4223, 0 18px 40px rgba(0, 0, 0, .45);
}
/* Гвоздики сверху рамки — как на доске Мастера */
.ov-zoom .ov-panel::before, .ov-zoom .ov-panel::after {
  content: ''; position: absolute; top: -26px; width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #6b5a4a, #2c241d); box-shadow: 0 2px 3px rgba(0, 0, 0, .5);
}
/* Второй этаж: увеличенная доска — металл в зеленой раме, как сама карточка */
[data-level="floor2"] .ov-zoom .ov-panel {
  background: #e3e6e9; border-color: #5f7a65;
  box-shadow: inset 0 0 0 3px #4a5f50, 0 18px 40px rgba(0, 0, 0, .45);
}
.ov-zoom .ov-panel::before { left: 60px; }
.ov-zoom .ov-panel::after { right: 60px; }
.card-zoom-sheet { height: 100%; display: flex; flex-direction: column; padding: 40px 60px 16px; }
.card-text.card-zoom-text { position: static; flex: 1 1 auto; min-height: 0; padding: 0; overflow: auto; }
.card-zoom-x {
  position: absolute; top: 10px; right: 12px; z-index: 1; width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--wood); background: #fffaf0; color: var(--wood); font: 800 26px/1 var(--ui);
  display: grid; place-items: center; box-shadow: 0 3px 0 rgba(78, 46, 21, .35);
}
.card-zoom-x .x-icon { width: .65em; height: .65em; }
.card-zoom-x .x-icon path { stroke-width: 2.2; }
.card-zoom-foot { flex: none; margin: 8px 0 0; text-align: center; font: 600 14px var(--ui); color: #7a6a55; }
/* Второй этаж: крестик и подпись на стальном листе — в цвет зеленой рамы и серого текста, а не под дерево
 * (Оля 30.10.2026, вместе с лентой бонуса) */
[data-level="floor2"] .card-zoom-x { border-color: #5f7a65; background: #f4f6f7; color: #4a5f50; box-shadow: 0 3px 0 rgba(40, 55, 45, .35); }
[data-level="floor2"] .card-zoom-foot { color: #5b6268; }
@media (max-width: 560px) {
  .ov-zoom { padding: 14px 10px 10px; }
  .ov-zoom .ov-panel { border-width: 8px; height: calc(100vh - 24px); height: calc(100dvh - 24px); }
  .ov-zoom .ov-panel::before, .ov-zoom .ov-panel::after { display: none; }
  .card-zoom-sheet { padding: 52px 18px 10px; }
  .card-zoom-x { top: 6px; right: 6px; width: 38px; height: 38px; font-size: 22px; }
  .card-zoom-foot { font-size: 12px; }
}
.cards-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; }
.cards-arrow {
  width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--wood); background: #fffaf0;
  color: var(--wood); font: 800 26px/1 var(--ui); box-shadow: 0 3px 0 rgba(78, 46, 21, .35);
}
.cards-arrow:disabled { opacity: .35; cursor: default; }
.cards-dots { display: flex; gap: 6px; }
.dot { width: 12px; height: 12px; padding: 0; border-radius: 50%; border: 2px solid var(--wood); background: #fffaf0; }
.dot.on { background: var(--honey); }
.cards-count { font: 600 13px var(--ui); color: var(--ink-soft); min-width: 52px; text-align: center; }

/* Интерфейс чата на карточке 1.3 — нарисован в HTML, цифры на нем — кнопки */
.chat-mock {
  display: grid; grid-template-columns: 30% 1fr; margin: .5em 0 .55em; border: 2px solid #d9c7a9;
  border-radius: .9em; overflow: hidden; background: #fff; font: .92em/1.35 var(--ui);
}
.cm-side { background: #f4efe6; padding: .65em .55em; display: flex; flex-direction: column; gap: .45em; min-width: 0; }
.cm-new { background: #fff; border: 1.5px solid #d9c7a9; border-radius: .6em; padding: .25em .45em; font-weight: 700; display: flex; align-items: center; }
.cm-hist-title { font-weight: 700; color: var(--grey-ink); margin-top: .2em; display: flex; align-items: center; }
.cm-hist { color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: .3em; }
.cm-main { padding: .65em; display: flex; flex-direction: column; gap: .5em; min-width: 0; }
.cm-msg { border-radius: .8em; padding: .25em .6em; max-width: 88%; }
.cm-user { align-self: flex-end; background: var(--teal); }
.cm-bot { align-self: flex-start; background: #f4efe6; }
.cm-input { display: flex; align-items: center; gap: .45em; border: 1.5px solid #d9c7a9; border-radius: 1em; padding: .3em .45em; }
.cm-field { flex: 1; color: #a09383; display: flex; align-items: center; justify-content: space-between; }
.cm-clip, .cm-send { position: relative; flex: none; width: 1.8em; height: 1.8em; display: grid; place-items: center; border-radius: 50%; }
.cm-clip { color: var(--ink-soft); }
.cm-send { background: var(--ink); color: #fff; }
.cm-clip svg, .cm-send svg { width: 1.1em; height: 1.1em; }
.cm-clip .cm-tag, .cm-send .cm-tag { position: absolute; top: -.75em; right: -.75em; margin: 0; }
.cm-modes { display: flex; gap: .4em; align-items: center; }
.cm-chip { border: 1.5px solid #d9c7a9; border-radius: 1em; padding: .05em .6em; color: var(--ink-soft); }
.cm-tag {
  display: inline-grid; place-items: center; flex: none; width: 1.75em; height: 1.75em; margin: 0 .4em 0 0; padding: 0;
  border: 2px solid #fff; border-radius: 50%; background: #e0523b; color: #fff; font: 800 .85em/1 var(--ui);
  cursor: pointer; animation: tipPulse 1.6s ease-out infinite; transition: transform .15s;
}
.cm-tag:hover { transform: scale(1.15); }
.cm-tag.seen { animation: none; }
.cm-tag.on { background: var(--honey); color: #4a2f18; border-color: var(--wood); transform: scale(1.15); }
@keyframes tipPulse {
  0% { box-shadow: 0 0 0 0 rgba(224, 82, 59, .6); }
  70%, 100% { box-shadow: 0 0 0 .55em rgba(224, 82, 59, 0); }
}
.tip-note {
  display: flex; gap: .55em; align-items: flex-start; min-height: 4.3em; padding: .5em .75em;
  border-radius: .7em; background: var(--teal); line-height: 1.38;
}
.tip-num {
  flex: none; display: grid; place-items: center; width: 1.6em; height: 1.6em; margin-top: -.05em; border-radius: 50%;
  background: var(--honey); border: 2px solid var(--wood); color: #4a2f18; font: 800 .8em/1 var(--ui);
}

/* Слушать Мастера: рамка того же размера, что доска карточек, — при смене вкладок ничего не прыгает.
 * Внутри по центру: Мастер во весь рост ростом с текст, рядом два абзаца, под ними плеер (Оля 29.10.2026:
 * раньше огромная фигура наезжала на рамку рядом с мелким текстом; в окне урока плеер уезжал вниз) */
.listen-card {
  width: min(100%, calc((var(--pw-h) - var(--pw-chrome) - var(--pw-head-extra, 0px)) * 16 / 9)); aspect-ratio: 16 / 9; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; padding: 20px 28px;
  background: #fffaf0; border: 2px solid var(--line); border-radius: 20px; container-type: inline-size;
}
.listen-inner { width: 100%; max-width: 680px; display: flex; flex-direction: column; gap: 18px; }
/* Мастер занимает колонку и вписывается по высоте текста: картинка лежит поверх ячейки и не растягивает ее */
.listen-head { display: grid; grid-template-columns: 20% minmax(0, 1fr); gap: 20px; }
.listen-fig { position: relative; min-height: 120px; }
.listen-fig img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%;
  filter: drop-shadow(3px 4px 6px rgba(95, 55, 25, .4)); /* мягкая тень, как у предметов в PDF и ящике */
}
.listen-text { align-self: center; }
/* Размер текста — от ширины рамки: в окошке урока мельче, во весь экран крупнее */
.listen-lead { margin: 0; font: 400 clamp(15px, 2.4cqi, 20px)/1.45 var(--ui); color: var(--ink); }
.listen-lead + .listen-lead { margin-top: .6em; }
/* Рядом с задачей доски нет — по содержимому колонки. Без container-type: колонка подстраивается
 * под содержимое, а контейнер для нее «пустой» — панель схлопывалась в полоску */
.pw-no-cards .listen-card { width: auto; aspect-ratio: auto; padding: 18px 20px; container-type: normal; }
.pw-no-cards .listen-head { grid-template-columns: 22% minmax(0, 1fr); }
.pw-no-cards .listen-lead { font-size: 16px; }
@media (max-width: 560px) {
  .listen-card { aspect-ratio: auto; padding: 16px; }
}

/* Плеер */
.player { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.pl-row { display: flex; gap: 12px; align-items: center; }
.pl-play {
  flex: none; width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: linear-gradient(#ffdb7e, var(--honey)); color: #4a2f18;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 4px 0 var(--honey-dark);
  display: grid; place-items: center; font-size: 22px;
}
.pl-play::before { content: "▶"; margin-left: 3px; }
.player.playing .pl-play::before { content: "❚❚"; margin-left: 0; font-size: 18px; letter-spacing: -2px; }
.pl-mid { flex: 1; min-width: 0; }
.pl-title { font: 700 14px var(--ui); margin-bottom: 4px; }
.pl-line { display: flex; gap: 10px; align-items: center; }
.pl-bar { flex: 1; accent-color: var(--honey-dark); }
.pl-time { font: 600 12px var(--ui); color: var(--ink-soft); white-space: nowrap; }
.pl-speeds { display: flex; gap: 6px; margin-top: 10px; }
.pl-speed { border: 2px solid var(--line); background: #fffaf0; border-radius: 999px; padding: 3px 12px; font: 700 13px var(--ui); color: var(--ink-soft); }
.pl-speed.on { background: var(--teal); border-color: #8cc3cd; color: var(--teal-ink); }
.pl-list { list-style: none; margin: 12px 0 0; padding: 0; }
.pl-list button { width: 100%; text-align: left; border: 0; background: none; padding: 7px 10px; border-radius: 10px; }
.pl-list button:hover { background: #fff6dc; }
.pl-list li.on button { background: #fff0c4; font-weight: 700; }

/* ───────── Задачи ───────── */
.tk-intro { margin: 0 0 10px; }
.tk-intro ol, .tk-intro ul { margin: 0; padding-left: 1.3em; }
.tk-intro li { margin-bottom: 4px; }
.tk-copy { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 2px dashed #d7c4a6; border-radius: 14px; padding: 12px 14px; }
.tk-copy p { flex: 1; margin: 0; font: 15px/1.45 var(--ui); }
.btn-copy { flex: none; }
.tk-after { margin: 10px 0 0; }
.tk-field { display: block; margin: 12px 0 0; }
.tk-label { display: block; font: 700 14px var(--ui); margin-bottom: 5px; }
.tk-input {
  width: 100%; border: 2px solid #dcc8a8; border-radius: 12px; padding: 10px 12px; background: #fffdf8;
  font: 15px/1.45 var(--text); color: var(--ink); resize: vertical;
}
.tk-input:focus { outline: none; border-color: var(--honey-dark); box-shadow: 0 0 0 3px rgba(242, 193, 78, .35); }
.tk-input:disabled { opacity: .7; }
.tk-formula { font: 16px/1.4 Consolas, "Courier New", monospace; }

.chat { background: #eef3f6; border-radius: 16px; padding: 12px; }
.chat-user { margin-left: auto; width: fit-content; max-width: 80%; background: var(--teal); border-radius: 14px 14px 4px 14px; padding: 7px 12px; }
.chat-bot { background: #fff; border-radius: 14px 14px 14px 4px; padding: 8px; margin-top: 10px; }
.chat-ai { font: 700 12px var(--ui); color: var(--teal-ink); margin: 0 0 4px 8px; }
.pl-line-btn {
  display: block; width: 100%; text-align: left; border: 2px solid transparent; background: none;
  border-radius: 10px; padding: 8px 10px; font: 15px/1.45 var(--text); color: var(--ink);
}
.pl-line-btn:hover:not(:disabled) { background: #fff6dc; }
.pl-line-btn.chosen { border-color: var(--honey); background: #fff3cf; }
.pl-line-btn.right { border-color: #6cc497; background: #e6f6ed; }
.pl-line-btn.wrong { border-color: #e39a84; background: #fdeee9; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.chip, .slot.filled { font: 700 14px var(--ui); }
.chip {
  padding: 8px 16px; border-radius: 999px; cursor: grab; user-select: none; -webkit-user-select: none;
  touch-action: none; box-shadow: 0 3px 0 rgba(78, 46, 21, .25);
}
.chip.chosen { outline: 3px solid var(--ink); outline-offset: 2px; }
.chip-role { background: var(--mint); color: var(--mint-ink); }
.chip-task { background: #ffe6a6; color: #7a5410; }
.chip-context { background: var(--teal); color: var(--teal-ink); }
.chip-format { background: #f3d6f0; color: #7a2d72; }
.pieces { display: flex; flex-direction: column; gap: 8px; }
.piece { display: flex; gap: 10px; align-items: center; background: #fff; border: 2px dashed #dcc8a8; border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.piece.drop-over { border-color: var(--honey-dark); background: #fff6dc; }
.piece.right { border-style: solid; border-color: #6cc497; background: #f1faf5; }
.piece.wrong { border-style: solid; border-color: #e39a84; background: #fdf0ec; }
.slot { flex: none; min-width: 94px; text-align: center; padding: 5px 8px; border-radius: 999px; background: #efe6d6; color: var(--grey-ink); font: 700 13px var(--ui); }
.tk-step + .tk-step { margin-top: 16px; padding-top: 14px; border-top: 2px dashed var(--line); }
.tk-step[hidden] + .tk-step { margin-top: 0; padding-top: 0; border-top: 0; } /* шаг 2 своим экраном — без черты сверху */
.tk-step-done { opacity: .72; pointer-events: none; }
.opt {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; margin-bottom: 8px;
  background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; font: 15px/1.45 var(--text); color: var(--ink);
}
.opt:hover:not(:disabled) { border-color: var(--honey); }
.opt.chosen { border-color: var(--honey-dark); background: #fff6dc; }
.opt.right { border-color: #6cc497; background: #f1faf5; }
.opt.wrong { border-color: #e39a84; background: #fdf0ec; }
.opt-mark { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); font: 800 14px var(--ui); }
.opt-text { flex: 1; }
.opt-missing { display: block; margin-top: 6px; color: var(--red-ink); font-size: 13px; }
.opt-missing > span { display: block; }
.opt-body { flex: 1; }
.locked { pointer-events: none; }

/* Стартовый экран сортировки помещается без прокрутки (просьба Оли 05.10.2026): пустые колонки
 * невысокие и растут по мере того, как в них кладут карточки; отступы ужаты, шрифт карточек тот же. */
.sort-pile {
  display: flex; flex-wrap: wrap; gap: 6px; min-height: 56px; padding: 8px;
  border: 2px dashed #dcc8a8; border-radius: 14px; background: #fffaf0;
}
.sort-pile.empty::after { content: "Все карточки разложены"; color: var(--grey-ink); font-size: 14px; margin: auto; }
.sort-pile .sort-card { flex: 1 1 calc(50% - 6px); margin: 0; }
.sort-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.sort-col { border-radius: 14px; padding: 6px 8px 8px; min-height: 76px; cursor: pointer; }
.sort-col.drop-over { outline: 3px solid var(--honey-dark); }
.sort-yes { background: #e3f5ea; border: 2px solid #9fd3b4; }
.sort-no { background: #fbe4dd; border: 2px solid #eaa792; }
.sort-title { font: 800 14px var(--ui); text-align: center; margin-bottom: 4px; }
.sort-yes .sort-title { color: var(--mint-ink); }
.sort-no .sort-title { color: var(--red-ink); }
.sort-card {
  background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: 5px 10px; margin: 0 0 6px;
  font-size: 14px; line-height: 1.32; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
}
.sort-card.chosen { outline: 3px solid var(--ink); outline-offset: 1px; }
.sort-card.right { border-color: #6cc497; }
.sort-card.wrong { border-color: #e39a84; background: #fff6f3; }
.sort-why { margin-top: 5px; font-size: 13px; color: var(--red-ink); }
.sort-card.right .sort-why { color: var(--mint-ink); }
@media (max-width: 480px) { .sort-pile .sort-card { flex-basis: 100%; } }

.tk-statement ul { padding-left: 1.3em; }
.xl-wrap { overflow-x: auto; margin-top: 10px; }
.xl { border-collapse: collapse; background: #fff; font: 14px/1.3 var(--ui); }
.xl th { background: #eef0f2; color: #555; font-weight: 600; border: 1px solid #cfd4da; padding: 4px 8px; }
.xl td { border: 1px solid #d6dbe0; padding: 6px 10px; min-width: 88px; vertical-align: top; }
.xl .xl-corner { width: 30px; }
.xl-head { font-weight: 700; background: #f7f7f7; }
.xl-num { text-align: right; font-variant-numeric: tabular-nums; }
.xl-target { background: #fffbe8; min-width: 130px; }
.xl-ok { background: #e3f5ea; }
.xl-bad { background: #fbe4dd; }
.xl-got { display: block; }
.xl-exp { display: block; font-size: 12px; color: var(--red-ink); }

/* Табличка как в Excel (урок 3): строка формул, своя прокрутка с липкими буквами столбцов
 * и номерами строк, листы — вкладками снизу. Окно точки при этом не едет. */
.tk-sheet .tk-intro p { margin: 0 0 6px; }
.tk-sheet .tk-intro .tk-small { font-size: 13px; color: var(--ink-soft); }
/* «Молния» под условием (Оля 20.10.2026): где нейросети ошибаются на этой задаче — по замеру
 * промптов Мастера в шести моделях. Студента не мучаем тем, что известно заранее. */
.tk-sheet .tk-intro .tk-warn {
  display: flex; align-items: center; gap: 10px; margin: 8px 0 6px; padding: 8px 12px;
  background: #fff6d8; border: 1px solid #f0d58a; border-radius: 10px; font-size: 14px; line-height: 1.4;
}
.tk-warn a { color: #8a4b12; font-weight: 600; }
.tk-warn::before {
  content: ''; flex: none; width: 30px; height: 30px;
  background: url('../assets/common/warning.webp') center / contain no-repeat;
}
.tk-step-intro { margin: 4px 0 8px; font-weight: 700; color: #5a3419; }
.xls { margin: 8px 0 10px; border: 2px solid #cfd4da; border-radius: 12px; overflow: hidden; background: #fff; }
.xls-bar { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: #f6f7f8; border-bottom: 1px solid #d6dbe0; font: 13px/1.3 var(--ui); }
.xls-name { flex: none; min-width: 52px; padding: 3px 8px; border: 1px solid #cfd4da; border-radius: 6px; background: #fff; font-weight: 700; text-align: center; }
.xls-fx { flex: none; font: italic 700 13px Georgia, serif; color: #8a8f96; }
.xls-value {
  flex: 1; min-width: 0; padding: 3px 8px; border: 1px solid #cfd4da; border-radius: 6px; background: #fff;
  font-family: Consolas, "Courier New", monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em;
}
.xls-download { flex: none; text-decoration: none; }
.xls-scroll { max-height: min(46vh, 380px); overflow: auto; overscroll-behavior: contain; }
.xls-loading { margin: 0; padding: 18px; color: var(--ink-soft); }
.xls-grid { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.xls-grid th, .xls-grid td { border-width: 0 1px 1px 0; }
.xls-grid thead th { position: sticky; top: 0; z-index: 2; }
.xls-grid tbody th { position: sticky; left: 0; z-index: 1; min-width: 34px; text-align: center; }
.xls-grid thead .xl-corner { left: 0; z-index: 3; }
.xls-grid td { padding: 4px 8px; min-width: 0; white-space: nowrap; vertical-align: middle; cursor: cell; }
.xls-grid td.xls-sel { outline: 2px solid #217346; outline-offset: -2px; }
.xls-grid .xl-target { min-width: 120px; box-shadow: inset 0 0 0 1px #e9c96b; }
.xls-grid .xl-target.xl-ok { background: #e3f5ea; box-shadow: none; }
.xls-grid .xl-target.xl-bad { background: #fbe4dd; box-shadow: none; }
.xls-grid .xl-formula { background: #fff4d6; }
.xls-grid .xls-spill { white-space: nowrap; overflow: visible; max-width: 0; }
.xls-grid .xls-spill-wrap { white-space: normal; } /* книги урока 4: перенос внутри таблицы */
.xls-grid .xl-got.xl-num { text-align: right; }
.xl-row-head td { font-weight: 700; background: #f7f3ea; }
.xl-row-title td { font-weight: 700; font-size: 14px; }
.xl-row-muted td { color: var(--ink-soft); font-style: italic; }
.xl-row-total td, .xl-row-saldo td { font-weight: 700; background: #faf6ee; }
.xls-tabs { display: flex; gap: 2px; padding: 0 6px; background: #f6f7f8; border-top: 1px solid #d6dbe0; overflow-x: auto; }
.xls-tab {
  border: 0; border-bottom: 3px solid transparent; background: none; padding: 6px 14px; font: 600 13px var(--ui);
  color: var(--ink-soft); white-space: nowrap;
}
.xls-tab.on { color: #1e5c39; border-bottom-color: #217346; background: #fff; }
.xls-summary { padding: 6px 10px; font: 700 13px/1.35 var(--ui); border-bottom: 1px solid #d6dbe0; }
.xls-summary.ok { background: #e3f5ea; color: #1f5a3c; }
.xls-summary.bad { background: #fbe9e3; color: #7a2e1c; }
/* Точка 6, шаг 1: строки кликаются целиком */
.xls-picking tbody tr:not(:first-child) { cursor: pointer; }
.xls-picking tbody tr:not(:first-child):hover td { background: #fff8e1; }
.xls-grid tr.xl-picked td, .xls-grid tr.xl-picked th { background: #ffe9a8; }
.xls-grid tr.xl-pick-right td, .xls-grid tr.xl-pick-right th { background: #d5f0df; }
.xls-grid tr.xl-pick-wrong td, .xls-grid tr.xl-pick-wrong th { background: #f8d6cb; }
.tk-sheet-fields .tk-answer { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 4px 14px; align-items: start; }
.tk-sheet-fields .tk-field { margin: 0; }
.tk-sheet.locked .xls-tabs { pointer-events: auto; }
.mp-reveal { margin-bottom: 10px; }
.mp-reveal p { margin: 0 0 6px; }
@media (max-width: 760px) {
  .tk-sheet-fields .tk-answer { display: block; }
  .xls-scroll { max-height: 52vh; }
  .xls-download { padding-inline: 10px; }
}

/* Книга после запуска макроса (урок 4): превью книги, поля «Мой промпт» и «Код макроса»,
 * загрузка книги, после проверки — осмотр кода. Поле кода — как в редакторе: моноширинный
 * шрифт, номера строк, без переноса длинных строк (своя прокрутка). */
.tk-macro-fields .tk-field { margin-top: 10px; }
.tk-desktop-note { display: none; margin: 4px 0 0; padding: 6px 10px; border-radius: 10px; background: #eef3f6; font-size: 14px; }
@media (pointer: coarse), (max-width: 760px) { .tk-desktop-note { display: block; } }
/* max-height — как у самого поля кода: без него высоту задавал столбец номеров строк, и длинный код
 * растягивал окно на тысячи пикселей пустым полем (прохождение крыши 06.11.2026, скрипт на 350 строк) */
.code-edit {
  display: flex; border: 2px solid #dcc8a8; border-radius: 12px; background: #fffdf8; overflow: hidden;
  font: 13px/1.5 Consolas, "Courier New", monospace; max-height: 46vh;
}
.code-edit:focus-within { border-color: var(--honey-dark); box-shadow: 0 0 0 3px rgba(242, 193, 78, .35); }
.code-gutter {
  flex: none; margin: 0; padding: 10px 6px 10px 10px; min-width: 38px; text-align: right; color: #a89880;
  background: #f6efe2; border-right: 1px solid #e6d8bf; overflow: hidden; user-select: none; font: inherit;
}
.tk-input.tk-code {
  flex: 1; min-width: 0; border: 0; border-radius: 0; box-shadow: none; padding: 10px 12px; min-height: 9em; max-height: 46vh;
  font: inherit; white-space: pre; overflow: auto; tab-size: 4; background: transparent;
}
.tk-input.tk-code:focus { box-shadow: none; }
.tk-code-warn { margin: 6px 0 0; padding: 8px 12px; border-radius: 10px; background: #fdf1d8; border: 1px solid #efcf86; color: #7a5410; font-size: 14px; }
.upload { border: 2px dashed #c9b28d; border-radius: 14px; background: #fffaf0; padding: 10px 12px; }
.upload.drop-over { border-color: #217346; background: #eef8f1; }
.upload.locked { opacity: .75; }
.upload-input { display: none; }
.upload-empty, .upload-chosen { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-empty[hidden], .upload-chosen[hidden] { display: none; }
.upload-icon { flex: none; width: 34px; height: 34px; }
.upload-icon svg { width: 100%; height: 100%; display: block; }
.upload-text { font-size: 15px; }
.upload-name { font: 700 15px var(--ui); color: #1e5c39; word-break: break-all; }
.upload-note { margin: 6px 0 0; font-size: 13px; color: var(--ink-soft); }
.mr-after:empty { display: none; }
/* Сверка промпта с Мастером (урок 4, по желанию): цвета подсказок — это тоже голос Мастера */
.precheck-wrap { margin-top: 8px; }
.pc-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pc-note { font-size: 13px; color: var(--ink-soft); }
/* Зазоры над кнопкой и под ней на глаз одинаковые — по 14px (Оля 27.10.2026). Над кнопкой 8px отступа
 * и еще 6px дает строка под полем промпта; под кнопкой 3px занимает ее тень (0 3px 0): 14 + 3 = 17 */
.precheck { margin-top: 17px; background: #eef7f9; border: 2px solid #c6e3e9; border-radius: 14px; padding: 10px 14px; font-size: 14px; line-height: 1.45; }
.precheck[hidden] { display: none; }
.pc-title { margin: 0; font: 800 14px var(--ui); color: var(--teal-ink); }
.pc-have, .pc-lead, .pc-tail { margin: 6px 0 0; }
.pc-list { list-style: none; margin: 4px 0 0; padding: 0; }
.pc-list li { position: relative; padding: 3px 0 3px 20px; }
.pc-list li::before { content: ''; position: absolute; left: 2px; top: .62em; width: 10px; height: 10px; border-radius: 50%; background: var(--honey-dark); }
/* «Дело не в вас»: тем же шрифтом, что вся плашка (Оля 27.10.2026), отличается полосой слева */
.pc-tail { margin-top: 10px; padding: 2px 0 2px 10px; border-left: 3px solid #7fbcc7; }
.code-check { margin-top: 12px; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.cc-title { margin: 0; font: 800 14px var(--ui); color: #5a3419; }
.cc-lead { margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); }
.cc-list { list-style: none; margin: 8px 0 0; padding: 0; }
.cc-item { position: relative; padding: 4px 0 4px 20px; font-size: 14px; line-height: 1.4; }
.cc-item::before { content: ''; position: absolute; left: 2px; top: .62em; width: 10px; height: 10px; border-radius: 50%; }
.cc-red::before { background: #d4583a; }
.cc-yellow::before { background: #e8b52f; }
.cc-grey::before { background: #9a9a9a; }
.cc-ok::before { background: #4fae78; }
/* Таблица после запуска скрипта (урок 5, тип задачи sheet-run): шаги, готовый скрипт или промпт,
 * блок «Как подключить ключ» со скринами, выбор строки экрана разрешений */
.sr-do { margin-top: 12px; padding: 12px 14px 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
.sr-do-title { margin: 0 0 6px; font: 800 15px var(--ui); color: #5a3419; }
.sr-steps { margin: 0; padding-left: 24px; font-size: 15px; line-height: 1.45; }
/* Шаги разделены заметным отступом (Оля 10.11.2026: так легче читать; раньше просвет был только у шага со снимком) */
.sr-steps li { margin: 0 0 12px; }
.sr-steps li:last-child { margin-bottom: 0; }
/* Список прямо в шаге (Оля 12.11.2026, точка 4: части промпта — в шаге 2, а не во вкладке под полем) */
.sr-steps .sr-step-list { display: block; margin: 6px 0 0; padding-left: 20px; list-style: disc; }
.sr-steps .sr-step-list li { margin: 4px 0; }
/* Обычная ссылка в шаге (совет из бывшей молнии точки 3 — «Связанные приложения») — в цвет игры, как была в молнии */
.sr-steps a:not(.sr-inline-link) { color: #8a4b12; font-weight: 600; }
/* Молния под своим шагом (Оля 10.11.2026, точка 2: совет про Алису — отдельная мысль, а не продолжение шага).
 * Вид как у молнии под условием, только внутри блока шагов */
.sr-steps .sr-step-warn {
  display: flex; align-items: center; gap: 10px; margin: 8px 0 0; padding: 8px 12px;
  background: #fff6d8; border: 1px solid #f0d58a; border-radius: 10px; font-size: 14px; line-height: 1.4;
}
/* Поле прямо под своим шагом (Оля 11.11.2026): промпт, сверка, код, выбор строки, таблица — там, где о них сказано */
.sr-step-fields { margin-top: 8px; }
.sr-step-fields > .tk-field { display: block; margin-top: 8px; }
.sr-step-fields > :first-child { margin-top: 0; }
.sr-step-fields .sr-choice { margin-top: 8px; }
/* Действия прямо в тексте шагов (урок 5, точка 1, Оля 10.11.2026): ссылка на таблицу, «Скопировать скрипт» и имя
 * ключа — медовые плашки внутри строки, видно, что на них нажимают. Имя ключа — моноширинным, со значком копирования */
.sr-inline-link {
  display: inline; padding: 1px 7px; border: 1px solid #e3b95e; border-radius: 7px; background: #ffe9b0;
  font: inherit; font-weight: 800; color: #5a3419; text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 0 #d9a748;
}
a.sr-inline-link::after { content: ' ↗'; font-weight: 700; }
.sr-inline-link:hover { background: #ffdf8f; }
.sr-inline-link:focus-visible, .sr-chip:focus-visible { outline: 3px solid #1f6b78; outline-offset: 2px; }
.sr-chip {
  position: relative; display: inline-flex; align-items: center; gap: 5px; padding: 1px 7px; vertical-align: baseline;
  border: 1px solid #efcf86; border-radius: 7px; background: #fff4d6; color: #5a3419; cursor: copy;
}
.sr-chip code { font: 700 .95em Consolas, "Courier New", monospace; }
.sr-chip-icon { width: 14px; height: 14px; flex: none; }
.sr-chip:hover { background: #ffe9b0; }
.sr-chip.copied::after {
  content: attr(data-done); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  padding: 3px 8px; border-radius: 6px; background: #5a3419; color: #fff; font: 700 12px var(--ui); white-space: nowrap;
}
/* Шаг 1 со снимком «Копии документа» сбоку; в узком окне снимок уходит под текст */
.sr-step-row { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.sr-step-row .sr-step-text { flex: 1 1 300px; min-width: 0; }
.sr-step-shot { flex: 0 1 210px; display: block; cursor: zoom-in; }
.sr-step-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.sr-copyline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 2px; }
.sr-copyline code { padding: 4px 10px; border-radius: 8px; background: #fff4d6; border: 1px solid #efcf86; font: 700 15px Consolas, "Courier New", monospace; color: #5a3419; user-select: all; }
.sr-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.sr-copyshot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex-basis: 100%; margin: 4px 0 0; }
.sr-copyshot a { display: block; flex: 0 1 260px; min-width: 0; cursor: zoom-in; }
.sr-copyshot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.sr-copyshot figcaption { flex: 1 1 220px; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.sr-table-wait { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; color: var(--ink-soft); }
.sr-given { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.sr-given-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sr-given .code-block, .sr-given-text { margin-top: 8px; max-height: 340px; overflow: auto; }
.sr-given .code-block[hidden], .sr-given-text[hidden] { display: none; }
.sr-guide { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.sr-guide > summary, .sr-parts > summary { cursor: pointer; font: 700 15px var(--ui); color: #5a3419; }
.sr-guide-steps { margin: 8px 0 0; padding-left: 24px; font-size: 14px; line-height: 1.45; }
.sr-guide-steps li { margin: 8px 0; }
.sr-guide-steps p { margin: 0; }
.sr-shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.sr-shots a { display: block; flex: 0 1 230px; min-width: 0; }
.sr-shots img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.sr-parts { margin-top: 8px; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.sr-parts ul { margin: 6px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.45; }
.sr-parts li { margin: 4px 0; }
.sr-mail { margin: 6px 0 0; padding: 8px 12px; border-radius: 10px; background: #eef7f9; border: 1px solid #c6e3e9; font-size: 14px; line-height: 1.45; }
.sr-mail[hidden] { display: none; }
.sr-choice { margin: 12px 0 0; padding: 10px 14px 12px; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
.sr-choice legend { padding: 0 6px; }
.sr-option { display: flex; align-items: flex-start; gap: 8px; padding: 5px 2px; font-size: 15px; cursor: pointer; }
.sr-option input { flex: none; margin-top: 4px; }
.sr-screen-wait { margin: 8px 0 0; padding: 8px 10px; border: 1px dashed #c9b28d; border-radius: 10px; font-size: 13px; color: var(--ink-soft); }
.sr-choice-body { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.sr-screen { display: block; flex: 0 1 300px; min-width: 0; cursor: zoom-in; }
.sr-screen img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.sr-options { flex: 1 1 240px; min-width: 0; }
.sr-ready { margin: 10px 0; padding: 10px 14px; border-radius: 12px; background: #eef8f1; border: 1px solid #bfe0cb; }
.sr-ready p { margin: 0 0 8px; }
/* Разбор решения крыши одной плашкой (Оля 09.11.2026): вердикт крупно, ниже разделы с заголовками
 * в подбор — промпт, код, как отработал скрипт */
.plate:has(> .sr-report) > p:first-child { font: 800 17px var(--ui); }
.sr-report { margin-top: 4px; }
.sr-sec { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(0, 0, 0, .1); }
.sr-sec p { margin: 0; line-height: 1.45; }
.sr-sec p + p { margin-top: 6px; }
.sr-sec .cc-list { margin-top: 6px; }
.sr-sec .quote { margin: 6px 0 2px; color: var(--ink); }
/* Секрет Мастера — бонусной плашкой под разбором, перед кнопкой «Дальше» */
.sr-secret { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; padding: 12px 14px; border: 2px solid #efcf86; border-radius: 14px; background: #fff8e6; }
.sr-secret[hidden] { display: none; }
.sr-secret-face { flex: none; width: 64px; height: auto; }
.sr-secret-body { min-width: 0; }
.sr-secret-title { margin: 0 0 4px; font: 800 15px var(--ui); color: var(--amber-ink); }
.sr-secret-body p { margin: 0 0 6px; line-height: 1.45; }
.sr-secret-body p:last-child { margin-bottom: 0; }
@media (max-width: 480px) { .sr-secret-face { width: 44px; } }
.mr-solution { margin-top: 6px; }
.mr-solution-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.code-block {
  margin: 0 0 8px; max-height: 40vh; overflow: auto; background: #fff; border: 1px solid #e6d8bf; border-radius: 10px;
  padding: 10px 12px; font: 12.5px/1.5 Consolas, "Courier New", monospace; white-space: pre; tab-size: 4;
}
.solution .tk-small { font-size: 13px; color: var(--ink-soft); }
/* Шестая плитка второго этажа (решение Оли 26.10.2026): бежевая плашка вместо белой, без отметки.
 * С 28.10.2026 — только в итогах и PDF, в ящике ее нет */
.fin-tool.fin-done { background: #f6ecd9; }
.pp-tile.pp-tile-done { background: #f6ecd9; justify-content: center; }
/* Шаблон промпта этажа из ящика (урок 4) — текст с «Скопировать» */
.tb-item { margin-top: 12px; }
.tb-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.tb-item-text { white-space: pre-wrap; max-height: 40vh; overflow: auto; }
/* Превью выгрузки 1С: заливка уровней, объединенные ячейки шапки, значки группировки */
.xls-grid tr.xl-fill-acc td { background: #f2e8d2; }
.xls-grid tr.xl-fill-cust td { background: #faf5ea; }
.xls-grid tr.xl-fill-head td { background: #f3e6cc; font-weight: 700; }
.xls-grid td.xl-merged { text-align: left; }
.xls-grid tr.xl-row-head td.xl-merged { text-align: center; vertical-align: middle; white-space: normal; }
.xl-outline { display: inline-block; width: 9px; height: 9px; margin-right: 4px; margin-left: calc(var(--lvl, 0) * 3px); vertical-align: -1px; }
.xl-outline-kids { border: 1px solid #8a8f96; border-radius: 2px; background: linear-gradient(#8a8f96, #8a8f96) center / 5px 1px no-repeat, #fff; }
/* Кнопки точки (урок 4): «Кнопка 1 · Кнопка 2 · Кнопка 3», следующая открывается после предыдущей */
.mr-strip { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0 2px; }
.mr-strip-dot { color: var(--ink-soft); }
.mr-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 999px; border: 2px solid var(--line); background: #fff; font: 700 14px var(--ui); color: var(--ink-soft); }
.mr-chip b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--paper-2); font-size: 12px; }
.mr-chip.on { border-color: var(--honey-dark); background: #fff6dc; color: var(--ink); }
.mr-chip.on b { background: var(--honey); }
.mr-chip.done { border-color: #8fcfa9; background: #e3f5ea; color: #1f5a3c; }
.mr-chip.done b { background: #6cc497; color: #fff; }
.mr-chip.locked { opacity: .55; }
.mr-stage-intro { margin-top: 10px; }
.mr-stage-intro p { margin: 0 0 6px; }
/* Чужой макрос (точка 2 урока 4): строки кода кнопками, отметка — стетоскоп на полях */
.cl-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.cl-code-box {
  max-height: min(52vh, 460px); overflow: auto; overscroll-behavior: contain; background: #fffdf8;
  border: 2px solid #dcc8a8; border-radius: 12px; padding: 4px 0;
}
.cl-line {
  display: flex; align-items: flex-start; gap: 0; width: 100%; text-align: left; border: 0; background: none;
  padding: 1px 10px 1px 0; font: 13px/1.55 Consolas, "Courier New", monospace; color: var(--ink); cursor: pointer;
}
.cl-line:hover { background: #fff3cf; }
.cl-line.on { background: #ffe9a8; }
.cl-line.cl-right { background: #d5f0df; }
.cl-line.cl-wrong { background: #f8d6cb; }
.cl-line.cl-neutral { background: #e8eef2; }
.cl-mark { flex: none; width: 26px; height: 20px; display: grid; place-items: center; }
.cl-mark img { width: 18px; height: 18px; object-fit: contain; image-rendering: pixelated; visibility: hidden; }
.cl-line.on .cl-mark img { visibility: visible; }
.cl-num { flex: none; width: 30px; padding-right: 10px; text-align: right; color: #a89880; user-select: none; }
.cl-code { flex: 1; min-width: 0; white-space: pre; font: inherit; }
.cl-why { margin: 2px 10px 6px 66px; padding: 6px 10px; border-radius: 8px; font: 14px/1.4 var(--text); }
.cl-why-danger { background: #e3f5ea; color: #1f5a3c; }
.cl-why-harmless, .cl-why-plain { background: #fbe9e3; color: #7a2e1c; }
.cl-why-neutral { background: #eef3f6; color: #3d5563; }
.tk-lines.locked .cl-line { cursor: default; }
.tk-lines.locked { pointer-events: auto; }
.tk-lines.locked .cl-line:not(.on):hover { background: none; }
@media (max-width: 480px) { .cl-why { margin-left: 30px; } }

/* Проверка и отзывы */
.check-row { margin-top: 10px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn-check { min-width: 180px; }
/* На телефоне «Проверить» и подсказка в строку не влезают — обе во всю ширину, одна под другой */
@media (max-width: 480px) { .check-row > .btn { flex: 1 1 100%; } }
.plate { margin-top: 12px; border-radius: 14px; padding: 11px 14px; border: 2px solid; }
.plate p { margin: 0; }
.plate-next { margin-top: 10px; }
.plate-ok { background: #e3f5ea; border-color: #8fcfa9; color: #1f5a3c; }
.plate-bad { background: #fbe9e3; border-color: #eaa792; color: #7a2e1c; }
.plate-warn { background: #fdf1d8; border-color: #efcf86; color: #7a5410; }
.plate-info { background: #e6f3f6; border-color: #a9d6df; color: #1f5c68; }
.plaque { border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.plaque-teal { background: var(--teal); color: var(--teal-ink); }
.fail-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.hints { margin-top: 12px; background: #eef7f9; border: 2px solid #c6e3e9; border-radius: 14px; padding: 10px 14px; }
.hints-title { font: 800 14px var(--ui); color: var(--teal-ink); }
.hints ol { margin: 6px 0 0; padding-left: 1.3em; }
.hints li { margin-bottom: 4px; }
.solution { margin-top: 12px; background: #fff8e6; border: 2px solid #efcf86; border-radius: 14px; padding: 12px 14px; }
.solution-title { font: 800 14px var(--ui); color: var(--amber-ink); margin-bottom: 4px; }
.solution p { margin: 0 0 8px; }
.solution ol { margin: 0 0 8px; padding-left: 1.3em; }
.quote { margin: 6px 0 8px; background: #fff; border-left: 4px solid var(--honey); padding: 8px 12px; border-radius: 8px; }
.formula { font-family: Consolas, "Courier New", monospace; background: #fff; padding: 8px 12px; border-radius: 8px; word-break: break-all; }
.master-prompt { margin-top: 10px; }
.mp-title { margin: 0; font-weight: 700; }
/* Промпт Мастера урока 4 — по абзацам: кто я, как устроена книга, что сделать, чего не делать
 * (Оля 27.10.2026: длинный промпт сплошным текстом не читается) */
.quote-lines { white-space: pre-line; }
.master-prompt .quote { margin-top: 12px; } /* воздух между подписью и промптом (просьба Оли 05.10.2026) */
/* Разбор последней задачи — своим экраном */
.pw-review { max-width: 780px; margin: 0 auto; background: #fffdf8; border: 2px solid var(--line); border-radius: 20px; padding: 16px 20px 18px; }
.pw-review .plate { margin-top: 8px; }
.pw-review .master-prompt { margin-top: 18px; color: #5a3419; }
.pw-review .quote { background: #fbf3e2; }
.review-back { margin-top: 10px; }
.done-actions {
  margin-top: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: #f5efe3; border-radius: 14px; padding: 12px 14px;
}
.done-note { margin: 0; font-weight: 600; }

/* Перетаскивание */
.drag-ghost { position: fixed; z-index: 100; pointer-events: none; opacity: .94; transform: rotate(-2deg); box-shadow: 0 10px 24px rgba(0, 0, 0, .25); margin: 0; }
.dragging { opacity: .35; }

/* Инструмент летит в ящик */
.fly-tool {
  position: fixed; z-index: 90; object-fit: contain; pointer-events: none;
  filter: drop-shadow(3px 6px 6px rgba(59, 42, 30, .45));
  transition: transform .85s cubic-bezier(.45, -0.25, .6, 1), opacity .85s ease-in;
}
.fly-tool.grey { filter: grayscale(1) drop-shadow(3px 6px 6px rgba(59, 42, 30, .45)); }

/* ───────── Ящик ───────── */
.ov-box .ov-panel { width: min(900px, 96vw); padding: 18px 22px 22px; }
.tb-head { display: flex; gap: 14px; align-items: center; }
.tb-head > div { flex: 1; }
.tb-head h2 { margin: 0; font: 800 24px var(--text); color: #5a3419; }
.tb-head p { margin: 2px 0 0; color: var(--ink-soft); font-weight: 600; }
.tb-box { width: 110px; filter: drop-shadow(3px 4px 6px rgba(90, 52, 25, .35)); }
.tb-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
/* Второй этаж, 5 плиток на узком экране: 3 + 2 по центру, без дырки справа */
.tb-grid[data-n="5"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tb-grid[data-n="5"] > * { grid-column: span 2; }
.tb-grid[data-n="5"] > :nth-child(4) { grid-column: 2 / span 2; }
.tb-grid[data-n="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } /* крыша на узком экране: 2 + 2 */
@media (min-width: 880px) {
  .tb-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
  .tb-grid[data-n="8"] { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* первый этаж: 2 ряда по 4 */
  .tb-grid[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* крыша: 4 плитки в ряд */
  /* второй этаж: 5 плиток в ряд, шире, чем в шесть колонок (Оля 28.10.2026) */
  .tb-grid[data-n="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .tb-grid[data-n="5"] > *, .tb-grid[data-n="5"] > :nth-child(4) { grid-column: auto; }
}
/* Вкладки-ящички уровней (16.10.2026): «Двор 6/6 · Первый этаж 3/8» */
.tb-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.tb-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 12px 12px 4px 4px;
  border: 2px solid #eadbc2; background: #faf5ec; color: var(--ink-soft); font: 700 14px var(--ui);
}
.tb-tab b { font: 800 12px var(--ui); padding: 1px 7px; border-radius: 999px; background: #f1e6d2; color: #5a3419; }
.tb-tab.on { background: var(--honey-light); border-color: var(--honey-dark); color: #4a2f18; }
.tb-tab.on b { background: #fff3cf; }
.tb-tabs + .tb-grid { margin-top: 10px; }
@media (max-width: 480px) { .tb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Плитка — колонка: название всегда на две строки, поэтому «Точка N» у всех начинается на одном
 * уровне, а отметка прижата к низу плитки (Оля 16.10.2026: строки скакали) */
.tb-tile {
  background: #fff; border: 2px solid #eadbc2; border-radius: 16px; padding: 10px; text-align: center;
  display: flex; flex-direction: column; align-items: center;
}
.tb-tile.mark-self { border-color: #9fd3b4; }
.tb-tile.mark-master { border-color: #a9d6df; }
.tb-empty { border-style: dashed; background: #faf5ec; }
.tb-img { width: 80px; height: 80px; object-fit: contain; filter: drop-shadow(3px 4px 6px rgba(90, 52, 25, .35)); }
.grey { filter: grayscale(1) opacity(.8); }
.tb-img.grey { filter: grayscale(1) opacity(.8) drop-shadow(3px 4px 6px rgba(90, 52, 25, .25)); }
.silhouette, .tb-img.silhouette { filter: brightness(0) opacity(.16); }
.tb-name { font-weight: 800; margin-top: 4px; line-height: 1.25; min-height: 2.5em; }
/* margin-bottom — зазор до отметки у плитки с самой длинной подписью */
.tb-point { font-size: 12px; color: var(--grey-ink); line-height: 1.3; margin: 2px 0 8px; }
.tb-point span { display: block; } /* строки подписи из level.boxLines */
/* Ряд отметки прижат к низу плитки и высотой в две строки: «Нашли с Мастером» в узкой плитке
 * переносится, поэтому отметки выровнены по верху — начинаются у всех на одном уровне */
.tb-mark-row { margin-top: auto; min-height: 37px; display: flex; align-items: flex-start; justify-content: center; }
.tb-mark { display: inline-block; font: 700 12px/1.25 var(--ui); padding: 3px 9px; border-radius: 999px; background: var(--grey); color: var(--grey-ink); }
/* Легенда отметок — три коричневые плашки цвета плашки урока в PDF (--pp-wood-2) */
.tb-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0 0; }
.tb-legend p {
  margin: 0; padding: 7px 14px; border-radius: 999px; background: #a86a3d; color: #fff;
  font: 500 13px/1.3 var(--ui); text-align: center;
}
.tb-legend b { display: block; font-weight: 800; }
@media (max-width: 600px) { .tb-legend { grid-template-columns: 1fr; } }
.tb-bonuses { display: grid; gap: 8px; margin-top: 12px; }
.tb-bonus { text-align: left; border: 2px solid #efcf86; background: #fff8e6; border-radius: 14px; padding: 10px 14px; font-weight: 700; color: var(--amber-ink); }
.tb-bonus-note { font-weight: 400; color: var(--ink); }
.tb-actions { margin-top: 16px; display: flex; justify-content: center; }

/* ───────── Меню, диалоги, финал, секрет ───────── */
.ov-menu .ov-panel, .ov-dialog .ov-panel { width: min(540px, 94vw); padding: 18px 20px 20px; }
.menu-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.menu-head > h2, .menu-head > div { flex: 1; }
.menu-head h2 { margin: 0; font: 800 22px var(--text); color: #5a3419; }
.menu-head p { margin: 2px 0 0; color: var(--ink-soft); }
.menu-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid #eadbc2; font-weight: 600; }
.menu-row input[type=range] { width: 50%; accent-color: var(--honey-dark); }
.switch { border: 2px solid #8fcfa9; background: var(--mint); color: var(--mint-ink); border-radius: 999px; padding: 5px 14px; font: 700 14px var(--ui); }
.switch.off { border-color: var(--line); background: var(--grey); color: var(--grey-ink); }
.menu-list { margin: 14px 0 10px; }
.menu-item { display: block; width: 100%; text-align: left; background: #fff; border: 2px solid #eadbc2; border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; }
.menu-item:hover { border-color: var(--honey); }
.menu-item b { display: block; }
.menu-item span { font-size: 13px; color: var(--ink-soft); }
.podcast-master { width: 64px; flex: none !important; }
/* «Как играть»: окно шире меню, на широком экране — две колонки. Каждый абзац — на белой
 * плашке, как пункты меню, из которого окно открывается (Оля 21.10.2026) */
.ov-help .ov-panel { width: min(920px, 96vw); padding: 18px 24px 20px; }
.help-list { columns: 2 340px; column-gap: 12px; margin-top: 4px; }
.help-list p {
  margin: 0 0 10px; padding: 10px 14px; break-inside: avoid; font-size: 15px; line-height: 1.45;
  background: #fff; border: 2px solid #eadbc2; border-radius: 14px;
}
.help-list b { color: #5a3419; }
/* Невысокое окно урока: плашки плотнее, чтобы все поместилось без прокрутки */
@media (max-height: 620px) {
  .ov-help .ov-panel { padding: 10px 18px 12px; }
  .ov-help .menu-head { margin-bottom: 4px; }
  .help-list p { padding: 6px 12px; margin-bottom: 7px; font-size: 13.5px; line-height: 1.38; }
}
.dlg h3 { margin: 0 0 8px; font: 800 20px var(--text); color: #5a3419; }
.dlg p { margin: 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

.ov-finale .ov-panel { width: min(780px, 94vw); padding: 26px 26px 30px; text-align: center; }
.finale h2 { margin: 0; font: 800 30px var(--text); color: #5a3419; }
.finale-text { margin: 8px auto 0; max-width: 560px; color: var(--ink-soft); }
/* Итоги — как плашка «Что заберете из урока» (Оля 21.10.2026): счет коричневой плашкой,
 * инструменты на белых карточках без обводки, ниже — бонус и кнопки той же ширины, что сетка */
.finale-score {
  display: inline-block; margin: 16px 0 0; padding: 7px 18px; border-radius: 999px; background: #a86a3d; color: #fff;
  font: 700 13px/1.2 var(--ui); letter-spacing: .08em; text-transform: uppercase;
}
/* Колонка итогов: инструменты, бонус и кнопка PDF одной ширины */
.fin-body { display: flex; flex-direction: column; width: min(564px, 100%); margin: 12px auto 0; }
.fin-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.fin-tools[data-n="8"] { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* 8 — два ряда по 4 */
.fin-tools[data-n="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); } /* крыша: 4 в ряд, без дырки */
.fin-tool {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 12px;
  background: #fff; border-radius: 16px; box-shadow: 0 3px 10px rgba(78, 46, 21, .08); font: 700 13px/1.25 var(--ui);
}
.fin-tool img { width: 66px; height: 66px; object-fit: contain; filter: drop-shadow(3px 4px 6px rgba(90, 52, 25, .35)); }
.fin-tool img.grey { filter: grayscale(1) opacity(.8); }
.fin-bonus { display: block; margin: 12px 0 0; text-align: center; font-size: 14px; }
button.fin-bonus { cursor: pointer; }
button.fin-bonus:hover { border-color: var(--honey-dark); }
/* Кнопка PDF — во всю ширину колонки и с отступом: отделяет «что забрали» от действия */
.fin-pdf { margin-top: 26px; }
@media (max-width: 560px) {
  .fin-tools[data-n="8"] { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .fin-tool { padding: 8px 2px 10px; font-size: 11px; }
  .fin-tool img { width: 48px; height: 48px; }
}
.ov-x { position: absolute; top: 12px; right: 12px; }

.ov-secret .ov-panel { width: min(1040px, 96vw); padding: 16px; }
.secret-lead { margin: 0 0 10px; text-align: center; font: 700 17px var(--text); color: var(--amber-ink); }
.secret-actions { display: flex; justify-content: center; margin-top: 12px; }

/* ───────── Ролики ───────── */
/* Ширина — и от высоты окна: в низком окне (урок в iframe, 960×540) ролик 16:9 во всю ширину
 * выходил выше экрана, и панель с «Пропустить» и скоростью обрезалась (прохождение 28.10.2026).
 * 112px — заголовок, панель кнопок и рамка */
.ov-video .ov-panel {
  width: min(1000px, 96vw, calc((94vh - 112px) * 16 / 9)); width: min(1000px, 96vw, calc((94dvh - 112px) * 16 / 9));
  background: #2b2118; color: #fbe7c4; border-color: var(--wood-dark); overflow: hidden;
}
.vd-head { padding: 10px 16px; font: 700 16px var(--ui); }
.vd-stage { position: relative; aspect-ratio: 16 / 9; background: #120c07; overflow: hidden; }
.vd-screen { position: absolute; inset: 0; }
.vd-video, .vd-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vd-placeholder.vd-playing .vd-poster { animation: kenburns 24s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.08) translate(-1%, -1%); } }
.vd-soon { position: absolute; left: 12px; bottom: 12px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; padding: 5px 10px; border-radius: 10px; }
.vd-start {
  position: absolute; inset: 0; margin: auto; width: fit-content; height: fit-content;
  display: flex; align-items: center; gap: 10px; border: 0; border-radius: 999px; padding: 14px 28px;
  background: linear-gradient(#ffdb7e, var(--honey)); color: #4a2f18; font: 800 20px var(--text);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.6), 0 5px 0 var(--honey-dark), 0 12px 30px rgba(0,0,0,.4);
}
.vd-start-icon { font-size: 22px; }
.vd-foot { display: flex; gap: 10px; align-items: center; padding: 10px 14px; }
.vd-progress { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.vd-progress i { display: block; width: 0; height: 100%; background: var(--honey); transition: width .25s linear; }
.ov-video .btn-ghost { background: transparent; color: #fbe7c4; box-shadow: inset 0 0 0 2px rgba(251, 231, 196, .4); }
.vd-loading {
  position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; background: rgba(18, 12, 7, .55); color: #fbe7c4; font: 700 18px var(--ui); text-align: center; padding: 16px;
}
.vd-loading small { font: 500 13px var(--ui); opacity: .8; }
.vd-spinner {
  width: 44px; height: 44px; border-radius: 50%; border: 5px solid rgba(251, 231, 196, .25); border-top-color: var(--honey);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.vd-speeds { display: flex; gap: 5px; }
.ov-video .pl-speed { background: transparent; border-color: rgba(251, 231, 196, .35); color: #fbe7c4; }
.ov-video .pl-speed.on { background: var(--honey); border-color: var(--honey); color: #4a2f18; }
@media (max-width: 560px) { .vd-foot { flex-wrap: wrap; } .vd-progress { flex-basis: 100%; } }

/* ───────── Всплывающие плашки ───────── */
.toasts { position: fixed; top: calc(var(--hud) + 22px); left: 50%; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(560px, 92vw); pointer-events: none; }
/* Плашки — про карту и уровень. Пока открыто окно, они его не закрывают: подсказка «Стрелки ← →…»
 * висит 7 секунд, а до точки 1 добегают за три, и она ложилась на заголовок окна точки
 * (прохождение 28.10.2026) */
.has-overlay .toasts { visibility: hidden; }
.toast {
  pointer-events: auto; background: var(--paper); border: 3px solid var(--wood); border-radius: 16px; padding: 11px 16px;
  box-shadow: 0 5px 0 rgba(78, 46, 21, .4), 0 14px 30px rgba(0, 0, 0, .25); cursor: pointer;
  opacity: 0; transform: translateY(-14px); transition: opacity .25s, transform .25s;
}
.toast-shown { opacity: 1; transform: none; }
.toast-leaving { opacity: 0; transform: translateY(-10px); }
.toast-mushroom { padding-left: 64px; background: #fff8e6 url(../assets/common/mushroom.webp) 12px center / 42px auto no-repeat; }

/* ───────── PDF: печатный слой ───────── */
#print-root { display: none; }
@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body { height: auto; overflow: visible; background: #fff; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; }
}
/* Макет программы (Ресурсы/Игра/PDF) в альбомном A4. Тень пластилиновых картинок —
 * из скилла visual-builder (3px 4px 6px): коричневая на белом и бежевом, сине-зеленая
 * на голубой плашке. */
.pp-page {
  --pp-wood-2: #a86a3d;
  --pp-rim: 0 .8mm 0 #e6d6bd;
  --pp-shadow: drop-shadow(3px 4px 6px rgba(95, 55, 25, .55));
  --pp-shadow-teal: drop-shadow(3px 4px 6px rgba(20, 75, 95, .6));
  position: relative; width: 297mm; height: 210mm; overflow: hidden; background: var(--paper);
  padding: 15mm 15mm 0; break-after: page; page-break-after: always;
  font: 11.5pt/1.5 var(--text); color: var(--ink);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}
.pp-page:last-child { break-after: auto; page-break-after: auto; }
.pp-page::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 9mm;
  background: repeating-linear-gradient(90deg, var(--wood) 0 38mm, var(--pp-wood-2) 38mm 40mm);
}
.pp-content { height: 163mm; display: flex; flex-direction: column; }
.pp-badge {
  align-self: flex-start; font: 500 8.5pt var(--ui); letter-spacing: .1em; text-transform: uppercase;
  color: #fff; background: var(--pp-wood-2); border-radius: 99px; padding: 1.3mm 3.8mm;
}
.pp-foot {
  position: absolute; left: 15mm; right: 15mm; bottom: 8mm; display: flex; align-items: center;
  justify-content: space-between; gap: 8mm; padding-top: 3.5mm; border-top: .5mm solid var(--pp-wood-2); color: var(--wood);
}
/* Полный однострочный логотип школы (просьба Оли 30.09.2026), перекрашен в цвет текста
 * подвала --wood #7a4a2a (01.10.2026: отдельный темный коричневый выбивался из гаммы).
 * Высота подобрана так, чтобы строка логотипа была по центру двухстрочного названия справа. */
.pp-logo { display: block; height: 5.4mm; width: auto; }
.pp-program { text-align: right; line-height: 1.3; }
.pp-program b { display: block; font: 700 10.5pt var(--text); }
.pp-program span { font-size: 8.5pt; }
/* Номер листа «1/8» — ровно по центру подвала, независимо от ширины логотипа и названия */
.pp-num {
  position: absolute; left: 50%; top: 3.5mm; bottom: 0; transform: translateX(-50%);
  display: flex; align-items: center; font: 600 10.5pt var(--text);
}

.pp-chip { display: inline-block; font: 500 8.5pt var(--ui); font-style: normal; padding: .8mm 3mm; border-radius: 99px; background: var(--grey); color: var(--grey-ink); }

/* Стр. 1 — обзор */
.pp-cover { flex: 1; display: grid; grid-template-columns: 98mm 1fr; gap: 10mm; align-items: center; }
.pp-cover-left { display: flex; flex-direction: column; align-items: flex-start; }
.pp-cover h1 { margin: 4mm 0 2.5mm; font: 700 25pt/1.15 var(--text); color: var(--wood); }
.pp-sub { margin: 0; font-size: 11.5pt; }
.pp-sub span { display: block; }
.pp-box { display: block; width: 82mm; margin: 5mm 0 0; filter: var(--pp-shadow); }
.pp-score {
  display: inline-flex; align-items: baseline; gap: 2mm; margin-top: 3mm; padding: 1.5mm 4.5mm;
  background: #fff; border-radius: 4mm; box-shadow: var(--pp-rim); font-size: 11pt;
}
.pp-score b { font: 700 22pt var(--text); color: var(--wood); }
.pp-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5mm; }
.pp-tiles-4 { grid-template-columns: repeat(4, 1fr); gap: 4mm; }
.pp-tiles-2 { grid-template-columns: repeat(2, 1fr); gap: 5mm; } /* крыша: четыре инструмента — 2 + 2, без дырки */
.pp-tile {
  background: #fff; border-radius: 4.5mm; box-shadow: var(--pp-rim); padding: 4mm 3mm;
  text-align: center; display: flex; flex-direction: column; align-items: center;
}
.pp-tile img { width: 30mm; height: 30mm; object-fit: contain; filter: var(--pp-shadow); }
.pp-tile img.grey { filter: grayscale(1) opacity(.55) var(--pp-shadow); }
.pp-tile img.silhouette { filter: brightness(0) opacity(.12); }
.pp-tile b { font: 700 12pt/1.25 var(--text); margin-top: 1.5mm; }
.pp-tile span { flex: 1; margin: .8mm 0 2.5mm; font-size: 9pt; line-height: 1.35; color: #6d5b4c; }
.pp-tile span span { display: block; margin: 0; } /* строки подписи (pdf.tileLines) */
.pp-tile-empty { background: var(--grey); box-shadow: none; outline: .5mm dashed #cfc5b6; outline-offset: -1.6mm; }
.pp-tile-empty .pp-chip { background: #fff; }

/* Инструкция по применению — одна на инструмент */
.pp-card { flex: 1; margin-top: 5mm; background: #fff; border-radius: 5mm; box-shadow: var(--pp-rim); padding: 9mm 11mm; }
.pp-passport { display: grid; grid-template-columns: 66mm 1fr; gap: 11mm; align-items: center; }
.pp-pass-head img { display: block; width: 50mm; height: 50mm; object-fit: contain; margin-bottom: 4mm; filter: var(--pp-shadow); }
.pp-pass-head img.grey { filter: grayscale(1) opacity(.55) var(--pp-shadow); }
/* balance — длинное название точки делится на две равные строки, а не «все, кроме хвоста» */
.pp-kicker { font: 600 9.5pt var(--text); color: var(--pp-wood-2); text-wrap: balance; }
.pp-pass-head h2 { margin: 1mm 0 2mm; font: 700 24pt/1.1 var(--text); color: var(--wood); }
.pp-question { margin: 0 0 3mm; font-weight: 600; color: var(--ink-soft); }
/* --pp-fit — уменьшение шрифта карточки, если текст не влез в лист (fitCards в pdf.js) */
.pp-pass-body { font-size: calc(12pt * var(--pp-fit, 1)); line-height: 1.5; }
.pp-pass-body p { margin: 0 0 3mm; }
.pp-pass-body > :last-child { margin-bottom: 0; }
/* Заголовок блока — вопросом («Как проверить ответ нейросети»), один стиль на всех листах */
.pp-lead { font-weight: 700; color: var(--wood); font-size: 13pt; }
.pp-pass-body * + .pp-lead { margin-top: 5mm; }
/* Списки — коричневые точки, а не номера (01.10.2026): в памятках перечисляются факты и
 * правила, порядок не важен. Жирное начало пункта — подзаголовок в подбор, с точкой. */
.pp-rules { list-style: none; margin: 0 0 4mm; padding: 0; }
/* Правила листа — на бежевой плашке, как задача, промпт и формула на листе решения
 * (Оля 20.10.2026, оба урока). Списки внутри голубой плашки не трогаем. */
.pp-pass-body > .pp-rules { background: var(--paper); border-radius: 3mm; padding: 4mm 5mm 4mm 4.5mm; }
.pp-pass-body > .pp-rules li:last-child { margin-bottom: 0; }
.pp-rules li { position: relative; margin-bottom: 2.6mm; padding-left: 6mm; }
.pp-rules li::before {
  content: ""; position: absolute; left: .3mm; top: calc(.75em - 1.2mm);
  width: 2.4mm; height: 2.4mm; border-radius: 50%; background: var(--pp-wood-2);
}
.pp-plaque { background: var(--teal); border-radius: 4mm; padding: 3.5mm 5mm; margin: 0 0 3mm; }
.pp-plaque b, .pp-plaque-title { color: var(--teal-ink); }
.pp-plaque-title { font-weight: 700; margin: 0 0 1mm !important; }
.pp-plaque p { margin: 0; }
.pp-plaque .pp-rules { margin: 0; }
.pp-plaque .pp-rules li:last-child { margin-bottom: 0; }
.pp-plaque .pp-rules li::before { background: var(--teal-ink); }
.pp-table td.pp-mine { font-weight: 700; color: var(--wood); white-space: nowrap; }
.pp-table { border-collapse: collapse; width: 100%; font-size: 10.5pt; margin-bottom: 4mm; }
.pp-table th { color: var(--pp-wood-2); font-weight: 700; }
.pp-table th, .pp-table td { border-bottom: .3mm solid #eadbc2; padding: .7mm 2mm; line-height: 1.4; text-align: left; }
.pp-table .pp-mine-row td { background: var(--paper); }
/* Плашка под таблицей — тем же кеглем, что таблица: иначе лист точки 1 не помещается */
.pp-table + .pp-plaque { font-size: 10.5pt; }
.pp-table + .pp-plaque .pp-rules li { margin-bottom: 1.6mm; }
.pp-label { font-weight: 700; font-size: 10.5pt; color: var(--pp-wood-2); margin: 0 0 1.2mm !important; }
/* Промпт, формула и результат на листе решения — одинаковые бежевые блоки (01.10.2026) */
.pp-quote { background: var(--paper); border-radius: 3mm; padding: 3mm 4.5mm; }
.pp-formula { font: 700 11.5pt/1.5 Consolas, "Courier New", monospace; overflow-wrap: anywhere; /* переносы — после «;» */ }
/* Второй лист точки (урок 3 и дальше, 20.10.2026): заголовок и три бежевые плашки во всю
 * ширину — задача, промпт, формула, у каждой своя 3D-иконка. Номер и название точки —
 * в плашке над карточкой. Шрифт как на листе инструкции; ужимается, только если очень
 * длинный промпт студента не влез. */
.pp-solution { padding-top: 7mm; padding-bottom: 7mm; }
.pp-solution h2 { margin: 0 0 3mm; font: 700 18pt/1.1 var(--text); color: var(--wood); }
.pp-sol-body { display: flex; flex-direction: column; gap: 3.5mm; }
.pp-sol-label { display: flex; align-items: center; gap: 2.5mm; margin-bottom: 1.5mm; }
.pp-sol-icon { width: 9mm; height: 9mm; object-fit: contain; filter: var(--pp-shadow); }
.pp-sol-label .pp-lead { margin: 0; }
.pp-sol-block > p { margin: 0; }
.pp-sol-body .pp-quote { font-size: calc(11pt * var(--pp-fit, 1)); line-height: 1.45; padding: 2.6mm 4.5mm; }
.pp-sol-body .pp-formula { font-size: calc(10.5pt * var(--pp-fit, 1)); }
/* Урок 4 (Оля 29.10.2026): решение на двух листах одной колонкой — задача и что делает макрос, потом
 * промпт. Шрифт 12,5 pt, как был в колонках; длинный промпт уходит на лист «(продолжение)» */
.pp-split .pp-sol-body .pp-quote { font-size: calc(12.5pt * var(--pp-fit, 1)); line-height: 1.45; }
/* Кнопка «Скопировать промпт Мастера и проверенный код» под блоками первого листа решения — желтая,
 * как кнопки игры, текст в три строки, адреса не видно (Оля 30.10.2026) */
.pp-sol-copy {
  display: inline-flex; align-items: center; gap: 4mm; margin-top: 7mm; padding: 4mm 9mm 4mm 5mm;
  border-radius: 4.5mm; background: linear-gradient(#ffdb7e, var(--honey));
  color: #4a2f18; font: 700 13pt/1.3 var(--text); text-decoration: none;
  box-shadow: inset 0 .6mm 0 rgba(255, 255, 255, .6), 0 1.2mm 0 var(--honey-dark), 0 2.5mm 5mm rgba(78, 46, 21, .18);
}
.pp-sol-copy .pp-sol-icon { width: 14mm; height: 14mm; flex: none; }
/* Примерка листов перед печатью: печатный слой виден, но за краем экрана */
#print-root.pp-measure { display: block; position: fixed; left: -10000px; top: 0; }
.pp-template mark { background: #f6dfae; color: inherit; padding: 0 .7mm; border-radius: 1mm; }

/* Бонус за все монетки */
.pp-secret { display: grid; grid-template-columns: 70mm 1fr; gap: 10mm; align-items: center; background: var(--teal); box-shadow: none; }
.pp-secret img { width: 64mm; max-height: 120mm; object-fit: contain; filter: var(--pp-shadow-teal); }
.pp-secret h2 { margin: 0 0 3mm; font: 700 24pt/1.1 var(--text); color: var(--teal-ink); }
/* Шрифт ужимает fitCards, как на листах точек: шаблон этажа с припиской не влезал в лист (20.10.2026) */
.pp-secret .pp-pass-body { font-size: calc(13pt * var(--pp-fit, 1)); }
/* Реплика для нейросети в секрете — белая плашка, как на карточке (крыша: три секрета, 10.11.2026) */
.pp-secret .pp-pass-body .say { background: #fff; border-radius: 3mm; padding: 2.5mm 4mm; }
/* Кнопка на странице скриптов под шаблоном крыши (урок 5, 09.11.2026): компактнее, без тени
 * картинки Мастера (.pp-secret img), чтобы шаблон не ужимался до мелкого шрифта */
.pp-secret .pp-sol-copy { margin-top: 4mm; padding: 3mm 7mm 3mm 4mm; font-size: 11.5pt; }
.pp-secret .pp-sol-copy .pp-sol-icon { width: 11mm; height: 11mm; filter: none; }
