/* Сайт MyInzha — однородный спокойный стиль (решение владельца 18.10.2026):
   тёплый светлый фон, один акцентный цвет, спокойные карточки; кабинет — список чертежей слева, работа справа.
   Строгий CSP: стилей в HTML нет, всё здесь. Шрифт Golos Text (SIL OFL 1.1) — свой, static/fonts.
   Просмотрщик (viewer.css) подчиняется тем же цветам через переменные --d3-… (внизу файла). */

/* ---------- шрифт ---------- */
@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/golos-text-cyrillic.2b8fbbb33a14.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/golos-text-cyrillic-ext.c7635a080bad.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/golos-text-latin.f57df9832ab8.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/golos-text-latin-ext.b0503aa2cc13.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- один набор токенов на весь сайт ---------- */
:root {
  --bg: #FAF9F5;
  --surface: #FFFFFF;
  --side: #F3F1EA;
  --hover: #ECE9E0;
  --line: #E5E1D6;
  --ink: #1F1E1B;
  --ink-2: #4A4740;
  --muted: #6F6B63;
  --accent: #C25F3C;
  --accent-ink: #FFFFFF;
  --accent-soft: #F6E7DF;
  --ok: #3F7D58;
  --danger: #A33A2A;
  --danger-soft: #FBEAE6;
  --radius: 14px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(31, 30, 27, .06), 0 4px 16px rgba(31, 30, 27, .06);
  --font: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Georgia, "Noto Serif", "Times New Roman", serif;
  --top-h: 60px;
}

