/* Игра v5 «ТЗ ушло в работу». Прототип: светлый фон, один акцентный синий
   (тот же, что у нынешней игры на платформе), системный шрифт. Зеленый и
   красный только для состояний: «в порядке» и «дефект». Телефон одной
   колонкой до 700 пикселей, ноутбук двумя. Визуал потом переделаем. */

:root {
  --bg: #f4f5f3;
  --paper: #ffffff;
  --ink: #1f2527;
  --soft: #475155;
  --fine: #59646a;
  --line: #d4dad6;
  --line-strong: #9da8a4;
  --tint: #eef1ef;
  --accent: #1d5ba8;
  --accent-deep: #164783;
  --accent-pale: #e4ecf7;
  --good: #276640;
  --good-pale: #e2efe6;
  --bad: #a1312a;
  --bad-pale: #f7e5e2;
  --warn-pale: #fbf1d4;
  --warn-ink: #634806;
  --radius: 6px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  accent-color: var(--accent);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
/* break-word вместо anywhere: слово переносится, только если не влезает в строку, и кнопка
   не сжимается до слога («заде вает», снимок владельца 29.09). */
body { margin: 0; min-height: 100vh; background: var(--bg); overflow-wrap: break-word; }
main:focus { outline: none; }
body.busy, body.busy button { cursor: progress; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; top: 12px; left: 12px; z-index: 60; padding: 12px; background: var(--paper); border: 2px solid var(--ink); transform: translateY(-400%); }
.skip:focus-visible { transform: none; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 650; margin-bottom: 6px; }
h4 { font-size: 15px; font-weight: 650; }
p { margin: 6px 0; }
.fine { font-size: 14px; color: var(--fine); }
.lede { font-size: 17px; color: var(--soft); max-width: 70ch; }
.num { font-variant-numeric: tabular-nums; text-align: right; }
.plain { list-style: none; margin: 0; padding: 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stack { display: grid; gap: 8px; }
.label-like { font-weight: 600; margin: 10px 0 4px; }
.ok-line { color: var(--good); font-weight: 600; }
.bad-line { color: var(--bad); font-weight: 600; }
.hint-box { background: var(--warn-pale); color: var(--warn-ink); padding: 8px 12px; border-radius: 6px; }
.waiting { background: var(--warn-pale); color: var(--warn-ink); padding: 8px 12px; border-radius: 6px; margin: 0; }
.give-up { border: 1px dashed var(--line); border-radius: 6px; padding: 8px 12px; margin: 10px 0; }
.give-up > p { margin: 0 0 6px; }
.banner-inline { color: var(--bad); font-weight: 600; }

/* ---------- кнопки и поля ---------- */

button {
  font: inherit; color: var(--ink); background: var(--paper); cursor: pointer;
  min-height: 44px; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 4px;
  text-align: center;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--accent-deep); border-color: var(--accent-deep); }
button.small { font-size: 15px; padding: 6px 12px; }
button.big { font-size: 17px; min-width: 180px; min-height: 48px; }
button.toggle[aria-pressed="true"] { background: var(--accent-pale); border-color: var(--accent); color: var(--accent-deep); font-weight: 600; }
button.option { width: 100%; text-align: left; white-space: normal; }
a { color: var(--accent-deep); }

label { display: block; font-weight: 600; margin-bottom: 4px; }
label .hint { display: block; font-weight: 400; font-size: 14px; color: var(--fine); }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--paper); width: 100%; min-height: 44px;
  padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 4px;
}
textarea { resize: vertical; }
input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; margin: 2px 0 0; flex: none; }
.field { display: grid; gap: 2px; }
.counter { display: block; text-align: right; }

.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chip {
  display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 14px;
  background: var(--tint); border: 1px solid var(--line); white-space: nowrap;
}
.chip.bad { background: var(--bad-pale); color: var(--bad); border-color: #e6bfb9; }
.chip.good { background: var(--good-pale); color: var(--good); border-color: #bcd9c6; }
mark.vague { background: var(--warn-pale); color: var(--warn-ink); text-decoration: underline wavy; text-underline-offset: 3px; padding: 0 2px; border-radius: 3px; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.block { display: grid; gap: 8px; }
.counter-inline { display: inline-block; font-weight: 600; font-size: 15px; }
.counter-inline.over { color: var(--bad); }
.counter-inline.ok { color: var(--good); }

/* ---------- шапка и каркас ---------- */

.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top-inner { max-width: 1760px; margin: 0 auto; padding: 8px 24px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.brand { font-weight: 700; }
.brand span { font-weight: 400; color: var(--soft); }
.top-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 15px; }
.top-meta .phase { color: var(--fine); }
.banner { position: sticky; top: 0; z-index: 30; margin: 0; padding: 10px 16px; background: var(--bad-pale); color: var(--bad); border-bottom: 1px solid var(--bad); font-weight: 600; }
main { display: block; max-width: 1760px; margin: 0 auto; padding: 16px 24px; outline: none; }
main > * + * { margin-top: 12px; }

.layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.col-main { display: grid; gap: 12px; min-width: 0; }
.step-title { margin-top: 4px; }
.work { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 16px; min-width: 0; }

/* Широкий экран (разбор Astra 29.09): каркас до 1760 пикселей, правая колонка растет с экраном. */
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .side { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
}
@media (min-width: 1520px) { .layout { grid-template-columns: minmax(0, 1fr) 360px; } }
@media (min-width: 1800px) { .layout { grid-template-columns: minmax(0, 1fr) 400px; } }

/* ---------- полоса шагов ---------- */

.steps { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; }
.steps-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
/* Серый только у недоступных шагов: в паузе тренировка и проверка открыты и не должны казаться выключенными. */

.steps-label { font-weight: 700; font-size: 14px; min-width: 88px; }
.steps-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 4px; }
/* Шаги текстом (разбор Astra 29.09): номер обычной цифрой, текущий шаг - фон и линия снизу, без таблеток. */
.step { display: flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px; border-radius: 4px 4px 0 0;
  border-bottom: 3px solid transparent; font-size: 15px; color: var(--soft); }
.step:has(.step-btn) { padding: 0; }
.step .dot { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--fine); }
.step .dot::after { content: "."; }
.step.done { color: var(--ink); }
.step.done .dot { color: var(--accent-deep); }
.step.current { background: var(--accent-pale); color: var(--accent-deep); font-weight: 700; }
.step.current .dot { color: var(--accent-deep); }
.step.here { border-bottom-color: var(--accent); }
.step.open .step-name { text-decoration: underline dotted; text-underline-offset: 4px; }
.step.locked { color: var(--fine); }
.step-btn { display: flex; align-items: center; gap: 4px; border: 0; border-radius: 4px 4px 0 0; background: none; padding: 0 10px; min-height: 44px; font: inherit; color: inherit; }
button.step-btn:hover:not(:disabled) { background: var(--tint); }
.step.current button.step-btn:hover:not(:disabled) { background: var(--accent-pale); }

/* ---------- карточка задачи, сообщения, «Дальше» ---------- */

.task { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.task-now { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.task-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; margin: 0; }
.task-grid dt { font-size: 14px; font-weight: 700; color: var(--soft); }
.task-grid dd { margin: 0; }
.task-more summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--accent-deep); font-weight: 600; }
.task-more[open] summary { margin-bottom: 6px; }
.messages { background: var(--accent-pale); border-radius: var(--radius); padding: 8px 14px; }
.next-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.next-bar .fine { margin: 0; flex: 1 1 240px; }
.test-bar, .dev-bar { border-radius: var(--radius); padding: 8px 14px; display: grid; gap: 6px; font-size: 15px; }
.test-bar { background: var(--accent-pale); border: 1px solid var(--accent); }
.dev-bar { background: var(--warn-pale); border: 1px dashed var(--warn-ink); color: var(--warn-ink); }

/* ---------- блокнот и счетчики ---------- */