/* ---------- основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
main:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.small { font-size: 14px; color: var(--muted); }
.lead { color: var(--muted); font-size: 17px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: 8px; }
.skip:focus { top: 12px; }
.nojs-only { display: none !important; }
[hidden] { display: none !important; }
.alert { margin-top: 14px; padding: 10px 14px; border-radius: var(--radius-s); background: var(--danger-soft); color: var(--danger); }
.ai-note { margin-top: 10px; color: var(--muted); font-size: 13.5px; text-align: center; }
.dev-hint { margin-top: 14px; padding: 10px 14px; border-radius: var(--radius-s); background: var(--accent-soft); color: var(--accent); font-size: 14px; }

/* ---------- кнопки: одна система ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--radius-s); border: 1px solid transparent; background: none; cursor: pointer; text-decoration: none;
  font-weight: 500; white-space: nowrap; transition: background-color .12s, filter .12s; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { filter: brightness(.95); }
.btn--line { border-color: var(--line); background: var(--surface); }
.btn--line:hover { background: var(--hover); }
.btn--ghost:hover { background: var(--hover); }
.btn--lg { min-height: 48px; padding: 0 22px; font-size: 16.5px; }
.btn--sm { min-height: 40px; padding: 0 14px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.is-chosen { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { filter: brightness(.95); }
.iconbtn { width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: 10px; cursor: pointer; color: var(--ink-2); flex: none; }
.iconbtn:hover { background: var(--hover); }
.iconbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; text-decoration: underline; }
.chip { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 500; }

/* ---------- логотип и шапка гостя ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; text-decoration: none; }
.logo-mark { width: 26px; height: 26px; }
.logo-ink { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.logo-acc { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: var(--top-h);
  padding: 0 max(16px, calc((100vw - 1120px) / 2 + 16px)); background: var(--bg); border-bottom: 1px solid transparent; }
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topnav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topnav .link { padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-2); }
.topnav .link:hover { background: var(--hover); }
@media (max-width: 680px) { .topnav .link--wide { display: none; } .topnav .btn { padding: 0 14px; } }

/* ---------- главная ---------- */
.hero { text-align: center; padding: 72px 16px 32px; }
.hero__title { font-size: clamp(34px, 6vw, 56px); line-height: 1.08; }
.hero__lead { max-width: 580px; margin: 18px auto 0; font-size: 18px; color: var(--ink-2); }
.hero__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.hero__upload .composer { margin: 28px auto 0; }   /* загрузка прямо на главной: входа нет (contracts/2.1) */
.hero__tips { margin-top: 14px; }
.section { padding-top: 40px; padding-bottom: 40px; }
.section h2 { font-size: 28px; margin-bottom: 6px; }
.section .lead { margin-bottom: 20px; }
.gallery { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gallery--small { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.gallery--row { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* три примера в одну строку и на телефоне */
@media (max-width: 600px) {
  .gallery--row { gap: 8px; }
  .gallery--row .card__body { padding: 8px 8px 10px; }
  .gallery--row .card__name { font-size: 13px; line-height: 1.25; }
  .gallery--row .card__desc, .gallery--row .chip { display: none; }
}
.card { display: flex; flex-direction: column; height: 100%; text-decoration: none; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.card__thumb { aspect-ratio: 4 / 3; display: grid; place-items: center; background: #FDFCF9; border-bottom: 1px solid var(--line); }
.card__thumb img { max-width: 80%; max-height: 80%; mix-blend-mode: multiply; }
.card__body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 14px; flex: 1; }
.card__name { font-weight: 600; }
.card__desc { font-size: 14px; color: var(--muted); }
.card .chip { align-self: flex-start; margin-top: 10px; }
.steps3 { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.step__n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.step h3 { font-size: 17px; margin-bottom: 4px; }
.step p { color: var(--ink-2); font-size: 15px; }
#how .ai-note { margin-top: 22px; }
.footer { margin-top: 40px; border-top: 1px solid var(--line); }
.footer__in { padding-top: 22px; padding-bottom: 40px; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 14px; }
.footer__links a { color: var(--ink-2); }
.footer__geo { flex-basis: 100%; font-size: 13px; }

/* ---------- страница с моделью для гостя (пример, «Поделиться») ---------- */
.page-model { padding-bottom: 24px; }
.crumbs { margin: 18px 0 8px; font-size: 14px; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 6px 0 12px; }
.title-row h1 { font-size: 30px; }
.cta-strip { margin: 24px 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cta-strip p { margin-top: 2px; }
.more-title { font-size: 22px; margin: 8px 0 12px; }

/* окно с деталью: просмотрщик занимает почти весь экран */
.viewer { position: relative; height: calc(100svh - 200px); min-height: 460px; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #F4F2EC; }
.viewer .stage { position: absolute; inset: 0; display: grid; place-items: center; }
.viewer .stage > img { max-width: 80%; max-height: 80%; opacity: .5; }
.d3-fallback { display: grid; gap: 10px; justify-items: center; padding: 16px; text-align: center; color: var(--muted); }
.d3-fallback img { max-height: 50vh; background: #fff; }

/* ---------- вход ---------- */
.auth { min-height: calc(100svh - var(--top-h) - 120px); display: grid; place-items: center; align-content: center; gap: 10px; padding: 24px 16px 48px; }
.auth-card { width: 100%; max-width: 400px; text-align: center; }
.auth-card h1 { font-size: 32px; margin-bottom: 8px; }
.field { display: block; text-align: left; margin: 20px 0 14px; }
.field > span { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); }
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.input--code { text-align: center; font-size: 26px; letter-spacing: .35em; font-variant-numeric: tabular-nums; height: 58px; }
.auth-card .small { margin-top: 14px; }
.auth-resend { max-width: 400px; text-align: center; }

/* ---------- кабинет: список слева, чертёж справа ---------- */
body.app { overflow: hidden; }
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr); height: 100svh; }
.side { display: flex; flex-direction: column; min-height: 0; background: var(--side); border-right: 1px solid var(--line); }
.side__top { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 6px 16px; }
.side__close { display: none; }
.side__new { margin: 6px 12px 14px; justify-content: flex-start; }
.plus { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 16px; line-height: 1; }
.side__h { margin: 2px 16px 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.side__list { flex: 1; overflow: auto; padding: 0 8px 8px; overscroll-behavior: contain; }
.side__empty { padding: 8px 10px; color: var(--muted); font-size: 14px; }
/* чертёж в списке: миниатюра (главный вид), название детали, дата и «ИИ думает» / «Готово» */
.item { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 8px; border-radius: 10px; text-decoration: none; }
.item:hover { background: var(--hover); }
.item.is-on { background: var(--surface); box-shadow: 0 1px 2px rgba(31, 30, 27, .06); }
.item__thumb { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 8px; overflow: hidden;
  background: #FDFCF9; border: 1px solid var(--line); }
.item__thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.item__thumb svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linejoin: round; }
.item__body { min-width: 0; flex: 1; }
.item__t { display: block; font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item__m { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.dot-chip { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.dot-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot-chip--ok { color: var(--ok); }
.dot-chip--bad { color: var(--danger); }
.dot-chip--wait { color: var(--accent); }
.dot-chip--wait::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
/* .me — строка владельца в панели (блок 8); у студента внизу списка — меню аккаунта (account.css, блок 5.2) */
.me { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 14px; border-top: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 600; flex: none; }
.me__who { flex: 1; min-width: 0; font-size: 14px; }
.me__who b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scrim { display: none; }
.main { min-width: 0; overflow: auto; display: flex; flex-direction: column; }
.main__top { display: none; }
.main__in { width: 100%; max-width: 980px; margin: 0 auto; padding: 24px 24px 32px; flex: 1; display: flex; flex-direction: column; }
.main__in--wide { max-width: none; padding: 14px 18px 12px; }
.main__in--wide .viewer { flex: 1; height: auto; min-height: 520px; }
.main__in > .order { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.top-share { display: none; }

/* новый чертёж: поле по центру */
.compose { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 22px; padding-bottom: 8vh; }
.compose h1 { font-size: clamp(30px, 4.6vw, 42px); }
.composer { width: 100%; max-width: 680px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 14px; text-align: left; }
.drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 170px;
  border: 1.5px dashed #D9D4C7; border-radius: 14px; cursor: pointer; padding: 18px; text-align: center; }
.drop:hover, .drop.is-over, .drop:focus-within { background: #FBF8F3; border-color: var(--accent); }
.drop svg { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 1.6; }
.drop small { color: var(--muted); }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.composer__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; flex-wrap: wrap; font-size: 14px; }
.compose .ai-note { margin-top: -10px; }
.tips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tip { font-size: 14px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.tip:hover { background: var(--hover); }

/* «ИИ думает» */
.think { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 40px 0 10vh; text-align: center; }
.order.wrap .think { min-height: calc(100svh - var(--top-h) - 160px); }
.spark { width: 54px; height: 54px; fill: var(--accent); animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.think h1 { font-size: 30px; }
.track { list-style: none; padding: 0; display: grid; gap: 10px; min-width: 260px; text-align: left; }
.track li { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.track__dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; }
.track li[data-state="current"] { color: var(--ink); font-weight: 500; }
.track li[data-state="current"] .track__dot { border-color: var(--accent); border-top-color: transparent; animation: spin 1s linear infinite; }
.track li[data-state="done"] { color: var(--ink-2); }
.track li[data-state="done"] .track__dot { border-color: var(--ok); background: var(--ok); }
.track li[data-state="done"] .track__dot::after { content: "✓"; color: #fff; font-size: 12px; line-height: 1; }
.think .small { max-width: 380px; }
.offline { color: var(--danger); font-size: 14px; }
.notice { max-width: 560px; margin: 10vh auto 0; display: grid; gap: 14px; justify-items: start; }
.notice h1 { font-size: 30px; }
.notice__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* готовый чертёж */
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.doc-head h1 { font-size: 24px; }
.doc-head .muted { font-size: 14px; }
.doc-actions { display: flex; gap: 8px; }
.share-more { margin-bottom: 10px; }
.share-more > summary { cursor: pointer; color: var(--muted); font-size: 14px; width: max-content; padding: 4px 0; }
.share-panel { display: grid; gap: 8px; max-width: 520px; margin-top: 8px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.share-panel label { font-size: 14px; color: var(--ink-2); }
.copy-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copy-row .input { flex: 1; min-width: 200px; height: 44px; font-size: 14px; }
.copy-done { font-size: 13px; color: var(--ok); }
.qr { width: 160px; height: 160px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.apps { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-top: 8px; }
.doc-foot .ai-note { margin: 0; text-align: left; }
.feedback { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.feedback__q { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.feedback form { display: flex; gap: 6px; }
.feedback__thanks { font-size: 14px; color: var(--ok); }
.copy-link { margin-top: 18px; display: grid; gap: 6px; max-width: 560px; font-size: 14px; }

/* ---------- рамка «обведи задание» ---------- */
.cropper { width: min(760px, 100vw - 24px); max-height: calc(100svh - 24px); padding: 16px; border: 0; border-radius: 18px; background: var(--surface); color: var(--ink); box-shadow: 0 10px 40px rgba(31, 30, 27, .25); }
.cropper::backdrop { background: rgba(31, 30, 27, .45); }
.cropper[open] { display: flex; flex-direction: column; gap: 10px; }
.cropper__head { display: flex; align-items: center; justify-content: space-between; }
.cropper__title { font: 600 20px/1.2 var(--font); }
.cropper__hint { color: var(--ink-2); font-size: 14.5px; }
.cropper__stage { flex: 1; min-height: 0; display: grid; place-items: center; background: #F4F2EC; border-radius: 12px; overflow: hidden; }
.crop-canvas { display: block; width: 100%; height: min(58svh, 520px); touch-action: none; outline: none; }
.bar { height: 6px; border-radius: 3px; background: var(--hover); overflow: hidden; }
.bar__fill { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.cropper__status { min-height: 1.4em; font-size: 14px; color: var(--muted); }
.cropper__status.is-error { color: var(--danger); }
.cropper__bar { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.cropper__bar .btn svg { width: 20px; height: 20px; }
.crop-wrap { padding-top: 18px; display: grid; gap: 12px; max-width: 820px; }
.crop-wrap h1 { font-size: 28px; }
.crop-stage { background: #F4F2EC; border-radius: 12px; overflow: hidden; }
.crop-source { display: none; }
.crop-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ---------- текстовые страницы ---------- */
.page { padding-top: 40px; padding-bottom: 32px; }
.prose { max-width: 720px; }
.prose h1 { font-size: 36px; margin-bottom: 10px; }
.prose h2 { font-size: 20px; margin: 26px 0 6px; }
.prose p, .prose li { color: var(--ink-2); }
.prose p + p { margin-top: 8px; }
.prose ul { padding-left: 20px; }
.page-actions { margin-top: 20px; display: flex; gap: 8px; }

/* ---------- просмотрщик — в общих цветах сайта ---------- */
.d3-root { --d3-paper: #FDFCF9; --d3-graphite: #1F1E1B; --d3-bg: #F4F2EC; --d3-muted: #6F6B63; --d3-line: #E5E1D6;
  --d3-hair: #EEEAE1; --d3-tracing: #F3EFE6; --d3-accent: #C25F3C; --d3-hi: #C25F3C; --d3-cut: #C25F3C; --d3-cut-ink: #A94F30;
  --d3-chip: #FFFFFF; --d3-nav: #FFFFFF; --d3-nav-ink: #4A4740; --d3-nav-on: #F1EEE6; --d3-nav-acc: #C25F3C;
  --d3-font: "Golos Text", system-ui, sans-serif; }
.d3-flagbtn, .d3-flags, .d3-assume { display: none !important; }   /* пометки качества студенту не показываем */

/* ---------- телефон ---------- */
@media (max-width: 820px) {
  body.app { overflow: auto; }
  .shell { display: block; height: auto; min-height: 100svh; }
  .side { position: fixed; inset: 0 auto 0 0; width: 86vw; max-width: 320px; z-index: 40; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  .side__close { display: inline-grid; }
  .shell.is-open .side { transform: none; }
  .shell.is-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(31, 30, 27, .3); }
  .main { overflow: visible; min-height: 100svh; }
  .main__top { display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 6px; position: sticky; top: 0; z-index: 10;
    background: var(--bg); border-bottom: 1px solid var(--line); }
  .main__title { flex: 1; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .main__in { padding: 16px 12px 24px; }
  .main__in--wide { padding: 8px 8px 10px; }
  .viewer { height: calc(100svh - 170px); min-height: 420px; }
  /* кабинет на телефоне: название и «Поделиться» — в шапке; модель — на весь экран под шапкой,
     снизу чуть видно, что дальше есть «Помогло?» и «Есть недочёт» (а за пустое место можно прокрутить страницу) */
  body.app .doc-head { display: none; }
  body.app .top-share { display: inline-grid; }
  body.app .main__in--wide .viewer { flex: none; height: calc(100svh - 56px - 64px); min-height: 400px; }
  html.js body.app .share-more:not([open]) { display: none; }
  .doc-foot { flex-direction: column; align-items: flex-start; }
  .hero { padding-top: 44px; }
  .compose { padding-bottom: 4vh; }
  .think h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .spark, .track li[data-state="current"] .track__dot { animation: none; }
  .card, .side { transition: none; }
  .dot-chip--wait::before { animation: none; }
}