.side { display: grid; gap: 12px; align-content: start; }
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.counter-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.counter-box .fine { display: block; line-height: 1.3; }
.counter-num { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.notebook { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.notebook h2 { font-size: 18px; margin-bottom: 6px; }
.note-list li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.note-list li:last-child { border-bottom: 0; }
.note-id { font-weight: 700; color: var(--accent-deep); }
.src { display: block; font-size: 14px; color: var(--fine); }

/* ---------- картинки и люди ---------- */

figure { margin: 0; }
.pic img { display: block; width: 100%; max-height: 340px; object-fit: cover; border-radius: var(--radius); }
.pic.scene img { max-height: 280px; }
.pic figcaption { font-size: 14px; color: var(--fine); margin-top: 4px; }
.face img { display: block; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.face.small img { width: 36px; height: 36px; }
.person { display: flex; align-items: center; gap: 10px; }
.request { margin: 0; padding: 12px 16px; background: var(--tint); border-radius: var(--radius); display: grid; gap: 8px; }
.request p { font-size: 19px; font-weight: 600; margin: 0; }
.text p { margin: 0 0 10px; }

/* ---------- разговор ---------- */

.why-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.chat { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bubble { display: flex; gap: 8px; align-items: flex-start; max-width: min(92%, 640px); }
.bubble.me { margin-left: auto; flex-direction: row-reverse; }
.bubble-body { padding: 8px 12px; border-radius: 6px; background: var(--tint); }
.bubble.me .bubble-body { background: var(--accent-pale); }
.bubble-body p { margin: 0; }
.bubble-who { display: block; font-size: 13px; font-weight: 700; color: var(--soft); }
.reaction { text-align: center; font-size: 14px; color: var(--fine); }
.reaction.good { color: var(--good); font-weight: 600; }
.chat-findings { list-style: none; }
.ask-options { display: grid; gap: 8px; }

/* ---------- источники ---------- */

.src-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); }
button.tab { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 8px 12px; }
button.tab[aria-selected="true"] { border-bottom-color: var(--accent); font-weight: 700; color: var(--accent-deep); }
.tab-panel { display: grid; gap: 12px; padding-top: 4px; min-width: 0; }
.search { display: grid; gap: 4px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; min-width: 0; }
.doc-row, .side-row, .place-row, .session-row, .need-row, .budget-row {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.doc-row > div, .session-row > div { display: grid; flex: 1 1 200px; }
details.doc { border: 1px solid var(--line); border-radius: 6px; }
details.doc summary { min-height: 44px; padding: 10px 12px; cursor: pointer; display: grid; }
.doc-body { padding: 0 12px; }
details.doc .findings { margin: 0 12px 12px; }
.findings { background: #f7f9f8; border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; }
.finding { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.finding:last-child { border-bottom: 0; }
.finding-text { flex: 1 1 200px; }
.picker { border: 1px solid var(--line); border-radius: 6px; padding: 0 10px; margin: 0; display: grid; min-width: 0; }
.pick-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pick-row:last-child { border-bottom: 0; }
.pick-row label { font-weight: 400; margin: 0; }
.sticky-row { position: sticky; bottom: 0; background: var(--paper); padding: 8px 0; border-top: 1px solid var(--line); }
.survey-q { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; }
.shares { display: grid; gap: 6px; }
.share { display: grid; grid-template-columns: minmax(80px, 38%) minmax(0, 1fr) 52px; gap: 8px; align-items: center; font-size: 15px; }
.share-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.bar { height: 12px; background: #e3e8e5; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); }
.bar.over .bar-fill { background: var(--bad); }
.table-scroll { overflow-x: auto; max-width: 100%; border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--tint); }
table.journal { min-width: 640px; }
table.journal td { white-space: nowrap; }
table.journal td:last-child { white-space: normal; min-width: 180px; }
button.th-sort { border: 0; background: none; padding: 0; min-height: 44px; width: 100%; text-align: left; font-weight: 700; }
.side-pick { margin-top: 4px; }
.ask-free { display: grid; gap: 8px; background: #fafbfa; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.q-card { border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; background: var(--paper); }
.q-card p { margin: 0; }
.cards.highlight .q-card { border-color: var(--accent); background: var(--accent-pale); }

/* ---------- сведение и приоритеты ---------- */

.evidence { font-size: 15px; color: var(--soft); margin: 4px 0; padding-left: 20px; }
.need-row > div, .side-row > .person { flex: 1 1 220px; }
.add-need { display: grid; gap: 6px; background: #fafbfa; }
.conflict-list { display: grid; gap: 8px; }
.conflict { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; }
.versus { font-size: 14px; color: var(--fine); }
.matrix { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 0 0 26px 26px; }
.axis { position: absolute; font-size: 13px; font-weight: 700; color: var(--soft); }
.axis-y { left: 0; top: 0; bottom: 26px; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; }
.axis-x { left: 26px; right: 0; bottom: 0; text-align: center; }
.quad { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; min-height: 110px; background: #fafbfa; display: grid; align-content: start; gap: 2px; }
.q-manage { background: var(--accent-pale); }
.quad-names li { font-size: 14px; }
.place-row label { flex: 1 1 180px; margin: 0; }
.place-row select { flex: 1 1 180px; width: auto; }
.budget-line { display: grid; gap: 6px; }
.budget-line .counter-inline { justify-self: start; }
.factory-option > button, .scenario > button, .incident > button, .factory-option > .chip { justify-self: start; }
.q-card > button { align-self: flex-start; }
.about { display: grid; gap: 8px; }
.budget-row label { display: flex; flex: 1; gap: 8px; justify-content: space-between; font-weight: 400; margin: 0; }
.budget-row { justify-content: flex-start; flex-wrap: nowrap; }
.cost { font-weight: 700; white-space: nowrap; }
.scenario, .incident, .surfaced, .analog-param, .factory-option, .req {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; background: var(--paper); min-width: 0;
}

/* ---------- требования ---------- */

.req-form { display: grid; gap: 12px; background: #fafbfa; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.with-unit { display: flex; gap: 8px; align-items: center; }
.with-unit input { flex: 1; min-width: 0; }
.op, .measure-unit { white-space: nowrap; color: var(--soft); }
.op:empty, .unit:empty { display: none; }
.req-preview { background: var(--accent-pale); border-radius: 6px; padding: 10px 12px; }
.vague-note { color: var(--warn-ink); font-size: 15px; margin: 4px 0 0; }
.vague-note:empty, .form-problems:empty { display: none; }
.form-problems { color: var(--bad); font-weight: 600; margin: 0; }
.req-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.req-id { font-weight: 700; color: var(--accent-deep); }
.req-text { margin: 0; }
/* Части требования с новой строки (kit.reqLines); вторая и дальше чуть отступают, чтобы пункт читался одним целым. */
.req-line { display: block; }
.req-line + .req-line { padding-left: 12px; }
.src-list { margin: 2px 0 0; padding-left: 18px; font-size: 13px; color: var(--fine); }
.debrief-list .src-list li { padding: 0; background: none; border-radius: 0; }
.incident-answer { display: grid; gap: 2px; margin: 12px 0; }
.incident-answer > p { margin: 0; }
.hint-box > p { margin: 0; }
.hint-box > p + p { margin-top: 6px; }
.req-defects { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.literal { display: flex; gap: 10px; align-items: flex-start; background: var(--tint); border-radius: var(--radius); padding: 8px 10px; }
.literal p { margin: 0; }
.list-title { margin-top: 4px; }
.cover-list li { padding: 4px 0; }
.remarks, .key, .received { display: grid; gap: 6px; background: #f7f9f8; border-radius: 6px; padding: 8px 10px; }
.mark-row { display: grid; gap: 4px; padding: 4px 0; }
.comment { font-style: italic; margin: 0; }
.confirm-line { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* ---------- итог занятия 1, второе занятие ---------- */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 0; }
.facts > div { background: var(--tint); border-radius: var(--radius); padding: 10px 12px; }
.facts dt { font-size: 14px; color: var(--soft); }
.facts dd { margin: 0; font-size: 24px; font-weight: 700; }
.facts-list { margin: 0; padding-left: 20px; }
.return-code { display: grid; gap: 2px; }
.return-box { display: grid; gap: 4px; background: var(--paper); border: 2px solid var(--accent); border-radius: var(--radius); padding: 12px 16px; }
.return-box .big-code { margin: 0; }
.big-code { font-size: 40px; font-weight: 800; letter-spacing: 0.06em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.news { background: var(--warn-pale); border: 1px solid #e3cf95; border-radius: var(--radius); padding: 12px 16px; }
.stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.stage { border: 1px solid var(--line); border-radius: 6px; padding: 8px; display: grid; gap: 2px; background: var(--paper); font-size: 15px; }
.stage.current { border: 2px solid var(--accent); background: var(--accent-pale); }
.stage.done { background: var(--tint); color: var(--soft); }
.stage.locked, .stage.ahead { color: var(--fine); }
.factory-option.picked { border-color: var(--good); background: var(--good-pale); }
.bad-text { color: var(--bad); }
.bio { margin: 2px 0 0; }
.note { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--accent-pale); border-radius: var(--radius); padding: 8px 12px; margin: 0; }
.loose { border-style: dashed; }
.source { margin-top: 4px; }
.storyboard { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.frame { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #fafbfa; }
.frame p { margin: 4px 0 0; font-size: 15px; }
.frame.needed { border-color: #9cc7ab; background: var(--good-pale); }
.frame-who { font-size: 13px; font-weight: 700; color: var(--soft); }
.history li { padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.blame { display: grid; gap: 6px; }
.baskets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.basket { border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; background: #fafbfa; min-height: 80px; }
.basket li { font-size: 14px; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.compare dt { font-size: 14px; color: var(--fine); }
.compare dd { margin: 0; font-weight: 700; }
.year-list { display: grid; gap: 8px; }
.year-line { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.year-line.ok { background: var(--good-pale); }
.year-line.bad { background: var(--bad-pale); }
.year-line p { margin: 0; }
.final-total { display: flex; align-items: baseline; gap: 8px; font-size: 20px; }
.score-table td:first-child { width: 70%; }
.memo li { margin: 4px 0; }

/* ---------- вход и пульт ---------- */

.entry { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.entry form { display: grid; gap: 8px; }
.code-input { font-size: 22px; letter-spacing: 0.08em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.teacher-door { display: inline-flex; align-items: center; min-height: 44px; }
.login { max-width: 460px; }
.create { display: grid; gap: 4px; }
.teacher-head { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.session-title { margin-bottom: 4px; }
table.board { min-width: 860px; }
.projector {
  position: fixed; inset: 0; z-index: 50; background: var(--paper); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center;
}
.proj-label { font-size: 24px; color: var(--soft); max-width: 40ch; }
.proj-url { font-size: 36px; font-weight: 700; margin: 0; }
.proj-code { font-size: min(20vw, 190px); font-weight: 800; letter-spacing: 0.06em; margin: 0; line-height: 1; }

@media (min-width: 701px) {
  .entry { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); }
  .teacher-head { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- телефон ---------- */

@media (max-width: 700px) {
  main { padding: 12px; }
  h1 { font-size: 22px; }
  .task-grid { grid-template-columns: minmax(0, 1fr); }
  .steps-label { min-width: 0; width: 100%; }
  .step, .step-btn { padding: 3px 8px; }
  .step:has(.step-btn) { padding: 0; }
  .step .step-name { display: none; }
  .step.here .step-name { display: inline; }
  .stages { grid-template-columns: minmax(0, 1fr); }
  .baskets { grid-template-columns: minmax(0, 1fr); }
  .big-code { font-size: 34px; }
  .share { grid-template-columns: minmax(0, 1fr) 52px; }
  .share .bar { grid-column: 1 / -1; grid-row: 2; }
  button.big { width: 100%; }
}

/* ---------- печать памятки ---------- */

@media print {
  .top, .steps, .side, .next-bar, .dev-bar, .test-bar, .task, .no-print, .banner { display: none !important; }
  body, .work { background: #fff; border: 0; }
}

/* ---------- Б8: подтверждение вторым нажатием, подвал «Об игре» ---------- */

button.armed { border-color: var(--bad); color: var(--bad); background: var(--bad-pale); font-weight: 600; }
button.primary.armed { background: var(--bad); border-color: var(--bad); color: #fff; }
.about-game { margin-top: 24px; padding: 12px 0; border-top: 1px solid var(--line); }
.about-game summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--soft); font-weight: 600; }

/* ---------- разбор после шага ---------- */

.debrief { background: var(--paper); border: 1px solid var(--accent); border-radius: var(--radius); padding: 0 14px; }
.debrief summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 700; color: var(--accent-deep); }
.debrief-body { display: grid; gap: 6px; padding-bottom: 12px; }
.debrief-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.debrief-list li { padding: 6px 10px; border-radius: 6px; background: var(--tint); }
.debrief-list li.ok { background: var(--good-pale); }
.debrief-list li.miss { background: var(--bad-pale); }
.debrief-list li.near { background: var(--warn-pale); }

/* ---------- Б8: ставки нужд, принятый риск, лидерство ---------- */

.need-what { display: grid; gap: 2px; }
.stakes { font-size: 14px; font-style: italic; color: var(--soft); }
.passed { background: var(--good-pale); border-radius: 6px; padding: 8px 12px; }
.passed li { font-size: 15px; }
.surfaced.risk { border-color: #e3cf95; background: #fffbef; }
.leader-table td.better { color: var(--good); font-weight: 600; }
.leader-table td.worse { color: var(--bad); font-weight: 600; }

/* ---------- Б8.1: выписка находок по фразам ---------- */

.units { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--paper); }
.units > .label-like { margin: 0; padding: 8px 12px; background: var(--tint); border-bottom: 1px solid var(--line); }
.unit { display: flex; gap: 8px; align-items: center; justify-content: space-between; width: 100%; min-height: 44px;
  padding: 8px 12px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: var(--paper);
  text-align: left; font: inherit; color: var(--ink); }
.units > .unit:last-child { border-bottom: 0; }
button.unit:hover:not(:disabled) { background: var(--accent-pale); }
.unit-text { flex: 1 1 auto; }
.unit.pinned { background: var(--good-pale); }
.unit.wrong { background: var(--tint); color: var(--fine); }
.unit.wrong .unit-text { text-decoration: line-through; text-decoration-color: var(--line-strong); }
.unit .chip { flex: none; }
.bubble-body .units { border: 0; background: none; }
.bubble-body .unit { background: none; padding: 6px 0; }
.bubble-body .unit.pinned { background: var(--good-pale); padding: 6px; }

.intro-units { border: 1px solid var(--line); border-radius: 6px; padding: 0 12px; background: var(--paper); }
.intro-units summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.intro-units[open] { padding-bottom: 12px; }
.intro-units .units + .units { margin-top: 8px; }
.shares-units .unit { display: block; }
.shares-units .share { width: 100%; }
td.pin-cell { white-space: nowrap; }
table.journal tr.pinned td { background: var(--good-pale); }
table.journal tr.wrong td { color: var(--fine); }
/* длинная фраза внутри кнопки переносится, реплика не распирает экран */
.unit { white-space: normal; min-width: 0; }
.unit-text { min-width: 0; overflow-wrap: anywhere; }
.bubble { min-width: 0; }
.bubble-body { min-width: 0; flex: 1 1 auto; }
.bubble-body .units { width: 100%; }
.leader-table { min-width: 640px; }
.leader-table th, .leader-table td.better, .leader-table td.worse, .leader-table td.same { white-space: nowrap; overflow-wrap: normal; }
.debrief-list .src + .src { margin-top: 2px; }

/* Пакет А: разбор разговора, уточнение, ожидания сторон, пропущенные нужды, итог и сводка группы. */
.bubble.clarify .bubble-body { border-style: dashed; }
.talk-review { margin: 8px 0 12px; }
.talk-review summary { cursor: pointer; font-weight: 600; }
.talk-review li { margin: 6px 0; }
.outlook li, .plan-fact p { margin: 6px 0; }
.plan-fact { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 4px; }
.missing-needs { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 8px; }
.profile li, .audience-zones li, .audience-shares li { display: grid; gap: 4px; margin: 8px 0; }
tr.chosen td { font-weight: 600; background: var(--accent-pale); }

/* Разбор глазами новичка 27.09: свои реплики синие справа, реплики стороны белые слева,
   фразы стороны сплошным текстом, выписка в два нажатия, выбор цели как переключатель. */
.bubble.me .bubble-body { background: var(--accent); color: #fff; }
.bubble.me .bubble-who { color: #fff; opacity: .85; }
.bubble.them .bubble-body { background: var(--paper); border: 1px solid var(--line-strong); }
.bubble.them .bubble-who { color: var(--ink, inherit); }
.units.inline { display: block; border: 0; background: none; margin: 0; line-height: 1.7; overflow: visible; }
.units.inline .unit { display: inline; width: auto; min-height: 0; padding: 1px 2px; border: 0; border-radius: 3px; }
.units.inline .unit .unit-text { display: inline; }
.units.inline .unit .chip { margin-left: 4px; font-size: 12px; }
.unit.pickable { cursor: pointer; }
.unit.pickable:hover, .unit.pickable:focus-visible { background: var(--accent-pale); }
.units.inline .unit.pickable:hover .unit-text { text-decoration: underline dotted; text-underline-offset: 3px; }
.unit.chosen, .units.inline .unit.chosen { background: var(--warn-pale); outline: 2px solid var(--accent); }
.pin-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0 2px; }
.units.inline .pin-bar { display: inline-flex; margin: 4px 6px; vertical-align: middle; }
.pin-bar .fine { white-space: normal; }
.goal-box { border-color: var(--accent); }
button.option.goal { position: relative; padding-left: 40px; text-align: left; }
button.option.goal::before { content: ""; position: absolute; left: 14px; top: 50%; width: 14px; height: 14px; margin-top: -8px;
  border: 2px solid var(--accent); border-radius: 50%; background: var(--paper); }
button.option.goal[aria-pressed="true"]::before { background: var(--accent); box-shadow: inset 0 0 0 3px var(--paper); }

/* Подсказка под «i» (разбор перегрузки 27.09): то, что нужно не сейчас. */
details.info { margin: 6px 0 0; }
details.info > summary { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; list-style: none;
  color: var(--fine); font-size: 14px; }
details.info > summary::-webkit-details-marker { display: none; }
details.info > summary:hover .info-label { text-decoration: underline; }
/* Без значка «i» с засечками (разбор Astra 29.09): обычный треугольник раскрытия, как у прочих блоков. */
.info-i { display: none; }
details.info > summary::before { content: "\25B8"; display: inline-block; width: 1em; color: var(--accent); flex: none; }
details.info[open] > summary::before { content: "\25BE"; }
.info-body { margin: 4px 0 6px; padding: 8px 12px; background: var(--tint); border-radius: 4px; font-size: 15px; }
.info-body p { margin: 4px 0; }
.info-body .task-grid { margin: 0; }
.task-now { margin-bottom: 0; }
.side-pick .side-role { display: block; font-size: 12px; font-weight: 400; opacity: .8; }
.tag-legend li + li { margin-top: 2px; }
.entry-return summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--accent-deep); }
.entry-return[open] summary { margin-bottom: 6px; }
.analog-sides summary { min-height: 36px; display: flex; align-items: center; cursor: pointer; font-size: 14px; color: var(--fine); }
.analog-sides[open] summary { margin-bottom: 4px; }
/* Версия игры справа вверху: правила и выпуск. */
.version-tag { font-size: 12px; color: var(--fine); white-space: nowrap; font-variant-numeric: tabular-nums; }
.top-meta { margin-left: auto; justify-content: flex-end; }

/* Круг Codex 27.09: доступные для выписки фразы видны сразу, кнопки выписки под абзацем. */
.units.inline .unit.pickable .unit-text { text-decoration: underline dotted var(--line-strong); text-underline-offset: 3px; }
.units-wrap { display: grid; gap: 6px; }
.units-wrap .pin-bar { display: flex; margin: 0; padding: 8px 10px; background: var(--accent-pale); border-radius: 6px; }
.pin-quote { flex: 1 1 100%; margin: 0; font-size: 14px; }
.pic.scene.small img { max-height: 180px; }
.stage-now { margin: 0; }
.note-filter { width: 100%; margin: 0 0 8px; min-height: 36px; padding: 4px 8px; border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; }
.side-pick .side-role { opacity: 1; color: var(--fine); font-size: 13px; }
.side-pick button[aria-pressed="true"] .side-role { color: inherit; }
details.info > summary { min-height: 44px; }
/* Раскрывающиеся блоки с явным значком: иначе заголовок блока похож на обычный текст. */
details:not(.info) > summary { list-style: none; }
details:not(.info) > summary::-webkit-details-marker { display: none; }
details:not(.info) > summary::before { content: "\25B8"; display: inline-block; width: 1em; margin-right: 6px; color: var(--accent); flex: none; }
details:not(.info)[open] > summary::before { content: "\25BE"; }
.steps-compact { justify-content: space-between; }
.steps-now { font-weight: 600; font-size: 15px; }
.doc-row { display: grid; gap: 8px; }
.doc-row-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.budget-line { position: sticky; top: 0; z-index: 1; background: var(--paper); padding: 6px 0; }
.score-table td.num .bar { margin-top: 4px; min-width: 80px; }
details.cards > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
/* Схемы: целиком, без обрезки, на белом (круг Codex). */
.pic.scheme img { max-height: none; object-fit: contain; background: var(--paper); border: 1px solid var(--line); }
.incident-body { display: grid; gap: 10px; }
.incident-pic img { max-height: 220px; }
@media (min-width: 900px) {
  .incident-body { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-items: start; }
}
.where-in-bus summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--accent-deep); }
/* Схема не шире своего рисунка: иначе подписи крупнее текста страницы. */
.pic.scheme img { max-width: 640px; margin: 0 auto; }
.doc-summary { display: block; font-size: 14px; color: var(--soft); }
.frame-pic { margin: 0 0 4px; }
.frame-pic img { width: 56px; height: 56px; max-height: none; object-fit: cover; border-radius: 50%; }


/* ---------- Б14: реестр рисков и протокол этапа ---------- */

.risk-card, .protocol-row {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; background: var(--paper); min-width: 0;
}
.risk-card .toggles { justify-self: start; }
.protocol-row.signed { background: var(--tint); }
.protocol-row.signed.return { border-color: #e3cf95; }
.protocol-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
.protocol-facts dt { color: var(--fine); font-size: 15px; }
.protocol-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.protocol-facts dd.measured { font-weight: 700; }
.protocol-lines li { font-size: 15px; }
@media (max-width: 480px) {
  .protocol-facts { grid-template-columns: 1fr; }
  .protocol-facts dt { margin-top: 4px; }
}

/* ---------- Б15: расследование запросами данных и причина правилом ---------- */

.case, .rule-box { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.query-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.query-result { display: grid; gap: 4px; background: var(--tint); border-radius: 6px; padding: 8px 12px; min-width: 0; }
table.case-table { min-width: 0; }
table.case-table td, table.case-table th { white-space: nowrap; }
table.case-table tr.hit td { background: var(--bad-pale); }
.rule-form { display: grid; gap: 8px; }
.rule-clause { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: end; }

/* ---------- Б17: требование своими словами ---------- */

.phrase-box { display: grid; gap: 8px; background: var(--accent-pale); border-radius: 6px; padding: 10px 12px; }
.phrase-box h4 { margin: 0; }
.phrase-box textarea { width: 100%; }
.phrase-answer { display: grid; gap: 8px; background: var(--paper); border-radius: 6px; padding: 8px 10px; }
.phrase-remarks li { font-size: 15px; }

/* ---------- Б19: ответ своими словами ---------- */

.free-box { display: grid; gap: 8px; }
.free-box textarea { width: 100%; }
.token-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-button { border: 1px solid var(--line); border-radius: 4px; padding: 4px 10px; background: var(--paper); color: var(--ink); cursor: pointer; }
.chip-button:hover, .chip-button:focus-visible { border-color: var(--accent); }
.conflict .free-box, .conflict .comment { margin-top: 6px; }
.attack { margin-top: 8px; display: grid; gap: 6px; }
.attack > summary { cursor: pointer; color: var(--accent); }
.tz-goal { background: var(--accent-pale); border-radius: 6px; padding: 8px 12px; margin: 0; }
.objection .chat { margin-bottom: 8px; }
/* Б22: как модель прочла тексты запасного пути, шаг «Что было» */
.later-item { border-top: 1px solid var(--line); padding-top: 6px; display: grid; gap: 2px; }
.later-item p { margin: 0; }
.later-item .label-like { margin: 0; }

/* ---------- Б18: закономерность журнала числами ---------- */

.numbers-template { line-height: 2.4; }
.numbers-template input { width: 5.5em; margin: 0 6px; text-align: center; }

/* ---------- фильтр блокнота по нужде ---------- */

.note-need { display: grid; gap: 4px; margin: 4px 0 8px; font-weight: 400; }
.note-need select { width: 100%; min-height: 44px; }
.note-list li.need-hidden { display: none; }

/* ---------- схема «находка, нужда, сторона» ---------- */

.scheme-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px 16px; align-items: start; margin-top: 8px; }
.scheme-grid > * { min-width: 0; overflow-wrap: anywhere; }
.scheme-from li, .scheme-who li { font-size: 14px; }
.scheme-need { position: relative; padding: 4px 8px; background: var(--accent-pale); border-radius: 6px; }
.scheme-need::before { content: "→ "; color: var(--fine); }
@media (max-width: 700px) { .scheme-grid { grid-template-columns: 1fr; } .scheme-grid > .label-like { display: none; } }

/* ---------- «Мои материалы»: правая колонка по шагу (разбор Astra 29.09) ---------- */

.side { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; gap: 0; }
.side > * + * { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.side-title { font-size: 20px; }
.side h3 { font-size: 16px; margin: 0 0 6px; }
.side-status p { margin: 2px 0; font-size: 16px; }
.side-status b { font-variant-numeric: tabular-nums; }
.side-hours .fine { display: block; }
.side-tip { font-size: 15px; }
.side-tip p { margin: 0; }
.side-tip .side-tip-who { font-weight: 700; color: var(--soft); font-size: 14px; margin-bottom: 2px; }
.side-left li { padding: 2px 0; }
button.link-like { min-height: 36px; padding: 4px 0; border: 0; background: none; color: var(--accent-deep); text-align: left;
  text-decoration: underline; text-underline-offset: 3px; font-size: 15px; }
button.link-like:hover:not(:disabled) { color: var(--ink); }
.side-left span { font-size: 15px; }
.side-left.tried h3, .side-left.tried button.link-like, .side-left.tried span { color: var(--bad); }
.side-need-title { font-weight: 600; margin: 0 0 6px; }
.side-reqs li { font-size: 15px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.side-reqs li:last-child { border-bottom: 0; }
.side-tz summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.side .notebook { background: none; border: 0; border-radius: 0; padding-left: 0; padding-right: 0; padding-bottom: 0; }
@media (max-width: 959px) { .side { position: static; } }

/* Картинка новости рынка с подписями и маршрутом из данных мира. */
.scene-map { position: relative; margin: 8px 0; }
.scene-map-frame { position: relative; isolation: isolate; overflow: hidden; border-radius: var(--radius); }
.scene-map img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.scene-label { position: absolute; z-index: 3; transform: translate(-50%, -100%); max-width: 30%; padding: 3px 8px;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--line-strong); border-radius: 4px;
  font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink); text-align: center; }

.scene-route { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
.scene-route-line, .scene-route-arrow, .scene-route-arrow-outline {
  fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke;
}
.scene-route-outline { stroke: #fff; stroke-opacity: 0.9; }
.scene-route-outline-old { stroke-width: 6px; }
.scene-route-outline-new { stroke-width: 8px; }
.scene-route-line-old { stroke: #9da8a4; stroke-width: 3px; stroke-opacity: 0.76; }
.scene-route-line-new { stroke: #1d5ba8; stroke-width: 4.5px; stroke-opacity: 0.82; }
.scene-route-arrow-outline { stroke: #fff; stroke-width: 5px; }
.scene-route-arrow { stroke: #1d5ba8; stroke-width: 2.5px; }
.scene-route-stop { fill: #fff; stroke-width: 2px; vector-effect: non-scaling-stroke; }
.scene-route-stop-old { stroke: #9da8a4; }
.scene-route-stop-new { stroke: #1d5ba8; }

.scene-route-bus-body { fill: #1d5ba8; stroke: #fff; stroke-width: 2px; }
.scene-route-bus-window { fill: #fff; }
.scene-route-bus-wheel { fill: #9da8a4; }
.scene-route-bus-moving { display: none; }
.scene-route-bus-parked { display: inline; }
@media (prefers-reduced-motion: no-preference) {
  .scene-route-bus-moving { display: inline; }
  .scene-route-bus-parked { display: none; }
}

.scene-route-note {
  position: absolute; z-index: 2; transform: translate(-50%, -100%);
  padding: 2px 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.94);
  color: #1d5ba8; font-size: 14px; font-weight: 600; line-height: 1.25; white-space: nowrap;
  pointer-events: none;
}
.scene-route-legend {
  position: absolute; z-index: 4; left: var(--legend-x); top: var(--legend-y);
  display: flex; flex-direction: column; gap: 5px; max-width: calc(100% - 24px);
  box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 4px;
  background: rgba(255, 255, 255, 0.94); color: var(--ink); font-size: 13px; line-height: 1.3;
}
.scene-route-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.scene-route-swatch { display: inline-block; flex: 0 0 24px; height: 0; border-top: 3px solid; }
.scene-route-swatch-old { border-color: #9da8a4; }
.scene-route-swatch-new { border-color: #1d5ba8; border-top-width: 4px; }
.scene-route-description {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
@media (max-width: 700px) {
  .scene-label { font-size: 12px; padding: 2px 5px; max-width: 25%; }
  .scene-route-note { font-size: 11px; padding: 2px 3px; }
  .scene-route-bus-shape { transform: scale(1.5); }
  .scene-route-arrow-shape { transform: scale(1.5); }
  .scene-route-legend {
    position: static; flex-direction: row; flex-wrap: wrap; gap: 6px 14px;
    margin-top: 6px; max-width: none; font-size: 12px;
  }
}
@media (max-width: 420px) {
  .scene-label { font-size: 10px; line-height: 1.15; padding: 2px 3px; max-width: 23%; }
  .scene-route-note { font-size: 10px; }
  .scene-route-bus-shape { transform: scale(2); }
}
.note-need select { font-size: 15px; }
.note-need-full { font-size: 14px; color: var(--soft); }
.note-need-full:empty { display: none; }
/* ---------- задача 13: Alt+J в тесте преподавателя ---------- */

.test-bar .test-hint { margin: 0; font-size: 14px; color: var(--fine); }
.test-bar .test-note { margin: 0; font-size: 14px; font-weight: 600; }
/* ---------- задача 15: что не заполнено до «Дальше» ---------- */

/* Неготовая «Дальше» остается кнопкой проверки: доступна, без прозрачности. */
.next-bar button.primary.is-incomplete { background: var(--tint); color: var(--ink); border-color: var(--line-strong); }
.next-bar button.primary.is-incomplete:hover:not(:disabled) { background: var(--paper); border-color: var(--ink); }
/* Отправка или ожидание преподавателя: кнопка серая, нажатие ничего не делает. */
.next-bar button.primary[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.next-bar button.primary.is-busy { cursor: progress; }
/* Место, где не заполнено: рамка 2px и бледный фон, без тряски и значков. */
/* Красного в меру (29.09): у места рамка без заливки, у строк внутри него только бледный фон. */
.ready-miss { box-shadow: 0 0 0 2px var(--bad); border-radius: var(--radius); }
.ready-miss:not(button):not(select):not(input):not(textarea) { padding: 8px 10px; }
.ready-miss-row { background: var(--bad-pale); border-radius: 4px; }
.ready-miss-row:not(button) { padding-left: 8px; padding-right: 8px; }
.ready-note { margin: 0; color: var(--bad); font-weight: 600; flex-basis: 100%; }
.ready-summary { flex: 1 1 280px; display: grid; gap: 4px; color: var(--bad); }
.ready-summary-title { margin: 0; font-weight: 700; }
.ready-summary ul { margin: 0; display: grid; gap: 2px; }
button.ready-link { min-height: 32px; padding: 2px 0; border: 0; background: none; color: var(--bad); text-align: left; text-decoration: underline; }
button.ready-link:hover:not(:disabled) { border: 0; color: var(--ink); }
/* ---------- задача 14: итоги занятия 1, промежуточный рейтинг ---------- */

.s1-rating { display: grid; gap: 6px; margin-bottom: 12px; }
.s1-rating p { margin: 0; }
.s1-rating-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.s1-place { font-size: 48px; font-weight: 800; line-height: 1; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.s1-bins { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; align-items: end; margin: 4px 0; }
.s1-bin { display: grid; gap: 2px; text-align: center; font-size: 13px; }
.s1-bin-col { height: 84px; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch;
  border-bottom: 1px solid var(--line-strong); }
.s1-bin-fill { background: var(--accent-pale); border: 1px solid #b9cbe6; border-bottom: 0; border-radius: 4px 4px 0 0; min-height: 2px; }
.s1-bin.mine .s1-bin-fill { background: var(--accent); border-color: var(--accent-deep); }
.s1-bin-count { color: var(--soft); font-variant-numeric: tabular-nums; }
.s1-bin-range { color: var(--fine); font-variant-numeric: tabular-nums; }
.s1-bin-mark { min-height: 1.5em; font-weight: 700; color: var(--accent-deep); }
.s1-sum td { font-weight: 700; border-top: 1px solid var(--line-strong); }
.block .debrief { margin-top: 8px; }
.s1-group-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 8px; }
.s1-group-facts dt { color: var(--fine); font-size: 14px; }
.s1-group-facts dd { margin: 0; font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.s1-group .s1-bins { max-width: 640px; }

/* ---------- проход 29.09, пульт ---------- */

.teacher-create { width: 100%; max-width: 760px; min-width: 0; }
.teacher-create .search-row > button { flex: none; }
.cup-fields {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 8px 12px; align-items: start; width: 100%;
}
.cup-fields > label { min-width: 0; margin: 0; }
.cup-fields input, .cup-fields select { width: 100%; min-width: 0; max-width: 100%; }

@media (max-width: 700px) {
  .cup-fields { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- проход 29.09, экраны шагов ---------- */

.doc-list > .doc-row {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}
.doc-row > .archive-doc-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 10rem;
  gap: 8px 16px;
  align-items: center;
  min-width: 0;
}
.archive-doc-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.archive-doc-copy > b,
.archive-doc-copy > .fine {
  display: block;
}
.doc-row > .archive-doc-head > button {
  width: 10rem;
  max-width: 100%;
  justify-self: start;
}
.doc-row > .archive-doc-head > .chip {
  justify-self: end;
}

details.doc > summary.archive-doc-summary {
  display: flex;
  align-items: flex-start;
}
.archive-doc-heading {
  display: block;
  min-width: 0;
  flex: 1;
}
.archive-doc-heading > b,
.archive-doc-heading > .fine {
  display: block;
}
.archive-doc-heading > .fine {
  margin-top: 2px;
}

.review-help {
  display: grid;
  gap: 0;
  min-width: 0;
}
.review-help > .fine,
.review-help > details.info {
  margin: 0;
}

.req-fields {
  min-width: 0;
}
.req-fields > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  color: var(--accent-deep);
  font-weight: 600;
}
.req-fields[open] > summary {
  margin-bottom: 8px;
}
.req-fields-body {
  display: grid;
  gap: 12px;
  min-width: 0;
}

@media (max-width: 700px) {
  .doc-row > .archive-doc-head {
    grid-template-columns: minmax(0, 1fr);
  }
  .doc-row > .archive-doc-head > .chip {
    justify-self: start;
  }
}

/* Проход 29.09: другое занятие справа от шагов на широком экране. */
@media (min-width: 1100px) {
  .steps.steps-inline { display: flex; align-items: center; gap: 8px 16px; }
  .steps-inline > .steps-row:not(.steps-other) { flex: 1 1 0; min-width: 0; flex-wrap: nowrap; }
  .steps-inline .steps-list { min-width: 0; }
  .steps-inline > .steps-other {
    flex: 0 0 auto; margin-left: auto; display: grid;
    grid-template-columns: max-content max-content; gap: 0 10px;
  }
  .steps-inline .steps-other > .steps-label { grid-column: 1; grid-row: 1; min-width: 0; }
  .steps-inline .steps-other > .fine { grid-column: 1; grid-row: 2; }
  .steps-inline .steps-other > button { grid-column: 2; grid-row: 1 / span 2; }
}

/* Пауза и переход к итогам занятия в одном сообщении. */
.messages > .s1-link { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }

/* Таблицы баллов: итог игры и итог занятия 1 с суммирующей строкой. */
.score-table,
table:has(.s1-sum) { width: 100%; max-width: 560px; }
.score-table td:first-child,
table:has(.s1-sum) td:first-child { width: auto; }
.score-table th:last-child,
.score-table td:last-child,
table:has(.s1-sum) th:last-child,
table:has(.s1-sum) td:last-child {
  width: 1%; white-space: nowrap; text-align: right;
  font-variant-numeric: tabular-nums;
}

/* На телефоне совет идет перед работой, материалы остаются под ней. */
.step-guidance {
  display: grid; gap: 12px; min-width: 0;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 6px; padding: 12px 14px;
}
.step-guidance > * + * { border-top: 1px solid var(--line); padding-top: 12px; }
.step-guidance h3 { font-size: 16px; margin: 0 0 6px; }
.side details.notebook > summary {
  min-height: 44px; display: flex; align-items: center;
  cursor: pointer; font-weight: 600;
}
.side details.notebook[open] > summary { margin-bottom: 6px; }

@media (max-width: 700px) {
  .top-inner.student-top {
    display: grid; grid-template-columns: minmax(0, 1fr);
    gap: 4px; padding: 6px 12px;
  }
  .student-top .brand {
    display: flex; align-items: baseline; gap: 4px;
    min-width: 0; font-size: 14px; white-space: nowrap;
  }
  .student-top .brand span {
    flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  }
  .student-top .top-meta {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 8px; width: 100%; min-width: 0; margin: 0;
    justify-content: normal;
  }
  .student-top .top-meta .who { grid-column: 1; grid-row: 1; min-width: 0; }
  .student-top .top-meta .phase { grid-column: 1; grid-row: 2; font-size: 13px; }
  .student-top .top-meta > button { grid-column: 2; grid-row: 1 / span 2; }
  .student-top .top-meta .version-tag { display: none; }
}

@media print {
  .step-guidance { display: none !important; }
}

/* Почему выписка неверна, у самой фразы (проход 29.09, A3). */
.pin-note { margin: 4px 0 0; padding: 6px 10px; background: var(--bad-pale); color: var(--bad); border-radius: 4px; font-size: 15px; }

/* ---------- замечания 29.09: конвейер, аналог, таблицы ---------- */

.conveyor-progress {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.conveyor-scene {
  position: relative;
  min-width: 0;
}
.conveyor-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  border-radius: 6px;
  object-fit: contain;
}
.conveyor-highlights {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  pointer-events: none;
}
.conveyor-highlight {
  margin: 3px;
  min-width: 0;
  border-radius: 6px;
}
.conveyor-highlight.current {
  border: 3px solid var(--accent);
}
.conveyor-highlight.done {
  background: var(--paper);
  opacity: .35;
}

/* Отступы внутри каждой пятой доли сохраняют центры 10, 30, 50, 70, 90 %. */
.conveyor-stages {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
}
.conveyor-stages > .stage {
  min-width: 0;
  margin: 0 3px;
  align-content: start;
  border-width: 2px;
}
.conveyor-stages > .stage.current {
  color: var(--accent-deep);
}
.conveyor-stages > .stage.current > .fine {
  color: var(--accent-deep);
}

@media (max-width: 700px) {
  .conveyor-stages {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .conveyor-stages > .stage {
    margin: 0;
  }
}

.analog-layout {
  min-width: 0;
  container-name: analog-work;
  container-type: inline-size;
}

/* Порог относится к доступной ширине работы, а не к окну с боковой колонкой. */
@container analog-work (min-width: 860px) {
  .analog-list {
    /* Плитка от 860 px работы: на 1600 рабочая колонка около 1150, три в ряд (29.09). */
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    align-items: start;
  }
  .analog-list > .analog-param {
    display: flex;
    flex-direction: column;
    gap: 8px;
    aspect-ratio: 1;
    min-height: min-content;
    font-size: 15px;
    line-height: 1.4;
  }
  .analog-list .compare {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .analog-list .compare > div {
    min-width: 0;
  }
  .analog-list .compare dd {
    margin-top: 2px;
  }
  .analog-list .analog-param > .label-like {
    margin: auto 0 0;
    padding-top: 4px;
    font-size: 14px;
  }
  .analog-list .analog-levels {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    width: 100%;
  }
  .analog-list .analog-levels button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 6px 10px;
    border-radius: 4px;
    text-align: left;
    white-space: normal;
  }
  .analog-list .analog-sides {
    margin: 0;
  }
}

.comparison-scroll {
  width: 100%;
  min-width: 0;
}
table.comparison-table {
  width: 100%;
  max-width: none;
  table-layout: auto;
}
.comparison-table th,
.comparison-table td {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}
.comparison-table th {
  white-space: nowrap;
}
.comparison-table th:first-child,
.comparison-table td:first-child {
  width: 28%;
  min-width: 15rem;
  white-space: normal;
}
.comparison-table .comparison-value,
.factories-table td:not(:first-child),
.tz0-table td.num {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.factories-table {
  min-width: 1040px;
}
.tz0-table {
  min-width: 560px;
}
.tz0-table th:first-child,
.tz0-table td:first-child {
  width: 46%;
}
.tz0-table td.num .bar {
  margin-top: 4px;
  min-width: 80px;
}
.leader-table.comparison-table {
  min-width: 880px;
}

/* Подписи мест на телефоне строкой под картинкой новости (29.09). */
.scene-places { display: none; margin: 6px 0 0; font-size: 14px; color: var(--soft); }
@media (max-width: 700px) {
  .scene-map .scene-label { display: none; }
  .scene-places { display: block; }
}
/* ------------------------------------------------------------------------------------------
   Проектор преподавателя (задача 17, docs/analysis/2026-09-29-v5-projector/README.md).
   Экран аудитории: одна единица --u на всю разметку, 1vw на экране 16:9 (19,2 пикселя на
   1920x1080, 13,7 на 1366x768), поэтому раскладка одна и та же на обоих и помещается без
   прокрутки. Светлый фон, черный текст, один синий акцент; крупно только число студентов
   на шаге, его читают с задних рядов.
   ------------------------------------------------------------------------------------------ */
body.proj-mode { background: #fff; overflow: hidden; }
body.proj-mode .top, body.proj-mode .skip { display: none; }
body.proj-mode #live { top: 0; left: 0; }
body.proj-mode main { max-width: none; margin: 0; padding: 0; }
.pj {
  --u: min(1vw, 1.778vh);
  --pj-ink: #111416; --pj-soft: #3d474c; --pj-fill: #a9bfdc;
  box-sizing: border-box; width: 100vw; height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; gap: calc(var(--u) * 1.2);
  padding: calc(var(--u) * 1.8) calc(var(--u) * 2.5) calc(var(--u) * 1);
  background: #fff; color: var(--pj-ink); font-size: calc(var(--u) * 2); line-height: 1.2; overflow-wrap: normal;
}
.pj p { margin: 0; }
.pj-wait { font-size: calc(var(--u) * 3); margin: auto; }
.pj-head { display: flex; justify-content: space-between; align-items: flex-end; gap: calc(var(--u) * 2); }
.pj-title { font-size: calc(var(--u) * 2.6); font-weight: 700; }
.pj-phase { font-size: calc(var(--u) * 2); color: var(--pj-soft); }
.pj-clock { text-align: right; }
.pj-minute { font-size: calc(var(--u) * 2.6); font-weight: 700; font-variant-numeric: tabular-nums; }
.pj-time { font-size: calc(var(--u) * 2); color: var(--pj-soft); font-variant-numeric: tabular-nums; }
.pj-ruler { position: relative; height: calc(var(--u) * 1.1); background: #e6e9eb; border: 1px solid #8d989d; }
.pj-ruler-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.pj-ruler-tick { position: absolute; top: calc(var(--u) * -0.4); bottom: calc(var(--u) * -0.4); width: 2px; background: var(--pj-ink); }
.pj-cols { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: calc(var(--u) * 1); margin: 0; }
.pj-col { display: flex; flex-direction: column; min-height: 0; padding: calc(var(--u) * 0.4);
  border: calc(var(--u) * 0.25) solid transparent; }
.pj-col.now { border-color: var(--accent); }
.pj-mark { min-height: 2.4em; font-size: calc(var(--u) * 1.5); font-weight: 700; color: var(--accent-deep); }
.pj-bar { flex: 1 1 auto; min-height: calc(var(--u) * 8); display: flex; flex-direction: column; justify-content: flex-end;
  border-bottom: calc(var(--u) * 0.25) solid var(--pj-ink); }
.pj-bar-fill { background: var(--pj-fill); min-height: 0; }
.pj-col.now .pj-bar-fill { background: var(--accent); }
.pj-count { font-size: calc(var(--u) * 5.2); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.pj-behind { min-height: 2.6em; margin-top: calc(var(--u) * 0.4); font-size: calc(var(--u) * 1.5); color: var(--warn-ink); }
.pj-behind b { font-size: calc(var(--u) * 2.4); }
.pj-col.zero .pj-count { color: #9aa4a8; }
.pj-step { font-size: min(calc(var(--u) * 2), calc(var(--u) * 16 / var(--cols))); font-weight: 700; min-height: 2.4em;
  hyphens: manual; overflow-wrap: normal; }
.pj-window { font-size: calc(var(--u) * 1.6); color: var(--pj-soft); font-variant-numeric: tabular-nums; }
.pj-facts { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 1) calc(var(--u) * 4); margin: 0; }
.pj-facts dt { font-size: calc(var(--u) * 1.6); color: var(--pj-soft); }
.pj-facts dd { margin: 0; font-size: calc(var(--u) * 3); font-weight: 700; font-variant-numeric: tabular-nums; }
.pj-facts .pj-fact-step dd { font-size: calc(var(--u) * 2.6); }
.pj-hint { border: calc(var(--u) * 0.25) solid var(--accent); background: var(--accent-pale);
  padding: calc(var(--u) * 1) calc(var(--u) * 1.4); }
.pj-hint-to { font-size: calc(var(--u) * 1.6); font-weight: 700; color: var(--accent-deep); }
.pj-hint-text { font-size: calc(var(--u) * 2.2); margin-top: calc(var(--u) * 0.4); max-width: 70em; }
.pj-between { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; gap: calc(var(--u) * 2); }
.pj-sub { font-size: calc(var(--u) * 2.6); font-weight: 700; }
.pj-between .pj-facts dd { font-size: calc(var(--u) * 5); }
.pj-corner { display: flex; justify-content: flex-end; align-items: center; gap: 8px; font-size: 14px; color: var(--pj-soft); }
.pj-corner button.small { font-size: 13px; padding: 2px 10px; min-height: 0; opacity: 0.7; }

/* Пульт: «Ход занятия и кто отстает» и подсказки. */
.help-table tr.help td.level { font-weight: 700; color: var(--warn-ink); }
.help-table td { vertical-align: top; }
.hint-compose { border-top: 1px solid var(--line); padding-top: 12px; }
.hint-option { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; }
.hint-option input { margin-top: 5px; width: 18px; height: 18px; }
.hint-text { display: grid; gap: 2px; font-weight: 400; }
.hint-log li { padding: 8px 0; border-top: 1px solid var(--line); }
.hint-log li p { margin: 2px 0; }

/* Подсказка преподавателя на экране студента. */
.teacher-hint { border: 2px solid var(--accent); background: var(--accent-pale); border-radius: var(--radius);
  padding: 10px 14px; margin: 10px 0; }
.teacher-hint p { margin: 4px 0; }
.teacher-hint-who { font-size: 14px; font-weight: 700; color: var(--accent-deep); }
/* ---------- задача 18: итоговый рейтинг и меню-бургер студента ---------- */

.s1-bins.bins-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.final-rating .s1-bins { max-width: 640px; }
.cup-line { margin: 4px 0 0; }
.cup-line a { color: var(--accent-deep); }

#top { position: relative; }
button.menu-btn { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; padding: 6px 12px; }
button.menu-btn[aria-expanded="true"] { background: var(--accent-pale); border-color: var(--accent); color: var(--accent-deep); }
.menu-btn svg { flex: none; }

.student-menu {
  position: absolute; right: 24px; top: calc(100% + 4px); z-index: 40;
  width: min(460px, calc(100vw - 48px)); max-height: calc(100vh - 96px); overflow-y: auto;
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(31, 37, 39, 0.16);
}
.menu-list > .menu-row + .menu-row { border-top: 1px solid var(--line); }
button.menu-item {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  text-align: left; border: 0; border-radius: 0; padding: 10px 16px; font-weight: 600; background: none;
}
button.menu-item::after {
  content: ""; width: 8px; height: 8px; margin-left: 12px; flex: none;
  border-right: 2px solid var(--fine); border-bottom: 2px solid var(--fine); transform: rotate(45deg) translateY(-2px);
}
button.menu-item[aria-expanded="true"]::after { transform: rotate(-135deg) translateY(-2px); }
button.menu-item:hover:not(:disabled) { background: var(--tint); }
.menu-row.on > button.menu-item { color: var(--accent-deep); }
button.menu-logout::after { display: none; }
.menu-body { display: grid; gap: 6px; padding: 4px 16px 14px; }
.menu-body h4 { margin-top: 8px; }
.menu-body p { margin: 0; }
.menu-body .s1-place { font-size: 34px; }
.menu-body .s1-rating { margin-bottom: 0; }
.menu-body .return-box > h3 { display: none; }
.menu-score { width: 100%; }
.menu-terms { margin: 0; display: grid; gap: 6px; }
.menu-terms dt { font-weight: 650; }
.menu-terms dd { margin: 0; color: var(--soft); }

@media (max-width: 700px) {
  .student-menu {
    left: 0; right: 0; width: auto; top: 100%; max-height: calc(100vh - 64px);
    border-radius: 0; border-left: 0; border-right: 0;
  }
}

@media print {
  .student-menu { display: none !important; }
}

/* ---------------------------------------------------------------- задача 22: симуляция кубка в пульте */

.cup-sim > .row { align-items: flex-end; }
.cup-sim .check { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.cup-sim .check input[type="checkbox"] { margin: 0; }

/* ---------------------------------------------------------------- задача 25: шаг «Рамки и решение» и дерево итога */

.frame-part { display: grid; gap: 10px; }
.frame-card, .frame-option, .frame-note {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); padding: 10px 12px;
  display: grid; gap: 8px; min-width: 0;
}
.frame-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.frame-quote { font-weight: 600; quotes: "«" "»"; overflow-wrap: anywhere; }
.chip.frame-unheard { background: var(--warn-pale); color: var(--warn-ink); border-color: #e7d49a; }
.frame-baskets button, .frame-sources button { min-height: 36px; }
.frame-notes { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.frame-note p { margin: 0; color: var(--soft); }
.frame-option.picked { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.frame-option-head p { margin: 2px 0 0; }
.frame-option > button.toggle { justify-self: start; }
.frame-reject { display: grid; gap: 6px; grid-template-columns: 1fr 1fr; align-items: end; }
.frame-reject > .label-like { grid-column: 1 / -1; margin: 0; }
.frame-select { display: grid; gap: 2px; min-width: 0; }
.frame-select select { width: 100%; min-height: 36px; max-width: 100%; }
.frame-reply .chat { margin: 0; }
.frame-derived-result li { margin: 4px 0; }
.frame-from-choice { border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint); padding: 8px 12px; }
.frame-from-choice ul { margin: 4px 0 0; display: grid; gap: 4px; }
.chip.frame-choice { background: var(--accent-pale); color: var(--accent-deep); border-color: #bfd0ea; }
.chip.frame-gap { background: var(--bad-pale); color: var(--bad); border-color: #e6bfb9; margin-left: 6px; }
.frame-tree .tree { display: grid; gap: 10px; margin: 0; }
.frame-tree .tree-node { border-left: 3px solid var(--line-strong); padding: 2px 0 2px 12px; }
.frame-tree .tree-node.gap { border-left-color: var(--bad); }
.frame-tree .tree-label { font-weight: 650; }
.frame-tree .tree-sub { margin: 4px 0 0; display: grid; gap: 6px; }
.frame-tree .tree-frame.gap > p { color: var(--bad); }
.frame-tree .tree-reqs { margin: 2px 0 0 12px; color: var(--soft); display: grid; gap: 2px; }
.frame-tree p { margin: 4px 0 0; }

@media (max-width: 700px) {
  .frame-reject { grid-template-columns: 1fr; }
  .frame-notes { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- задача 26: плитка аналога */
/* Квадрат плитки держит только пустую карточку: с открытыми сторонами или с разбором после шага
   содержимое выше квадрата и наезжало на плитку ниже (снимки task-26-shots, 30.09). */
.analog-list > .analog-param:has(> .analog-sides[open]),
.analog-list > .analog-param:has(> .ok-line, > .bad-line) {
  aspect-ratio: auto;
}

/* ---------------------------------------------------------------- задача 30: ресурсы шага */
/* Счетчик в шапке, карточка ресурса в «Моих материалах», журнал трат, цены у действий.
   Часы и деньги различаются подписью («ч», «руб.») и знаком часов, цвет только поддерживает. */
:root { --res-hours: #276640; --res-hours-pale: #e2efe6; --res-money: #7a3d17; --res-money-pale: #f6eadb; }
.v5d { --res-hours: var(--office); --res-hours-pale: var(--office-soft); --res-money: var(--factory); --res-money-pale: var(--factory-soft); }

.res-top {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 4px;
  background: var(--paper); color: var(--ink); font-weight: 600; font-size: 15px;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.res-top.res-hours { color: var(--res-hours); border-color: var(--res-hours); }
.res-top.res-money { color: var(--res-money); border-color: var(--res-money); }
.res-top.res-low { background: var(--warn-pale); color: var(--warn-ink); border-color: #d9bf73; }
.res-icon { flex: none; }
.v5d .top .res-top { background: #fff; color: var(--ink); border-color: #fff; }
.v5d .top .res-top.res-money { background: var(--factory); color: #fff; border-color: var(--factory); }
.v5d .top .res-top.res-low { background: var(--warn-pale); color: var(--warn-ink); border-color: var(--warn-pale); }

.res-cards { display: grid; gap: 10px; }
.res-card { border: 1px solid var(--line); border-radius: 6px; background: var(--paper); padding: 12px 14px; }
.res-card.res-main { border-color: var(--line-strong); }
.res-card p { margin: 0; }
.res-title { display: flex; align-items: center; gap: 6px; font-size: 16px; margin: 0 0 4px; }
.res-hours .res-title { color: var(--res-hours); }
.res-money .res-title { color: var(--res-money); }
.res-big { font-size: 18px; line-height: 1.15; margin: 2px 0 4px !important; font-variant-numeric: tabular-nums; }
.res-big b { font-size: 32px; font-weight: 700; }
.res-hours .res-big b { color: var(--res-hours); }
.res-money .res-big b { color: var(--res-money); }
.res-big-note { color: var(--soft); font-size: 15px; margin-bottom: 4px !important; }
.res-line { font-size: 15px; padding: 1px 0; }
.res-sub { font-weight: 600; font-size: 15px; margin-top: 8px !important; }
.res-note { color: var(--fine); font-size: 14px; margin-top: 6px !important; }
.res-warn { margin-top: 8px !important; padding: 4px 8px; border-radius: 4px; background: var(--warn-pale); color: var(--warn-ink); font-weight: 600; font-size: 15px; }
.res-last { margin-top: 8px !important; padding-top: 8px; border-top: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.res-money .res-last { color: var(--res-money); }
.res-hours .res-last { color: var(--res-hours); }

.res-cells { display: flex; gap: 3px; margin-top: 8px; }
.res-cell { flex: 1 1 0; height: 14px; border: 1px solid var(--res-hours); border-radius: 2px; background: var(--paper); }
.res-cell.on { background: var(--res-hours); }
.res-cells.res-help .res-cell { border-color: var(--line-strong); }
.res-cells.res-help .res-cell.on { background: var(--line-strong); }
.res-scale { margin-top: 8px; }
.res-bar { height: 14px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--paper); overflow: hidden; }
.res-bar-fill { display: block; height: 100%; background: var(--res-hours); }
.res-bar-money .res-bar-fill { background: var(--res-money); }
.res-bar.over { border-color: var(--bad); }
.res-bar.over .res-bar-fill { background: var(--bad); }
.res-ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--fine); font-variant-numeric: tabular-nums; margin-top: 2px; }

.res-items { margin: 4px 0 0; display: grid; gap: 2px; }
.res-items > div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.res-items dt { color: var(--soft); }
.res-items dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.res-items .res-total { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 2px; }
.res-items .res-total dt { color: var(--ink); font-weight: 600; }

.res-log { border: 1px solid var(--line); border-radius: 6px; background: var(--paper); padding: 12px 14px; }
.res-log h3 { font-size: 16px; margin: 0 0 4px; }
.res-log p { margin: 0; }
.res-log-group { font-weight: 600; font-size: 14px; color: var(--soft); margin-top: 6px !important; }
.res-log-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 1px 0; }
.res-log-row b { color: var(--res-money); white-space: nowrap; font-variant-numeric: tabular-nums; }
.res-log-total { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 6px !important; padding-top: 4px; font-weight: 600; }
.res-log-more > summary { cursor: pointer; font-size: 14px; min-height: 32px; display: flex; align-items: center; }

.res-price-line { margin: 4px 0 0; font-size: 15px; color: var(--res-money); font-weight: 600; }
.res-money-inline { color: var(--res-money); }

.res-ladder { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; margin: 0; }
.res-step { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; background: var(--paper); }
.res-step.past { color: var(--fine); background: var(--tint); }
.res-step.here { border: 2px solid var(--res-money); background: var(--res-money-pale); }
.res-step-name { font-size: 14px; }
.res-step-mult { font-size: 20px; }
.res-step-price { font-weight: 600; color: var(--res-money); font-variant-numeric: tabular-nums; }
.res-compare .res-total td { font-weight: 700; border-top: 2px solid var(--line-strong); }
.res-compare-conveyor { max-width: 520px; margin-top: 10px; }

.side .res-cards .res-card, .side .res-log, .d-panel .res-cards .res-card, .d-panel .res-log { box-shadow: none; }
.side .side-score, .d-panel .d-panel-score { font-size: 15px; }

@media (max-width: 700px) {
  .student-top .top-meta .res-top { grid-column: 1 / -1; grid-row: 3; justify-self: start; margin-top: 4px; white-space: normal; }
  .res-ladder { grid-template-columns: 1fr 1fr; }
}
@media print {
  .res-top, .res-cards, .res-log { display: none !important; }
}
/* ---------------------------------------------------------------- задача 29: контакты и требования сторон */

.contact-cards { display: grid; gap: 10px; }
.contact-card { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.contact-card .bio { margin: 0; }
.contact-card p { margin: 0; }
.contact-leads { display: grid; gap: 6px; margin: 8px 0 12px; }
.contact-leads h4 { margin: 0; }
.lead-list { display: grid; gap: 6px; }
.lead-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: 6px; }
.lead-row .person { flex: 1 1 220px; }
.lead-row p { margin: 0; flex: 1 1 200px; }
.contact-quadrant > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; font-size: 15px; }
.plan-list { display: grid; gap: 8px; margin-top: 8px; }
.plan-row { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.plan-row p { margin: 0; }
.sources-map { margin: 8px 0 12px; border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; background: var(--paper); }
.sources-map > summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-weight: 600; }
.sources-map-body { display: grid; gap: 8px; padding-bottom: 8px; }

.side-req-list { display: grid; gap: 8px; margin-top: 8px; }
.side-req { display: grid; gap: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; }
.side-req p { margin: 0; }
.side-req-text { font-size: 17px; }
.side-results { margin-top: 10px; }
.side-results > summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; font-weight: 600; }
.side-results li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.side-conflict p { margin: 0; }
.stack-toggles { display: grid; gap: 4px; }
.stack-toggles .toggle { text-align: left; justify-content: flex-start; white-space: normal; }
.side-req-line { display: block; font-size: 14px; color: var(--soft); }
.side-req-from { margin: 4px 0 0 0; }
.tree-from { margin: 2px 0 0; }
.sr-picked { align-items: center; gap: 8px; }
.sr-picked .chip { white-space: normal; text-align: left; }

/* ---------------------------------------------------------------- задача 31: короткие «Требования сторон», рамки заказа */
.side-req-list { gap: 6px; grid-template-columns: minmax(0, 1fr); }
.side-req { gap: 2px; padding: 8px 12px; min-width: 0; grid-template-columns: minmax(0, 1fr); }
.side-req > * { min-width: 0; }
.side-req-who { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.side-req-who .person { gap: 8px; font-size: 15px; }
.side-req-who .face img { width: 32px; height: 32px; }
.side-req-way { font-size: 15px; }
.sr-evidence > summary { display: block; list-style: none; cursor: pointer; min-height: 28px; line-height: 28px; font-size: 14px; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-evidence > summary::-webkit-details-marker { display: none; }
.sr-evidence > summary::before { content: "\25B8\00A0"; }
.sr-evidence[open] > summary::before { content: "\25BE\00A0"; }
.sr-evidence[open] > summary { white-space: normal; }
.sr-evidence .evidence { margin: 2px 0 4px; }
.sr-compose .picker { max-height: 18rem; overflow-y: auto; }
.sr-limits { margin: 8px 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); }
.sr-limits > summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; font-weight: 600; }
.sr-limit-list li { padding: 3px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.sr-limit-list li:last-child { border-bottom: 0; }
.sr-group { margin: 6px 0 0; font-weight: 600; }
.next-bar .next-note { margin: 0; flex: 1 1 280px; }
.sr-fold { margin: 8px 0; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper); padding: 0 12px; }
.sr-fold > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--accent-deep); }
.sr-fold[open] { padding-bottom: 10px; }
.sr-fold .compose { border: 0; padding: 0; margin: 0; }
.sr-fold .compose > h4 { display: none; }
.d-board .d-board-scene.sr-strip { aspect-ratio: 16 / 1.3; }
@media (max-width: 700px) { .d-board .d-board-scene.sr-strip { aspect-ratio: 16 / 3; } }

/* ---------------------------------------------------------------- задача 32: карточки нужд, разделы ТЗ, полнота перехода */
.tz-section-title { margin: 14px 0 4px; font-size: 16px; color: var(--accent-deep); }
.req-head .req-section { margin-left: auto; font-size: 13px; white-space: normal; }
.section-hint { margin: 4px 0 0; }
.card-parts { margin: 6px 0 2px; padding: 6px 10px; border-left: 3px solid var(--line-strong); background: var(--paper); }
.card-parts .label-like { margin: 0 0 2px; }
.card-parts-list li { padding: 2px 0; font-size: 15px; }
.card-parts-list .chip { font-size: 12px; }
.card-parts > p.fine { margin: 2px 0 0; }
.review-card-parts { margin: 6px 0; }
.review-card-parts > p { margin: 0; }

/* ---------------------------------------------------------------- задача 33: краткие строки ТЗ и программы приемки */
.card-parts > summary, .verification-program > summary, .tz-acceptance > summary, .req-reference > summary { cursor: pointer; padding: 5px 0; font-size: 15px; }
.card-parts:not([open]) { padding-top: 2px; padding-bottom: 2px; }
.req-reference { margin: 8px 0; }
.verification-program, .tz-acceptance { margin: 5px 0; }
.verification-program .facts { margin: 6px 0; }
.verification-program .facts dd { overflow-wrap: anywhere; }
.acceptance-item { padding: 6px 12px; border-left: 2px solid var(--line); }
.acceptance-item h4 { margin: 4px 0; }
.req-fold { padding: 8px 12px; }
.req-fold > summary { cursor: pointer; display: list-item; }
.req-fold > summary > span { margin-right: 8px; }
.req-fold .req-brief { font-size: 15px; }
.req-fold[open] > summary { margin-bottom: 10px; }
@media (max-width: 700px) {
  .verification-program .facts > div { grid-template-columns: minmax(0, 1fr); }
  .verification-program .facts dd { margin-left: 0; }
  .req-fold .req-brief { display: block; }
}
/* Persistent participant account; the same controls work on phone and desktop. */
.account-form { display: grid; gap: .7rem; width: 100%; min-width: 0; }
.account-entry { display: grid; gap: 16px; max-width: 760px; margin: 24px auto; padding: 24px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.account-entry > section { display: grid; gap: 8px; }
.account-entry details > label { display: block; margin-top: 12px; }
.account-entry details textarea { width: 100%; min-height: 90px; }
@media (max-width: 700px) { .account-entry { margin: 12px 0; padding: 16px; } }
.account-form input, .account-form button { min-height: 44px; width: 100%; box-sizing: border-box; }
.account-entry > button { width: 100%; }
.account-entry button { min-height: 44px; max-width: 100%; white-space: normal; overflow-wrap: break-word; }
.account-form label { margin-top: .4rem; }
.entry-pin { display: block; font-size: 2.5rem; font-weight: 700; letter-spacing: .2em; margin: 1rem 0; }
.access-qr { display: block; background: white; max-width: 100%; margin: 1rem 0; }
/* Первый урок: требования заинтересованных сторон. */
.sl-layout { position: fixed; inset: 84px 12px 12px; z-index: 1; max-width: 1580px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.sl-nav { display: flex; flex: 0 0 auto; gap: 8px; }
.sl-nav button { flex: 1; white-space: normal; }
.sl-lesson-support { flex: 0 0 auto; min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; }
.sl-lesson-guide { max-height: min(18rem, 30dvh); overflow: auto; padding: 6px 12px; }
.sl-lesson-guide > summary { cursor: pointer; font-weight: 650; min-height: 30px; }
.sl-lesson-guide p { margin: 8px 0; font-size: 14px; }
.sl-guide-counts { margin-left: 16px; color: var(--soft); font-size: 13px; font-weight: 400; }
.sl-guide-progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 4px; }
.sl-guide-progress button { min-width: 0; min-height: 40px; padding: 5px; font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
.teacher-session-settings > summary { cursor: pointer; padding: 4px 0; }
.teacher-session-settings form { margin-top: 12px; }
@media(max-width:600px) { .sl-guide-counts { display: none; } .sl-guide-progress { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sl-guide-progress button { font-size: 12px; } }
.sl-current { background: var(--accent-pale); border-color: var(--accent); color: var(--accent-deep); font-weight: 700; }
.sl-status { margin: 0; flex: 0 0 auto; padding: 4px 10px; background: var(--warn-pale); font-size: 14px; }
.sl-windows { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); gap: 12px; flex: 1 1 auto; min-height: 0; }
.sl-window { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 6px; }
.sl-window-title { flex: 0 0 auto; padding: 12px 14px 8px; font-size: 20px; }
.sl-window h2 { font-size: 17px; }
.sl-window h3 { font-size: 16px; }
.sl-window button { white-space: normal; }
.sl-tabs { display: flex; gap: 6px; padding: 0 12px 8px; flex: 0 0 auto; }
.sl-tabs button { flex: 1; padding: 6px 8px; font-size: 14px; }
.sl-subnav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0 10px 8px; flex: 0 0 auto; }
.sl-subnav button { min-height: 44px; padding: 6px; font-size: 14px; }
.sl-package-progress { margin: 0; padding: 0 12px 8px; flex: 0 0 auto; color: var(--soft); font-size: 14px; }
.sl-talk-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 13rem; min-height: 0; flex: 1 1 auto; border-top: 1px solid var(--line); }
.sl-contacts-toggle { display: none; }
.sl-notebook-workspace { grid-template-columns: minmax(0, 1fr); }
.sl-notebook-workspace .sl-contacts { display: none; }
.sl-conversation { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.sl-scroll, .sl-messages { overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; min-height: 0; scrollbar-gutter: stable; }
.sl-messages { padding: 12px; flex: 1 1 auto; }
.sl-message { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sl-question { color: var(--accent-deep); font-weight: 600; }
.sl-reply { white-space: pre-wrap; }
.sl-mood { display: block; background: var(--tint); border-radius: 4px; padding: 5px 8px; color: var(--soft); font-size: 14px; }
.sl-fact { padding: 8px 0; border-top: 1px solid var(--line); }
.sl-fact > button { margin: 4px 6px 0 0; padding: 6px 10px; font-size: 14px; }
.sl-contacts { min-width: 0; padding: 12px 8px; border-left: 1px solid var(--line); background: var(--tint); overflow-wrap: normal; word-break: normal; }
.sl-contacts h2 { margin-bottom: 8px; }
.sl-contact-list { display: grid; gap: 6px; }
.sl-contact { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; text-align: left; font-size: 14px; line-height: 1.4; overflow-wrap: normal; word-break: normal; hyphens: none; }
.sl-contact-name { display: block; }
.sl-contact-role { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--soft); }
.sl-chat-form { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; }
.sl-field { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 14px; font-weight: 600; }
.sl-field textarea, .sl-field select { width: 100%; box-sizing: border-box; font: inherit; font-weight: 400; padding: 8px; min-width: 0; }
.sl-chat-form textarea { resize: none; max-height: 100px; }
.sl-dialogue-escape { padding: 8px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--tint); max-height: 24dvh; overflow-y: auto; }
.sl-dialogue-escape button { width: 100%; }
.sl-layout > .sl-disclosure { flex: 0 0 auto; margin: 0; padding: 4px 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 4px; max-height: 25dvh; overflow-y: auto; }
.sl-note-filters { display: grid; gap: 8px; padding: 8px; margin-bottom: 12px; background: var(--tint); }
.sl-note-filters input, .sl-note-filters select { width: 100%; min-width: 0; }
.sl-note-filters .sl-field { margin: 0; }
.sl-preflight { margin: 8px 0; padding: 8px; border: 1px solid var(--line); background: var(--tint); }
.sl-fields { display: grid; gap: 8px; margin: 8px 0; }
.sl-requirements { padding: 0 14px 14px; flex: 1 1 auto; }
.sl-compose, .sl-saved, .sl-check-area { padding: 12px 0; border-bottom: 1px solid var(--line); }
.sl-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.sl-evidence { padding: 6px 10px; margin: 10px 0; border: 1px solid var(--line); max-height: min(18rem, 45dvh); overflow-y: auto; }
.sl-evidence-tools { position: sticky; top: -6px; z-index: 1; padding: 6px 0; background: var(--paper); border-bottom: 1px solid var(--line); }
.sl-evidence-tools input { font-size: 16px; }
.sl-evidence-tools .fine { margin: 3px 0; }
.sl-evidence legend { font-size: 14px; font-weight: 600; }
.sl-check { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0; font-size: 14px; font-weight: 400; }
.sl-check input { flex: 0 0 auto; }
.sl-evidence-source { display: block; font-size: 12px; color: var(--fine); }
.sl-notebook { padding: 12px; flex: 1 1 auto; }
.sl-ceiling { font-weight: 700; color: var(--accent-deep); }
.sl-result { margin-top: 12px; padding: 10px; background: var(--tint); border-radius: 4px; }
.sl-warning { color: var(--bad); font-weight: 600; }
.sl-history { margin-top: 12px; }
.sl-preview { margin: 8px 0; padding: 10px; background: var(--accent-pale); border-left: 3px solid var(--accent); font-size: 15px; }
.sl-rationale { font-size: 14px; white-space: pre-wrap; color: var(--soft); }
.sl-requirement-card, .sl-question-card { margin: 10px 0; padding: 10px; border: 1px solid var(--line); border-radius: 4px; }
.sl-requirement-card > button, .sl-question-card > button { margin: 6px 6px 0 0; padding: 6px 8px; font-size: 14px; }
.sl-disclosure { margin: 6px 0; font-size: 14px; }
.sl-disclosure > summary { cursor: pointer; padding: 4px 0; color: var(--accent-deep); }
.sl-disclosure .sl-disclosure { margin-left: 8px; }
.sl-full-text { white-space: pre-wrap; font-size: 14px; }
.sl-evidence-row { padding: 5px 0; border-bottom: 1px solid var(--line); }
.sl-evidence-row:last-child { border-bottom: 0; }
.sl-evidence-row .sl-check { margin: 0; }
.sl-evidence-row > .sl-disclosure { margin: 2px 0 0 30px; }
.sl-notebook-section { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line-strong); }
.sl-notebook > .sl-notebook-section:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
.sl-compose, .sl-saved, .sl-check-area, .sl-limits-list { scroll-margin-top: 76px; }
.sl-gap-form { display: grid; gap: 8px; margin: 12px 0; }
.sl-calculation { display: grid; gap: 6px; padding: 8px; background: var(--tint); }
.sl-calculated { color: var(--good); font-size: 14px; }
.sl-row-results { margin-top: 14px; }
.sl-row-result { padding: 8px 0; border-top: 1px solid var(--line-strong); }
.sl-row-status { font-weight: 600; font-size: 14px; }
.sl-visual { padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.sl-route-image { display: block; width: 100%; height: auto; margin: 8px 0; background: var(--tint); }
.sl-route-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 8px 0; }
.sl-route-controls button { min-height: 44px; padding: 6px 8px; font-size: 13px; }
.sl-route-controls button[aria-pressed="true"] { background: var(--accent-pale); border-color: var(--accent); font-weight: 600; }
.sl-route-inputs { display: grid; gap: 5px; font-size: 14px; margin: 8px 0; }
.sl-route-inputs > div { display: flex; justify-content: space-between; gap: 8px; }
.sl-route-inputs dd { margin: 0; font-weight: 600; }
.sl-penalty-chart { display: grid; gap: 14px; margin: 10px 0; }
.sl-penalty-group h3 { font-size: 15px; margin-bottom: 8px; }
.sl-penalty-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; margin: 8px 0; font-size: 14px; }
.sl-penalty-count { font-weight: 700; font-variant-numeric: tabular-nums; }
.sl-penalty-track { display: block; grid-column: 1 / -1; height: 9px; margin-top: 3px; background: var(--tint); border-radius: 2px; overflow: hidden; }
.sl-penalty-bar { display: block; height: 100%; background: var(--accent); }
.sl-evidence-chain { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 0; margin: 10px 0; list-style: none; }
.sl-chain-node { position: relative; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 4px; font-size: 14px; }
.sl-chain-node h3 { font-size: 14px; }
.sl-chain-node:not(:last-child)::after { content: "→"; position: absolute; right: -17px; top: 10px; font-size: 18px; color: var(--soft); }
.sl-chain-source + .sl-chain-source { margin-top: 8px; border-top: 1px solid var(--line); }
.sl-chain-source-name { font-weight: 600; font-size: 13px; }
.sl-chain-questions { border-top: 1px solid var(--line); padding-top: 8px; }
.sl-chain-question { padding-top: 4px; }
/* Two panes need room for readable messages and a full-width contact name. */
@media (min-width:1280px) and (max-width:1535px) {
  .sl-talk-workspace { grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); }
  .sl-contacts-toggle { display:flex; justify-content:space-between; margin:6px 8px; min-height:44px; }
  .sl-contacts-toggle::after { content:"▾"; }
  .sl-talk-workspace > .sl-conversation { grid-column:1; grid-row:2; }
  .sl-talk-workspace > .sl-contacts { display:none; }
  .sl-talk-workspace[data-contacts-open="true"] { grid-template-rows:auto auto minmax(0,1fr); }
  .sl-talk-workspace[data-contacts-open="true"] > .sl-contacts { display:block; grid-row:2; max-height:28dvh; border-left:0; }
  .sl-talk-workspace[data-contacts-open="true"] > .sl-conversation { grid-row:3; }
  .sl-contact-list { grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); }
  .sl-notebook-workspace { grid-template-rows:minmax(0,1fr); }
  .sl-notebook-workspace > .sl-conversation { grid-row:1; }
}
@media (max-width: 1279px) {
  .sl-windows { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 0; }
  .sl-window[data-active="false"] { display: none; }
  .sl-evidence-chain { grid-template-columns: minmax(0, 1fr); }
  .sl-chain-node:not(:last-child)::after { content: "↓"; top: auto; right: auto; bottom: -22px; left: calc(50% - 5px); }
}
@media (max-width: 640px), (max-height: 640px) {
  .sl-layout { left: 6px; right: 6px; bottom: 6px; gap: 6px; }
  .sl-nav { gap: 6px; }
  .sl-nav button { font-size: 13px; padding: 6px; }
  .sl-window-title { font-size: 16px; padding: 6px 10px; }
  .sl-tabs { padding: 0 6px 4px; gap: 4px; }
  .sl-tabs button { font-size: 14px; min-height: 44px; padding: 6px; }
  .sl-talk-workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .sl-contacts-toggle { display: flex; align-items: center; justify-content: space-between; grid-row: 1; margin: 6px 8px; min-height: 44px; padding: 6px 10px; text-align: left; font-size: 14px; }
  .sl-contacts-toggle::after { content: "▾"; }
  .sl-contacts-toggle[aria-expanded="true"]::after { content: "▴"; }
  .sl-conversation { grid-column: 1; grid-row: 2; }
  .sl-contacts { display: none; }
  .sl-talk-workspace[data-contacts-open="true"] { grid-template-rows: auto auto minmax(0, 1fr); }
  .sl-talk-workspace[data-contacts-open="true"] .sl-contacts { display: block; grid-column: 1; grid-row: 2; max-height: min(32dvh, 16rem); border-left: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .sl-talk-workspace[data-contacts-open="true"] .sl-conversation { grid-row: 3; }
  .sl-contact-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
  .sl-notebook-workspace { grid-template-rows: minmax(0, 1fr); }
  .sl-notebook-workspace .sl-conversation { grid-row: 1; }
  .sl-notebook-workspace .sl-contacts { display: none; }
  .sl-messages, .sl-notebook { padding: 6px 8px; }
  .sl-contacts h2, .sl-messages h2, .sl-notebook h2 { font-size: 16px; }
  .sl-chat-form { padding: 4px 8px; gap: 4px; }
  .sl-chat-form textarea { min-height: 64px; height: 64px; line-height: 1.4; font-size: 16px; }
  .sl-chat-form button { min-height: 44px; padding: 6px; font-size: 14px; }
  .sl-chat-form .sl-field { font-size: 14px; }
  .sl-dialogue-escape p { font-size:13px; line-height:1.35; margin:0 0 4px; }
  .sl-window select, .sl-window textarea { font-size: 16px; }
  .sl-requirements { padding: 0 10px 10px; }
}
/* Let short landscape screens and an open keyboard use ordinary page scrolling. */
@media (max-height: 640px) {
  .v5d main:has(> .sl-layout) { padding: 8px 6px; }
  .sl-layout { position: static; margin: 0; }
  .sl-window { overflow: visible; }
  .sl-messages { flex: 0 0 auto; min-height: 12rem; max-height: 60dvh; }
  .sl-requirements { overflow: visible; }
  .sl-nav { position: sticky; top: 0; z-index: 2; padding: 4px 0; background: var(--bg); }
}

/* Final results: stable #app is the fullscreen element, including during polling. */
#app:fullscreen { background:#f5f1e8; overflow:auto; padding:clamp(12px,3vw,48px); box-sizing:border-box; }
.final-rating { box-sizing:border-box; max-width:1400px; margin:24px auto; padding:clamp(16px,3vw,40px); background:#fffdf7; border:1px solid #d8d2c4; border-radius:16px; color:#203237; }
.final-rating-header { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; flex-wrap:wrap; }
.final-rating h1 { font-size:clamp(24px,3.4vw,46px); line-height:1.15; margin:4px 0 20px; overflow-wrap:anywhere; }
.final-rating-eyebrow { color:#52676b; margin:0; }
.final-rating-controls { display:flex; gap:8px; flex-wrap:wrap; }
.final-rating-controls button { white-space:normal; min-height:44px; max-width:100%; }
.final-rating-own { border-left:5px solid #246860; background:#e8f2ee; border-radius:8px; padding:16px 24px; margin:16px 0; }
.final-rating-own p { margin:0; }
.final-rating-own strong { display:block; font-variant-numeric:tabular-nums; font-size:clamp(32px,5vw,64px); }
.final-rating-status { color:#52676b; }
.final-rating-table { width:100%; table-layout:fixed; border-collapse:collapse; font-size:clamp(16px,2vw,26px); }
.final-rating-table th, .final-rating-table td { text-align:left; padding:16px 12px; border-bottom:1px solid #ddd8cc; vertical-align:middle; }
.final-rating-table th { font-size:.75em; color:#52676b; font-weight:600; }
.final-rating-table th:first-child { width:12%; }
.final-rating-table th:nth-child(3), .final-rating-table th:nth-child(4) { width:16%; }
.final-rating-name { overflow-wrap:anywhere; }
.final-rating-place, .final-rating-score { font-variant-numeric:tabular-nums; font-weight:750; }
.final-rating-table tr.final-rating-me { background:#e8f2ee; }
.final-rating-note { font-size:15px; color:#52676b; line-height:1.5; margin-top:24px; }
.final-rating-empty { padding:32px 0; }
@media(max-width:600px) {
 .final-rating { margin:12px 0; border-radius:10px; padding:14px; }
 .final-rating-header { gap:8px; }
 .final-rating-controls { width:100%; }
 .final-rating-controls button { flex:1 1 140px; }
 .final-rating-table th, .final-rating-table td { padding:12px 5px; }
 .final-rating-table th:first-child { width:44px; white-space:nowrap; }
 .final-rating-table th:nth-child(3) { width:20%; }
 .final-rating-table th:nth-child(4), .final-rating-checks { display:none; }
}
.sl-legend { max-width:720px; margin:clamp(20px,6vh,70px) auto; padding:clamp(22px,4vw,44px); border:1px solid #d8d2c4; border-radius:18px; background:#fffdf7; color:#203237; line-height:1.6; }
.sl-legend h1 { font-size:clamp(26px,4vw,40px); line-height:1.2; margin:8px 0 24px; }
.sl-legend-eyebrow { color:#52676b; font-size:14px; letter-spacing:.02em; }
.sl-legend-request { margin:24px 0; padding:14px 22px; border-left:4px solid #28726d; background:#e8f1ed; font-size:clamp(21px,3vw,27px); }
.sl-legend-request p { margin:0; }
.sl-legend button { min-height:48px; margin-top:16px; }
.sl-admin-note { padding:8px 12px; border:1px solid #caa55e; background:#fff4d8; font-size:14px; border-radius:6px; }
.sl-layout > .sl-admin-note { margin:0; }
.sl-evidence-art { margin:10px 0; border:1px solid #c5d6cf; border-radius:10px; padding:10px 12px; background:#fcfdf9; }
.sl-evidence-art summary { color:#256860; font-weight:650; cursor:pointer; min-height:30px; }
.sl-evidence-svg { display:block; width:100%; height:auto; margin:12px 0; }
.sl-evidence-facts { display:flex; gap:12px; flex-wrap:wrap; }
.sl-evidence-facts p { flex:1 1 150px; margin:0; padding:10px; background:#e8f1ed; border-radius:8px; }
@media(max-width:600px) { .sl-legend { margin:16px 0; border-radius:10px; } .sl-legend button { width:100%; } .sl-evidence-art { padding:8px; } }

/* Requirements: one decision at a time, alongside the interview. */
.account-extra { margin:10px 0; }
.account-extra > summary { cursor:pointer; padding:8px 0; min-height:44px; box-sizing:border-box; color:var(--accent-deep); }
.account-extra > button, .account-resume > button { width:100%; }
.account-resume { margin:14px 0; padding:12px; border:1px solid var(--line); border-radius:6px; background:var(--tint); }
.account-resume h2 { font-size:18px; margin:0 0 6px; }
.account-resume p { margin:6px 0 12px; }
.account-lesson-form { display:grid; gap:8px; margin:20px 0; }
.account-lesson-form > button { width:100%; }
.sl-dialogue-person { flex:0 0 auto; display:flex; align-items:center; gap:10px; padding:8px 12px; border-bottom:1px solid var(--line); }
.sl-dialogue-meta { min-width:0; }
.sl-speaker-avatar { box-sizing:border-box; width:48px; height:48px; flex:0 0 auto; border-radius:50%; overflow:hidden; display:grid; place-items:center; border:1px solid var(--line); background:var(--tint); }
.sl-speaker-avatar img { display:block; width:100%; height:100%; object-fit:cover; transform:scale(1.45); transform-origin:50% 25%; }
.sl-speaker-avatar .d-monogram { font-size:18px; color:var(--accent-deep); }
@media(max-width:600px) { .sl-speaker-avatar { width:40px; height:40px; } }
.sl-dialogue-person h2 { margin:0; }
.learning-review { margin:16px 0; padding:16px; border:1px solid var(--line); border-radius:6px; text-align:left; }
.learning-review h2 { font-size:22px; margin:0 0 10px; }
.learning-review h3 { font-size:17px; margin:0 0 6px; }
.learning-section, .learning-requirement { padding:12px 0; border-bottom:1px solid var(--line); }
.learning-review p { margin:6px 0; overflow-wrap:anywhere; }
.learning-review blockquote { margin:12px 0; padding:0 12px; border-left:3px solid var(--line); }
.learning-fold > summary { min-height:44px; display:list-item; padding:10px 6px; }
:fullscreen .learning-review { display:none; }
@media(max-width:600px) { .learning-review { padding:12px; } }
.sl-dialogue-person p { margin:2px 0 0; }
.sl-new-contacts { flex:0 0 auto; padding:4px 8px; background:var(--accent-pale); }
.sl-new-contacts button { width:100%; min-height:44px; text-align:left; font-size:14px; }
.sl-pin-control { margin:4px 0; }
.sl-pin-control > button { min-height:44px; padding:6px 10px; font-size:14px; }
.sl-note-filters > .sl-disclosure { margin:0; }
.sl-note-filters .sl-field { margin:6px 0; }
.sl-note-filters > p { margin:0; }
.sl-note-filters > button[hidden], .sl-note-empty[hidden] { display:none; }
.sl-note-empty { padding:12px; background:var(--tint); }
.sl-row-result > button { min-height:44px; margin-top:8px; }
.sl-package-tabs button { min-width:0; overflow-wrap:normal; word-break:normal; }
.sl-package-tools { padding:8px 0 12px; }
.sl-package-tools button { width:100%; }
.sl-draft-wizard { border-bottom:0; padding-top:2px; }
.sl-draft-wizard h2 { margin-top:4px; }
.sl-draft-wizard h3 { font-size:17px; margin:12px 0; }
.sl-draft-steps { display:flex; gap:5px; }
.sl-draft-steps button { flex:1; min-width:0; padding:8px 4px; font-size:13px; overflow-wrap:normal; word-break:normal; }
.sl-draft-steps [aria-current=step] { background:var(--green-soft, #e8f1ed); border-color:#256860; font-weight:650; }
.sl-draft-controls { margin-top:16px; display:flex; flex-wrap:wrap; gap:8px; }
.sl-draft-controls button { flex:1 1 auto; margin:0; min-height:44px; }
.sl-draft-error[hidden] { display:none; }
.sl-draft-error { margin:12px 0; }
.sl-draft-status { font-size:12px; }
.sl-saved-notice { padding:8px 12px; background:#e8f1ed; color:#235e56; border-radius:6px; }
.sl-requirement-card > p:first-child { margin-top:0; }
.sl-requirement-card .sl-controls { display:flex; gap:8px; flex-wrap:wrap; margin-top:12px; }
.sl-requirement-card .sl-controls button { min-height:44px; }
.top-inner.student-top.sl-student-top { display:grid; grid-template-columns:minmax(0,1fr) auto auto; }
.sl-student-top .brand { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.sl-student-top .sl-header-tools { display:flex; align-items:center; gap:6px; flex-wrap:nowrap; }
.v5d .top .sl-header-icon { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; padding:0; background:transparent; border-color:#8fa09c; color:#fff; }
.v5d .top .sl-header-icon:hover:not(:disabled) { border-color:#fff; background:#ffffff18; }
.v5d .top .sl-header-icon:disabled { opacity:.4; }
.sl-header-icon svg { flex:none; }
.v5d .top .sl-student-top button.menu-btn { min-width:44px; min-height:44px; }
@media(max-width:700px) {
  .top-inner.student-top.sl-student-top { grid-template-columns:minmax(0,1fr) auto; gap:4px 8px; }
  .sl-student-top .brand { grid-column:1; grid-row:1; font-size:18px; }
  .sl-student-top .brand span { display:none; }
  .sl-student-top .sl-header-tools { grid-column:2; grid-row:1; gap:4px; }
  .sl-student-top .top-meta { grid-column:1 / -1; grid-row:2; display:flex; flex-wrap:nowrap; gap:8px; }
  .sl-student-top .top-meta .who { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .sl-student-top .top-meta .phase { flex:none; }
  .v5d .top .sl-student-top button.menu-btn { width:44px; height:44px; padding:0; justify-content:center; }
  .sl-student-top .menu-btn-text { display:none; }
}
@media(max-width:400px) {
  .sl-package-tabs button { font-size:12px; padding:6px 3px; }
  .sl-draft-steps button { font-size:11px; min-height:44px; padding:4px 2px; }
  .sl-draft-step-number { display:block; }
}

/* Conversation first; evidence remains available without duplicating the reply. */
.sl-message { padding: 14px 2px; }
.sl-question { margin: 0 0 8px; font-size: 14px; line-height: 1.45; }
.sl-reply { margin: 0; max-width: 72ch; line-height: 1.6; overflow-wrap: anywhere; }
.sl-message-evidence { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 7px; }
.sl-message-evidence > .sl-disclosure { min-width: 0; flex: 1; margin: 0; font-size: 13px; color: var(--soft); }
.sl-message-evidence > .sl-disclosure > summary { min-height: 36px; display: flex; align-items: center; cursor: pointer; }
.sl-message-evidence > .sl-disclosure > summary::before { content: '▸'; margin-right: 7px; }
.sl-message-evidence > .sl-disclosure[open] > summary::before { content: '▾'; }
.sl-message-evidence .sl-full-text { font-size: 14px; line-height: 1.5; color: var(--ink); }
.sl-pin-compact { flex: 0 0 auto; max-width: 65%; }
.sl-pin-compact > button { min-height: 36px; padding: 6px 10px; font-size: 13px; white-space: nowrap; }
.sl-pin-compact > button[aria-pressed='true'] { color: var(--accent-deep); background: var(--tint); border-color: transparent; }
.sl-pin-compact:has(.sl-warning) { flex: 0 1 65%; white-space: normal; }
.sl-pin-compact .sl-controls { flex-wrap: wrap; }
.sl-pin-compact .sl-controls button { white-space: normal; }
.sl-messages { overflow-anchor: none; }
@media (max-width: 680px) {
 .sl-reply { font-size: 16px; line-height: 1.55; }
 .sl-message-evidence > .sl-disclosure > summary, .sl-pin-compact > button { min-height: 44px; }
 .sl-message { padding: 12px 0; }
}
.sl-chat-form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.sl-chat-form > .sl-field { grid-column: 1; }
.sl-chat-form > button[type='submit'] { grid-column: 2; align-self: end; width: 104px; min-height: 62px; padding: 8px; font-size: 14px; }
.sl-chat-form > button:not([type='submit']) { grid-column: 1 / -1; justify-self: start; min-height: 36px; padding: 4px 8px; font-size: 13px; border-color: transparent; background: transparent; }
.sl-chat-form > .sl-unread-reply, .sl-chat-form > .sl-dialogue-escape { grid-column: 1 / -1; }
@media (max-width:680px) {
 .sl-chat-form > button[type='submit'] { width: 86px; }
 .sl-chat-form > button:not([type='submit']) { min-height: 44px; }
}

/* One stable working surface. Size depends on viewport, never on dialogue data. */
.v5d .sl-layout { inset:64px 10px 10px; max-width:none; gap:6px; }
.v5d .top .top-inner.sl-student-top { height:58px; max-width:none; padding:6px 12px; gap:8px; }
.v5d .top .sl-student-top .brand { font-size:18px; }
.v5d .top .sl-student-top .brand span { display:none; }
.v5d .top .sl-student-top .top-meta { white-space:nowrap; flex-wrap:nowrap; font-size:13px; min-width:0; }
.sl-student-top .version-tag { display:none; }
.v5d .sl-nav { gap:6px; }
.v5d .sl-nav > button { flex:0 1 auto; min-width:160px; min-height:40px; padding:6px 14px; font-size:14px; }
.sl-admin-compact { margin-left:auto; align-self:center; font-size:12px; color:var(--soft); }
.v5d .sl-windows { display:flex; flex-direction:column; gap:0; }
.v5d .sl-window { flex:1; }
.v5d .sl-window[data-active='false'] { display:none; }
.v5d .sl-window-title { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; }
.v5d .sl-tabs { padding:4px 8px; gap:6px; }
.v5d .sl-tabs > button { flex:0 1 auto; min-width:120px; min-height:38px; font-size:14px; }
.v5d .sl-tabs > .sl-contacts-toggle { display:inline-flex; margin:0 0 0 auto; justify-content:space-between; align-items:center; min-width:140px; text-align:left; }
.sl-tabs .sl-contacts-toggle::after { content:'▾'; margin-left:6px; }
.v5d .sl-talk-workspace { position:relative; display:flex; flex-direction:column; grid-template:none; min-height:0; }
.v5d .sl-talk-workspace > .sl-conversation { position:relative; flex:1; min-height:0; }
.v5d .sl-talk-workspace > .sl-contacts { display:none; }
.v5d .sl-talk-workspace[data-contacts-open='true'] > .sl-contacts { display:block; position:absolute; z-index:8; top:0; right:0; width:min(100%,390px); max-height:75%; margin:0; border:1px solid var(--line-strong); background:var(--paper); box-shadow:0 4px 12px #20323722; }
.v5d .sl-contact-list { display:grid; grid-template-columns:minmax(0,1fr); }
.v5d .sl-dialogue-person { gap:8px; padding:5px 12px; height:46px; min-height:46px; }
.v5d .sl-speaker-avatar { width:32px; height:32px; }
.v5d .sl-dialogue-person h2 { font-size:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.v5d .sl-dialogue-person p { font-size:12px; margin:1px 0 0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.v5d .sl-dialogue-meta { flex:1; min-width:0; }
.v5d .sl-messages { padding:8px 16px; }
.v5d .sl-message { padding:10px 0; }
.v5d .sl-question { margin:0 0 5px; font-size:14px; }
.v5d .sl-reply { max-width:86ch; line-height:1.55; }
.sl-message-actions { display:flex; align-items:flex-start; gap:10px; margin-top:6px; max-width:86ch; }
.sl-message-actions > .sl-message-materials { flex:1; min-width:0; color:var(--soft); font-size:12px; }
.sl-message-materials > summary { cursor:pointer; padding:6px 0; min-height:30px; }
.sl-message-actions > .sl-quote-button { margin-left:auto; font-size:12px; min-height:30px; padding:4px 8px; border-color:transparent; background:transparent; color:var(--accent-deep); }
.v5d .sl-chat-form { position:relative; flex:none; padding:6px 10px; grid-template-columns:minmax(0,1fr) 104px; gap:4px 8px; border-top:1px solid var(--line); }
.v5d .sl-chat-form .sl-field { margin:0; font-size:0; }
.v5d .sl-chat-form textarea { height:56px; min-height:56px; resize:none; font-size:16px; line-height:1.35; }
.v5d .sl-chat-form > button[type='submit'] { width:104px; min-height:56px; align-self:stretch; font-size:14px; }
.sl-chat-tools { grid-column:1/-1; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px; min-height:32px; }
.sl-chat-tools .fine { font-size:11px; margin:0; }
.sl-chat-tools > button { flex:none; min-height:32px; padding:4px 6px; font-size:12px; border-color:transparent; background:transparent; color:var(--accent-deep); }
.sl-chat-tools .sl-loop-hint { order:-1; flex:1 0 100%; margin:2px 0; padding:7px 9px; background:var(--warn-pale); color:var(--text); font-size:13px; line-height:1.35; }
.v5d .sl-chat-form > .sl-unread-reply { position:absolute; bottom:calc(100% + 6px); right:12px; z-index:3; min-height:36px; padding:6px 10px; background:var(--paper); border-color:var(--accent); }
.sl-reply .sl-inline { display:inline; width:auto; min-width:0; min-height:0; margin:0; padding:0 1px; border:0; border-radius:0; background:transparent; color:inherit; font:inherit; text-align:left; vertical-align:baseline; text-decoration:underline dotted; text-underline-offset:3px; }
.sl-reply .sl-inline-contact { color:var(--accent-deep); font-weight:600; text-decoration-style:solid; }
.sl-reply .sl-inline-evidence { background:var(--accent-pale); text-decoration:none; }
.sl-reply .sl-inline-quote,.sl-reply .sl-inline.sl-quoted { background:var(--warn-pale); text-decoration:none; }
.sl-inline:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.sl-selection-tools { position:absolute; z-index:9; right:12px; bottom:112px; display:flex; gap:6px; padding:5px; border:1px solid var(--line-strong); border-radius:6px; background:var(--paper); box-shadow:0 3px 12px #20323722; }
.sl-selection-tools button { min-height:40px; font-size:13px; }
.sl-text-dialog { width:min(92vw,620px); max-height:82svh; margin:auto; padding:18px; overflow:auto; color:var(--ink); background:var(--paper); border:1px solid var(--line-strong); border-radius:8px; }
.sl-text-dialog::backdrop { background:#20323755; }
.sl-text-dialog-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.sl-text-dialog-head h2 { font-size:20px; }
.sl-text-dialog-head .sl-dialog-close { min-width:44px; font-size:22px; padding:0; }
.sl-text-dialog .sl-field { margin-top:12px; }
.sl-text-dialog textarea { min-height:150px; font-weight:400; font-size:16px; }
.sl-text-dialog > h3 { margin-top:20px; }
.sl-text-source { margin:10px 0; padding:10px 0; border-top:1px solid var(--line); }
.sl-text-source > button { width:100%; margin-top:8px; }
.sl-quote-card { padding:10px 0; border-bottom:1px solid var(--line); }
.sl-quote-card blockquote { margin:0; padding:8px 12px; border-left:3px solid var(--accent); white-space:pre-wrap; }
.sl-quote-card button { font-size:13px; margin:4px 6px 0 0; }
.sl-quotes { margin-bottom:18px; }
.sl-notebook-entry { min-width:0; padding:10px 0; border-bottom:1px solid var(--line); }
.sl-entry-quote { min-width:0; margin:0 0 8px; }
.sl-entry-quote blockquote { margin:0; padding:7px 9px; border-left:3px solid var(--accent); background:var(--accent-pale); white-space:pre-wrap; overflow-wrap:anywhere; }
.sl-entry-source { min-width:0; margin-top:9px; padding-top:8px; border-top:1px solid var(--line); }
.sl-entry-source > .sl-pin-control { display:inline-flex; }
.sl-entry-source button,.sl-entry-quotes button { min-height:34px; font-size:13px; margin:3px 3px 0 0; }
.sl-entry-source .sl-note-clues .sl-polaroid { max-width:150px; }
.sl-inquiry-queue { flex:0 0 auto; min-width:0; margin:0; border-bottom:1px solid var(--line); background:var(--paper); }
.sl-inquiry-queue > summary { padding:6px 12px; min-height:32px; box-sizing:border-box; font-size:13px; cursor:pointer; }
.sl-inquiry-queue-list { max-height:14rem; overflow:auto; overscroll-behavior:contain; padding:0 12px 8px; }
.sl-inquiry-item { padding:8px 0; border-top:1px solid var(--line); min-width:0; }
.sl-inquiry-question,.sl-inquiry-context,.sl-compare-choice,.learning-question,.learning-review-source { white-space:pre-wrap; overflow-wrap:anywhere; min-width:0; }
.sl-inquiry-queue-list .sl-field { font-size:12px; gap:3px; }
.sl-inquiry-queue-list select,.sl-inquiry-queue-list button { min-height:32px; padding:4px 7px; font-size:12px; }
.sl-inquiry-queue > .sl-inquiry-register { margin:0 12px 8px; min-height:30px; font-size:12px; }
.sl-source-compare { margin-bottom:10px; }
.sl-source-compare-form { padding:6px 0; }
.sl-compare-choices { max-height:14rem; min-width:0; overflow:auto; margin:8px 0; padding:6px; }
.sl-compare-choice { padding:6px 0; border-bottom:1px solid var(--line); }
.sl-compare-choice .sl-check { align-items:flex-start; }
.sl-inquiry-context { max-height:8rem; overflow:auto; padding-left:10px; border-left:3px solid var(--accent); }
.sl-rationale-count { font-size:14px; margin:4px 0 12px; }
.sl-rationale-source { padding-top:8px; border-top:1px solid var(--line); overflow-wrap:anywhere; }
.sl-rationale-dialog textarea { min-height:110px; }
.learning-source-links { display:flex; flex-wrap:wrap; gap:6px; }
.learning-source-link { white-space:normal; text-align:left; overflow-wrap:anywhere; max-width:100%; }
.learning-question { padding:8px 0; border-top:1px solid var(--line); }
.learning-review-source { margin:7px 0; }
:fullscreen .final-personal .learning-review { display:block; }
.final-personal .final-rating-own { display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 18px; padding:9px 14px; margin:10px 0; }
.final-personal .final-rating-own strong { font-size:30px; line-height:1.2; }
.final-personal .learning-review { margin:10px 0; }
.sl-legend-work { margin:18px 0; padding:12px 16px; background:var(--tint); border-radius:6px; }
.sl-legend-work h2 { font-size:18px; margin-bottom:8px; }
.sl-legend-admin { margin-top:12px; font-size:13px; color:var(--soft); }
.sl-legend-admin summary { cursor:pointer; min-height:32px; }
.sl-legend:has(.sl-intro-comic) { max-width:940px; }
.sl-intro-comic { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin:20px 0; }
.sl-comic-panel { min-width:0; margin:0; overflow:hidden; border:1px solid var(--line); border-radius:10px; background:var(--paper); }
.sl-comic-wide { grid-column:1/-1; }
.sl-comic-art { position:relative; overflow:hidden; background:var(--tint); }
.sl-comic-art img { position:absolute; max-width:none; height:auto; display:block; }
.sl-comic-panel figcaption { padding:12px 14px; font-size:15px; line-height:1.5; }
@media(max-width:560px){ .sl-intro-comic { grid-template-columns:minmax(0,1fr); gap:12px; } }
.sl-layout *, .sl-text-dialog *, .sl-legend * { animation:none!important; transition:none!important; scroll-behavior:auto!important; }
.v5d:has(.sl-layout) .banner { position:fixed; z-index:40; top:58px; left:10px; right:10px; max-height:6rem; overflow:auto; font-size:14px; }
@media(max-width:700px){
 .v5d .top .top-inner.sl-student-top { height:76px; padding:4px 10px; gap:0 8px; }
 .v5d .top .sl-student-top .top-meta { font-size:12px; margin:0; justify-content:flex-start; }
 .v5d .sl-layout { top:80px; left:4px; right:4px; bottom:4px; gap:4px; }
 .v5d .sl-nav > button { flex:1; min-width:0; min-height:40px; font-size:13px; padding:4px 6px; }
 .sl-admin-compact { display:none; }
 .v5d .sl-tabs { gap:4px; padding:3px 4px; }
 .v5d .sl-tabs > button { min-width:0; min-height:40px; flex:1; padding:4px 6px; font-size:13px; }
 .v5d .sl-tabs > .sl-contacts-toggle { min-width:0; margin:0; }
 .v5d .sl-dialogue-person { min-height:44px; padding:4px 10px; }
 .v5d .sl-messages { padding:6px 10px; }
 .v5d .sl-reply { font-size:16px; }
 .v5d .sl-chat-form { padding:4px 6px; grid-template-columns:minmax(0,1fr) 84px; gap:3px 6px; }
 .v5d .sl-chat-form textarea { min-height:52px; height:52px; }
 .v5d .sl-chat-form > button[type='submit'] { width:84px; min-height:52px; }
 .sl-chat-tools { min-height:38px; }
 .sl-chat-tools > button { min-height:38px; padding:3px 4px; }
 .sl-chat-tools .fine { max-width:62%; font-size:11px; }
 .sl-message-actions > .sl-quote-button,.sl-message-materials > summary { min-height:36px; }
 .v5d:has(.sl-layout) .banner { top:76px; left:4px; right:4px; }
 .sl-text-dialog { padding:12px; width:96vw; }
}
@media(max-height:640px){
 .v5d .sl-layout { position:static; margin:0; }
 .v5d .sl-window { overflow:visible; }
 .v5d .sl-messages { flex:none; min-height:12rem; max-height:65svh; }
 .v5d .sl-requirements { overflow:visible; }
}

/* Saved fragments use one continuous background, including spaces and links. */
.sl-reply .sl-inline { padding:0; white-space:inherit; background:transparent; }
.sl-reply-text,.sl-reply-text * { -webkit-user-select:text; user-select:text; }
.sl-saved-fragment { padding:0; color:inherit; background:#dcebe2; box-decoration-break:clone; -webkit-box-decoration-break:clone; }
.sl-saved-fragment[data-quote-tone='1'] { background:#bdd8c9; }

/* Notebook associations: fixed rail height, no animation or workspace resizing. */
.v5d .top .sl-clue-rail { display:flex; align-items:center; gap:10px; height:48px; padding:2px 12px 4px; border-top:1px solid #ffffff24; color:#fff; }
.v5d .top .sl-clue-count { flex:none; min-height:40px; padding:4px 8px; border:0; background:transparent; color:inherit; font-size:13px; text-align:left; }
.sl-clue-totals { display:block; color:#cfddd8; font-size:10px; line-height:1.3; white-space:nowrap; }
.sl-clue-cells { display:flex; align-items:center; gap:4px; min-width:0; overflow-x:auto; overscroll-behavior-x:contain; scrollbar-width:thin; }
.sl-clue-cell { display:flex; flex:none; align-items:center; justify-content:center; width:40px; height:40px; }
.sl-clue-empty::before { content:''; width:28px; height:28px; border:1px dashed #b1c2bd; border-radius:3px; background:#ffffff08; }
.v5d .top .sl-clue-found { display:block; width:40px; height:40px; min-width:40px; min-height:40px; padding:2px 2px 5px; border:1px solid #cfd9d5; border-radius:2px; background:#fffdf4; }
.sl-clue-found img { display:block; width:100%; height:100%; object-fit:cover; }
.v5d:has(.sl-clue-rail) .sl-layout { top:112px; }
.v5d:has(.sl-clue-rail):has(.sl-layout) .banner { top:106px; }
.sl-note-clues { display:grid; grid-template-columns:repeat(auto-fit,minmax(116px,1fr)); gap:10px; margin:0 0 12px; }
.sl-note-clues .sl-polaroid { max-width:140px; padding:5px 5px 8px; }
.sl-note-clues .sl-polaroid-caption { font-size:12px; margin-top:6px; }
.sl-polaroid { display:block; box-sizing:border-box; width:100%; max-width:240px; margin:0; padding:7px 7px 11px; border:1px solid #d7d2c7; border-radius:2px; background:#fffdf5; color:#283f42; box-shadow:1px 2px 4px #253d4020; white-space:normal; text-align:center; }
button.sl-polaroid { font:inherit; min-height:0; }
.sl-polaroid img { display:block; width:100%; height:auto; aspect-ratio:1; object-fit:cover; background:#e5eee8; }
.sl-polaroid-caption { display:block; margin-top:8px; font-size:13px; line-height:1.35; font-weight:600; }
.sl-clue-full { margin:0 auto 16px; max-width:260px; }
.sl-clue-full .sl-polaroid-caption { font-size:16px; }
.sl-clue-source { margin:12px 0; padding:10px 12px; background:var(--tint); border-left:3px solid var(--accent); }
.sl-clue-source h4 { margin:0 0 8px; font-size:14px; }
.sl-clue-source p { margin:0; font-size:15px; line-height:1.5; white-space:pre-wrap; }
.sl-clue-gallery { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:14px; margin-top:16px; }
.sl-clue-image-missing { background:#eef3ee!important; }
.sl-clue-found.sl-clue-image-missing::after { content:'✓'; color:#235d54; }
.sl-fact[data-note-fact]:focus { outline:2px solid var(--accent); outline-offset:3px; }
.sl-clue-rail *, .sl-clue-dialog * { animation:none!important; transition:none!important; }
@media(max-width:700px){
 .v5d .top .sl-clue-rail { gap:4px; padding:2px 6px 4px; }
 .v5d .top .sl-clue-count { font-size:12px; padding:3px 4px; }
 .v5d:has(.sl-clue-rail) .sl-layout { top:128px; }
 .v5d:has(.sl-clue-rail):has(.sl-layout) .banner { top:124px; }
}
.sl-reply-text::selection,.sl-reply-text *::selection { background:#b5d5c5; color:var(--ink); }
.sl-quote-card blockquote { background:#dcebe2; border-left-color:#98bdab; }
.sl-quote-card[data-quote-tone='1'] blockquote { background:#bdd8c9; border-left-color:#769f8b; }
.v5d .sl-contact { display:flex; align-items:center; gap:8px; border-radius:12px; }
.sl-contact-avatar { display:flex; align-items:center; justify-content:center; flex:0 0 32px; width:32px; height:32px; overflow:hidden; border-radius:50%; background:var(--accent-pale); }
.sl-contact-avatar img { display:block; width:100%; height:100%; object-fit:cover; }
.sl-contact-caption { min-width:0; }

/* Phones retain full-width tabs; larger screens show both working surfaces. */
.sl-notebook-pane { min-width:0; min-height:0; flex-direction:column; }
.v5d .sl-talk-workspace > .sl-notebook-pane { display:none; }
.v5d .sl-talk-workspace[data-notebook-open='true'] > .sl-conversation { display:none; }
.v5d .sl-talk-workspace[data-notebook-open='true'] > .sl-notebook-pane { display:flex; flex:1; }
.sl-notebook-heading { display:none; }
@media(min-width:1000px){
 .v5d .sl-talk-tabs { display:none; }
 .v5d .sl-talk-workspace { display:grid; grid-template-columns:minmax(0,65fr) minmax(0,35fr); grid-template-rows:auto minmax(0,1fr); }
 .v5d .sl-talk-workspace > .sl-conversation,
 .v5d .sl-talk-workspace[data-notebook-open='true'] > .sl-conversation { display:flex; grid-column:1; grid-row:2; }
 .v5d .sl-talk-workspace > .sl-notebook-pane,
 .v5d .sl-talk-workspace[data-notebook-open='true'] > .sl-notebook-pane { display:flex; grid-column:2; grid-row:2; border-left:1px solid var(--line); }
 .sl-notebook-heading { display:flex; align-items:center; min-height:46px; margin:0; padding:5px 12px; border-bottom:1px solid var(--line); font-size:16px; }
 .sl-notebook-pane .sl-subnav { padding:4px 8px; gap:4px; }
 .sl-notebook-pane .sl-subnav button { font-size:12px; min-height:36px; padding:4px; }
 .sl-notebook-pane .sl-notebook { padding:8px 12px; }
 .sl-notebook-pane .sl-notebook h2 { font-size:15px; }
 .sl-notebook-pane .sl-notebook p,.sl-notebook-pane blockquote { font-size:14px; }
 .sl-notebook-pane .sl-note-filters { padding:6px; }
 .sl-notebook-pane .sl-note-filters input { min-width:0; width:100%; }
 .sl-notebook-pane .sl-quote-card { padding:8px 0; }
 .sl-notebook-pane [data-key='sl-empty-notebook-back'] { display:none; }
 .v5d .sl-talk-workspace[data-contacts-open] > .sl-contacts { display:grid; position:static; grid-column:1/-1; grid-row:1; grid-template-columns:76px minmax(0,1fr); grid-template-rows:minmax(0,1fr) 22px; align-items:start; gap:4px 8px; width:auto; height:156px; min-height:156px; max-height:156px; padding:6px 10px; margin:0; border:0; border-bottom:1px solid var(--line); box-shadow:none; }
 .v5d .sl-contacts h2 { font-size:13px; margin:6px 0 0; }
 .v5d .sl-contact-list { grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); grid-auto-rows:56px; gap:4px; align-content:start; }
 .v5d .sl-contact { min-height:56px; padding:4px 6px; gap:6px; font-size:12px; line-height:1.25; }
 .v5d .sl-contact-avatar { flex-basis:28px; width:28px; height:28px; }
 .v5d .sl-contact-role { display:none; }
 .v5d .sl-contacts > details { grid-column:2; grid-row:2; margin:0; font-size:12px; }
 .v5d .sl-contacts > details > summary { min-height:22px; padding:2px 0; }
}
