/* Атлас мозга · оформление в айдентике alexlisovoy.ru (дизайн-система v2.1: тёплая бумага, охра, Cormorant + Fira Sans Compressed) */
@import url("fonts.css");

:root {
  --bg: #F5F1EC; --bg-cream: #FAF6F0; --panel: #FFFFFF; --dark: #2A2520; --dark-deep: #1F1B17;
  --text: #2C2C2A; --muted: #8A8880; --muted-strong: #6F6C65; --light: #F5F1EC; --line: #E8E4DF;
  --accent: #C8792A; --accent-dark: #A66220; --accent-bg: rgba(200, 121, 42, 0.08); --accent-line: rgba(200, 121, 42, 0.20);
  --stage: #EFE9E1;
  --A: #2A2520; --B: #A66220; --C: #8A8880; --ok: #5A9A6E; --bad: #B85446;
  --serif: 'Cormorant', 'Cormorant Fallback', Georgia, 'Times New Roman', serif;
  --body: 'Fira Sans Compressed', 'Fira Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI Condensed', sans-serif;
  --r: 4px; --r-lg: 8px;
  --shadow-card: 0 2px 12px rgba(42, 37, 32, 0.06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 17px/1.6 var(--body); display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-line); text-decoration-thickness: 1px; transition: color .2s ease, text-decoration-color .2s ease; }
a:hover { color: var(--accent-dark); text-decoration-color: var(--accent); }
button { font: 500 14px/1.2 var(--body); letter-spacing: .2px; color: var(--text); cursor: pointer; border: 1px solid var(--line); background: var(--panel); border-radius: var(--r); padding: 8px 14px; transition: border-color .2s ease, background .2s ease, color .2s ease; }
button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-dark); }
button:disabled { opacity: .4; cursor: default; }
button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
button[aria-pressed="true"]:hover:not(:disabled) { color: #fff; background: var(--accent-dark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ——— Верхняя панель: тёмный «остров», как на сайте ——— */
.top { display: flex; align-items: center; gap: 28px; padding: 10px 24px; background: var(--dark); color: var(--light); }
body.page .top { position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--light); text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 38px; height: 38px; border: 1px solid rgba(245, 241, 236, .35); border-radius: 50%; display: grid; place-items: center; font: 500 italic 17px/1 var(--serif); color: var(--light); flex: none; }
.brand-text { display: flex; flex-direction: column; gap: 4px; }
.brand-name { font: 500 15px/1 var(--body); letter-spacing: .2px; }
.brand-role { font: 500 10.5px/1 var(--body); letter-spacing: 2.2px; text-transform: uppercase; color: rgba(245, 241, 236, .62); }
.toplinks { display: flex; gap: 24px; flex: 1; }
.toplinks a { font: 400 14px/1 var(--body); letter-spacing: .2px; color: rgba(245, 241, 236, .82); text-decoration: none; }
.toplinks a:hover, .toplinks a[aria-current="page"] { color: var(--accent); }
.mode { display: flex; gap: 0; border: 1px solid rgba(245, 241, 236, .28); border-radius: var(--r); overflow: hidden; }
.mode button { border: 0; border-radius: 0; background: transparent; color: rgba(245, 241, 236, .82); padding: 9px 16px; }
.mode button:hover:not(:disabled) { color: #fff; }
.mode button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* ——— Атлас: три колонки ——— */
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr) 440px; }
.side { border-right: 1px solid var(--line); background: var(--bg-cream); display: flex; flex-direction: column; min-height: 0; }
.tabs { display: flex; gap: 6px; padding: 14px 14px 10px; }
.tabs button { flex: 1; }
#search { margin: 0 14px 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--text); font: 400 15px/1.2 var(--body); }
#search:focus { outline: none; border-color: var(--accent); }
.list { overflow-y: auto; padding: 0 14px 20px; flex: 1; min-height: 0; }
.list h4, .grp summary { margin: 16px 0 6px; font: 500 12px/1.3 var(--body); letter-spacing: 2.2px; text-transform: uppercase; color: var(--muted); }
.grp { border: 0; margin: 0; padding: 0; }
.grp summary { cursor: pointer; list-style-position: inside; }
.grp summary::marker { color: var(--accent); }
.grp summary span { letter-spacing: 0; opacity: .7; margin-left: 4px; }
.list .item { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: var(--r); font: 400 15.5px/1.3 var(--body); letter-spacing: 0; }
.list .item:hover, .list .item[aria-current="true"] { background: var(--accent-bg); color: var(--text); }
.list .item.minor { color: var(--muted-strong); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.theme { display: block; width: 100%; text-align: left; margin-bottom: 2px; padding: 7px 10px; border: 0; border-left: 2px solid transparent; border-radius: 0; background: none; font: 400 15.5px/1.35 var(--body); letter-spacing: 0; }
.theme b { font-weight: 400; }
.theme:hover:not(:disabled) { color: var(--accent-dark); }
.theme[aria-current="true"] { border-left-color: var(--accent); background: var(--accent-bg); }
.theme[aria-current="true"] b { font-weight: 500; }
.soon { color: var(--muted); font-size: 14px; }

.stage { position: relative; background: radial-gradient(ellipse at 50% 38%, #FBF8F3, var(--stage) 78%); min-height: 0; overflow: hidden; }
#c { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.no3d #c, .no3d .bar, .no3d .orient { display: none; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted-strong); pointer-events: none; text-align: center; padding: 24px; font: 500 italic 22px/1.4 var(--serif); }
.tip { position: absolute; pointer-events: none; background: var(--dark); color: var(--light); border-radius: var(--r); padding: 4px 10px; font-size: 14px; white-space: nowrap; transform: translate(12px, 12px); }
.orient { position: absolute; left: 16px; top: 12px; font: 500 11.5px/1.3 var(--body); letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.warn-bar { position: absolute; left: 12px; right: 12px; top: 38px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r); padding: 8px 12px; font-size: 14px; }
.bar { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; max-width: calc(100% - 24px); }
.bar .row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; justify-content: center; }
.bar button { padding: 6px 11px; font-size: 13.5px; }
.bar label { font-size: 14.5px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.bar input[type=range] { width: 120px; accent-color: var(--accent); }
.bar input[type=checkbox] { accent-color: var(--accent); }
#more { display: none; }

.sheet { border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.grab, .menu-btn, .tools-btn, .side-head, .side-links, .hint { display: none; }
.card { overflow-y: auto; padding: 22px 26px 32px; min-height: 0; flex: 1; }
.card:focus { outline: none; }
.card .kicker, .article .kicker { display: flex; align-items: center; gap: 12px; font: 500 12px/1.3 var(--body); letter-spacing: 2.5px; text-transform: uppercase; color: var(--accent); margin: 0; }
.card .kicker::before, .article .kicker::before { content: ""; width: 28px; height: 1px; background: var(--accent); flex: none; }
.card h1 { font: 500 34px/1.12 var(--serif); letter-spacing: -.3px; margin: 10px 0 8px; text-wrap: pretty; }
.card h1 em, .article h1 em { font-style: italic; color: var(--accent); font-weight: 500; }
.card h2 { font: 500 24px/1.25 var(--serif); margin: 16px 0 10px; text-wrap: pretty; }
.card .latin { font: 500 italic 19px/1.3 var(--serif); color: var(--muted-strong); margin: 0 0 10px; }
.card h3 { font: 500 12px/1.3 var(--body); letter-spacing: 2.2px; text-transform: uppercase; color: var(--muted); margin: 24px 0 8px; }
.card p { margin: 0 0 .8em; }
.card ul { margin: 0; padding-left: 20px; }
.card li { margin-bottom: 9px; }
.card li::marker { color: var(--accent); }
.card .lead { font-size: 18.5px; line-height: 1.55; }
.card .box { background: var(--bg-cream); border-radius: var(--r); padding: 14px 16px; margin-top: 14px; }
.card .warn { border-left: 3px solid var(--accent); }
.note, .card .src { font-size: 14px; color: var(--muted-strong); }
.card .src { padding-left: 22px; }
.card .src li { margin-bottom: 6px; }
.src li.flash { background: var(--accent-bg); transition: background .3s; }
.src li:focus { outline: none; }
.cite { text-decoration: none; padding: 0 2px; font-weight: 500; }
.ev { display: inline-block; font: 500 11px/1 var(--body); letter-spacing: .5px; color: #fff; border-radius: 3px; padding: 3px 5px; vertical-align: 2px; cursor: help; text-decoration: none; border: 1px solid transparent; }
.ev-A { background: var(--A); } .ev-B { background: var(--B); } .ev-C { background: var(--C); }
.ev-M { background: transparent; color: var(--accent-dark); border-color: var(--accent); }
.ev-P { background: transparent; color: var(--muted-strong); border-color: var(--muted); border-style: dashed; }
.steps { display: flex; gap: 8px; margin: 16px 0 6px; align-items: center; }
.steps .n { flex: 1; text-align: center; font: 500 12px/1.3 var(--body); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.steps button:last-child:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
.lesson-plan { margin: 4px 0 10px; padding-left: 22px; }
.lesson-plan li { margin: 3px 0; }
.lesson-plan button { border: 0; background: none; padding: 2px 0; font: inherit; color: var(--accent-dark); text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.lesson-plan button:hover { text-decoration-color: currentColor; }
.lesson-plan small { color: var(--muted); }
.steps button:last-child:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.chips button { font: 400 14.5px/1.25 var(--body); letter-spacing: 0; padding: 6px 12px; display: inline-flex; align-items: center; gap: 7px; text-align: left; }
.clienttext { font-size: 20px; line-height: 1.6; }
body.client .card h1 { font-size: 38px; }
details { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 12px; }
summary { cursor: pointer; font-weight: 500; }
.card details summary::marker { color: var(--accent); }
.quiz { margin: 12px 0 18px; }
.quiz button { display: block; width: 100%; text-align: left; margin-bottom: 6px; font: 400 15.5px/1.35 var(--body); letter-spacing: 0; }
.quiz .ok { border-color: var(--ok); background: rgba(90, 154, 110, .12); }
.quiz .bad { border-color: var(--bad); background: rgba(184, 84, 70, .10); }
.quiz .why { font-size: 15px; color: var(--muted-strong); }

.notice { border: 0; border-radius: var(--r-lg); padding: 28px 30px 24px; max-width: 520px; background: var(--panel); color: var(--text); box-shadow: 0 20px 60px rgba(42, 37, 32, .25); border-top: 3px solid var(--accent); }
.notice::backdrop { background: rgba(31, 27, 23, .55); }
.notice h2 { font: 500 30px/1.15 var(--serif); margin: 0 0 12px; }
.notice button { background: var(--accent); color: #fff; border-color: var(--accent); padding: 11px 22px; float: right; }
.notice button:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }

@media (max-width: 1240px) { .layout { grid-template-columns: 236px minmax(0, 1fr) 380px; } .toplinks { gap: 16px; } }
@media (max-width: 860px) {
  /* Телефон: модель всегда на экране, описание — в выдвижной панели снизу, темы — в меню. Страница не прокручивается. */
  body:not(.embed):not(.page) { height: 100dvh; overflow: hidden; display: block; position: fixed; inset: 0; }
  .top { gap: 10px; padding: 8px 12px; height: 52px; }
  .brand-mark { width: 34px; height: 34px; font-size: 15px; }
  .brand-name { display: none; }
  .brand-role { font-size: 12px; letter-spacing: 1.6px; color: var(--light); }
  .toplinks { display: none; }
  .brand { flex: 1; }
  .mode button { padding: 8px 10px; font-size: 13px; }
  .menu-btn { display: inline-block; background: var(--accent); border-color: var(--accent); color: #fff; padding: 9px 14px; }
  .layout { display: block; position: absolute; top: 52px; left: 0; right: 0; bottom: 0; }
  .stage { position: absolute; inset: 0; overflow: hidden; }
  #c { height: 100%; }
  .loading { height: auto; bottom: 40%; }
  .orient { left: 12px; top: 10px; right: 130px; font-size: 10.5px; letter-spacing: 1.2px; }
  .tools-btn { display: inline-block; position: absolute; right: 10px; top: 8px; padding: 9px 12px; z-index: 6; }
  .tools-btn[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
  .bar { position: absolute; left: 10px; right: 10px; top: 54px; bottom: auto; transform: none; max-width: none; display: none; z-index: 6; max-height: calc(100% - 150px); overflow-y: auto; padding: 12px; }
  .bar.open { display: flex; }
  .bar .x, .bar .layers, .bar .sliders { display: flex; }
  .bar .x { display: inline-block; }
  .bar button { padding: 10px 12px; font-size: 14px; }
  .bar label { font-size: 15.5px; padding: 6px 2px; }
  .bar input[type=checkbox] { width: 20px; height: 20px; }
  .bar input[type=range] { width: 150px; height: 28px; }
  #more { display: none !important; }
  .hint { display: block; position: absolute; left: 12px; right: 12px; top: 56px; background: var(--dark); color: var(--light); border-radius: var(--r); padding: 10px 14px; font-size: 14px; line-height: 1.4; text-align: center; z-index: 5; pointer-events: none; }
  .hint[hidden] { display: none; }

  /* Выдвижная панель описания */
  .sheet { position: absolute; left: 0; right: 0; bottom: 0; height: var(--sheet-h, 46%); border-left: 0; border-top: 1px solid var(--line); border-radius: 12px 12px 0 0; z-index: 8; box-shadow: 0 -6px 24px rgba(42, 37, 32, .10); transition: height .28s cubic-bezier(0.22, 1, 0.36, 1); will-change: height; }
  .sheet.dragging { transition: none; }
  .grab { display: block; padding: 6px 14px 8px; border-bottom: 1px solid var(--line); touch-action: none; cursor: grab; flex: none; }
  .grab-bar { display: block; width: 44px; height: 4px; border-radius: 2px; background: var(--line); margin: 2px auto 8px; }
  .sheet-head { display: flex; align-items: center; gap: 10px; min-height: 44px; }
  .sheet-head .t { flex: 1; min-width: 0; }
  .sheet-head .t small { display: block; font: 500 10.5px/1.2 var(--body); letter-spacing: 1.8px; text-transform: uppercase; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sheet-head .t b { font: 500 18px/1.18 var(--serif); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .sheet-head button { min-width: 44px; min-height: 44px; padding: 8px 12px; font-size: 15px; flex: none; }
  .sheet-head button.go { background: var(--accent); border-color: var(--accent); color: #fff; }
  .card { padding: 14px 16px calc(28px + env(safe-area-inset-bottom)); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .card h1 { font-size: 27px; }
  .card .steps { display: none; }                   /* шаги листаются кнопками в шапке панели */
  .card .lead { font-size: 17.5px; }
  .chips button, .quiz button { min-height: 40px; }

  /* Меню тем и областей */
  .side { position: fixed; inset: 0; z-index: 40; border: 0; transform: translateX(-102%); transition: transform .26s cubic-bezier(0.22, 1, 0.36, 1); visibility: hidden; }
  .side.open { transform: none; visibility: visible; }
  .side-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--dark); color: var(--light); }
  .side-head b { font: 500 13px/1 var(--body); letter-spacing: 2px; text-transform: uppercase; }
  .side-head button { background: transparent; color: var(--light); border-color: rgba(245, 241, 236, .35); min-height: 40px; }
  .tabs button { min-height: 44px; font-size: 15px; }
  #search { font-size: 16px; padding: 12px 14px; }            /* 16px — чтобы телефон не увеличивал страницу при вводе */
  .list { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .list .item, .theme { padding: 11px 10px; font-size: 16.5px; }
  .side-links { display: flex; gap: 18px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 15px; }
  @media (prefers-reduced-motion: reduce) { .sheet, .side { transition: none; } }
}

/* ——— Встроенная модель (?embed=1) ——— */
body.embed { height: 100%; display: block; background: transparent; }
body.embed .top, body.embed .side, body.embed .card, body.embed #live { display: none; }
body.embed .layout { display: block; height: 100%; }
body.embed .stage { height: 100%; }
body.embed #c { height: 100%; }
body.embed .loading { height: auto; }
body.embed .bar { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); border-radius: var(--r-lg); border-width: 1px; max-width: calc(100% - 16px); padding: 6px 8px; }
body.embed #more { display: inline-block; }
body.embed .bar:not(.open) .x, body.embed .bar:not(.open) .layers, body.embed .bar:not(.open) .sliders { display: none; }
body.embed .bar button { padding: 5px 9px; font-size: 13px; }

/* ——— Текстовые страницы библиотеки ——— */
body.page { display: block; height: auto; }
.crumbs { background: var(--bg-cream); border-bottom: 1px solid var(--line); padding: 12px 24px; font: 500 11.5px/1.3 var(--body); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { margin: 0 8px; color: var(--accent); }
.crumbs b { color: var(--text); font-weight: 500; }
.with-viewer { display: grid; grid-template-columns: minmax(0, 1fr) min(46vw, 640px); gap: 8px; max-width: 1440px; margin: 0 auto; align-items: start; }
.with-viewer .article { margin: 0; justify-self: end; width: 100%; grid-column: 1; grid-row: 1; }
.with-viewer .viewer { grid-column: 2; grid-row: 1; }
.viewer { position: sticky; top: 59px; height: calc(100vh - 59px); padding: 16px 16px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.viewer iframe { flex: 1; width: 100%; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--stage); }
.viewer p { margin: 0; font-size: 13.5px; color: var(--muted-strong); }
.article { max-width: 780px; margin: 0 auto; padding: 36px 24px 72px; }
.article h1 { font: 500 52px/1.08 var(--serif); letter-spacing: -.5px; margin: 14px 0 16px; text-wrap: pretty; }
.article h2 { font: 500 32px/1.2 var(--serif); letter-spacing: -.3px; margin: 44px 0 12px; text-wrap: pretty; scroll-margin-top: 16px; transition: color .3s ease; }
.article h2.reading { color: var(--accent-dark); }
.article h3 { font: 500 20px/1.3 var(--body); margin: 22px 0 6px; }
.article .lead { font: 400 21px/1.55 var(--body); color: var(--text); }
.article p { margin: 0 0 1em; }
.article ul { padding-left: 22px; }
.article li { margin-bottom: 10px; }
.article li::marker { color: var(--accent); }
.article .box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 24px; margin: 18px 0; }
.article .plain { border-left: 3px solid var(--accent); font-size: 18px; }
.article .src { font-size: 15px; color: var(--muted-strong); }
.article details { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; margin: 8px 0; }
.cta { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; border-radius: var(--r); padding: 12px 24px; margin: 6px 0 4px; font: 500 15px/1.2 var(--body); letter-spacing: .3px; border: 1px solid var(--accent); }
.cta:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.cards li { margin: 0; }
.cards a { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; text-decoration: none; color: var(--text); height: 100%; transition: border-color .2s ease, transform .2s cubic-bezier(0.22, 1, 0.36, 1); }
.cards a:hover { border-color: var(--accent); transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .cards a:hover { transform: none; } }
.cards b { font: 500 21px/1.2 var(--serif); display: block; }
.cards small { color: var(--muted-strong); display: block; margin-top: 6px; font-size: 14.5px; line-height: 1.45; }
.foot { background: var(--dark-deep); color: rgba(245, 241, 236, .62); padding: 26px 24px; font-size: 14px; text-align: center; }
.foot a { color: rgba(245, 241, 236, .82); }
@media (max-width: 900px) {
  .with-viewer { display: block; }
  body.page .top { position: static; }
  .viewer { position: sticky; top: 0; height: 42vh; padding: 0; z-index: 5; background: var(--bg); }
  .viewer iframe { border-radius: 0; border-width: 0 0 1px; box-shadow: none; }
  .viewer p { display: none; }
  .article { padding: 24px 18px 56px; }
  .article h1 { font-size: 36px; }
  .article h2 { font-size: 27px; }
  .crumbs { padding: 10px 18px; }
}

/* Встроенная модель в узкой рамке (телефон): в свёрнутой панели только самое нужное */
@media (max-width: 520px) {
  body.embed .bar { bottom: 6px; padding: 4px 6px; }
  body.embed .bar:not(.open) [data-view] { display: none; }
  body.embed .orient { font-size: 10px; left: 10px; top: 8px; }
}

/* ——— Посадочные страницы: краткий ответ, содержание, вопросы, соседние темы ——— */
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 8px 14px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }
.article .answer { border-left: 3px solid var(--accent); font-size: 18.5px; line-height: 1.55; }
.toc { background: var(--bg-cream); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 22px; margin: 18px 0; }
.toc b { font: 500 12px/1.3 var(--body); letter-spacing: 2.2px; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 8px 0 0; padding-left: 20px; }
.toc li { margin-bottom: 4px; }
.toc a { text-decoration: none; color: var(--text); }
.toc a:hover { color: var(--accent-dark); }
.article h2 a { color: inherit; text-decoration: none; }
.article h2 a:hover { color: var(--accent-dark); }
.article [id] { scroll-margin-top: 72px; }
.prevnext { display: flex; justify-content: space-between; gap: 16px; margin: 32px 0 8px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 16px; }
.prevnext a { text-decoration: none; max-width: 48%; }
.prevnext a[rel=next] { margin-left: auto; text-align: right; }

/* Режим снимка для обложек (?embed=1&shot=1): только модель */
body.shot .bar, body.shot .orient, body.shot .loading, body.shot .tip { display: none !important; }
#shotcap { position: absolute; z-index: 3; left: 292px; top: 0; bottom: 0; width: 450px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
#shotcap .kicker { display: flex; align-items: center; gap: 14px; font: 500 17px/1.3 var(--body); letter-spacing: 3px; text-transform: uppercase; color: var(--accent); margin: 0; }
#shotcap .kicker::before { content: ""; width: 40px; height: 1px; background: var(--accent); flex: none; }
#shotcap h1 { font: 500 56px/1.08 var(--serif); letter-spacing: -.5px; margin: 0; color: var(--text); text-wrap: balance; }
#shotcap .sub { font: 400 22px/1.35 var(--body); color: var(--muted-strong); margin: 0; }
#shotcap .sign { margin: 6px 0 0; font: 500 19px/1 var(--body); letter-spacing: .4px; color: var(--accent-dark); }
#shotbrand { position: absolute; left: 0; top: 0; bottom: 0; width: 232px; background: var(--dark); color: var(--light); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 22px; text-align: center; }
#shotbrand .brand-mark { width: 64px; height: 64px; border: 1px solid rgba(245, 241, 236, .45); border-radius: 50%; display: grid; place-items: center; font: 500 italic 28px/1 var(--serif); color: var(--light); }
#shotbrand .t { font: 500 26px/1.15 var(--serif); }
#shotbrand .n { font: 500 13px/1.45 var(--body); letter-spacing: 2.2px; text-transform: uppercase; color: rgba(245, 241, 236, .62); }

/* ——— Блок об авторе (как в статьях сайта) и зацепка для коллег ——— */
.author { display: flex; gap: 18px; align-items: flex-start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; margin: 36px 0 8px; }
.author img { border-radius: 999px; flex: none; object-fit: cover; filter: saturate(0.92) contrast(1.02); }
.author-name { font: 500 24px/1.2 var(--serif); margin: 0 0 6px; }
.author-bio { font-size: 15.5px; line-height: 1.55; color: var(--muted-strong); margin: 0 0 8px; }
.author-links { display: flex; gap: 18px; margin: 0; font-size: 15px; }
.author.big { padding: 28px 30px; }
.author.big .author-name { font-size: 30px; }
.colleague { border-left: 3px solid var(--accent); padding: 4px 0 4px 22px; margin: 28px 0; max-width: 620px; }
.colleague .kicker::before { display: none; }
.colleague p { margin: 6px 0; }
.card .byline { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--muted-strong); }
.card .byline img { border-radius: 999px; flex: none; }
.card .byline a { white-space: nowrap; }
/* «Поделиться» и подписка на статьи — по образцу блога сайта */
.share { position: relative; margin: 34px 0 10px; }
.share-btn { display: inline-flex; align-items: center; gap: 9px; padding: 11px 20px; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: var(--r); font: 500 15px/1 var(--body); cursor: pointer; }
.share-btn svg { width: 17px; height: 17px; }
.share-btn:hover, .share.is-open .share-btn { background: var(--accent-dark); border-color: var(--accent-dark); }
.share-panel { display: none; position: absolute; top: calc(100% + 10px); left: 0; z-index: 50; width: 300px; max-width: calc(100vw - 32px); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 18px 16px; }
.share.is-open .share-panel { display: block; }
.share-eyebrow { font: 600 11px/1 var(--body); letter-spacing: 1.4px; text-transform: uppercase; color: var(--accent-dark); margin: 0 0 6px; }
.share-title { font: italic 500 19px/1.2 var(--serif); margin: 0 0 8px; }
.share-note { font-size: 13px; line-height: 1.5; color: var(--muted-strong); margin: 0 0 14px; }
.share-channels { display: flex; flex-direction: column; gap: 7px; }
.share-ch { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; color: var(--text); font: 500 15px/1 var(--body); }
.share-ch svg { width: 19px; height: 19px; flex: none; color: var(--accent); }
.share-ch:hover { border-color: var(--accent); background: var(--bg-cream); }
.share-arr { margin-left: auto; color: var(--muted); }
.share-copy { display: flex; align-items: center; gap: 9px; width: 100%; margin-top: 13px; padding: 13px 0 0; border: 0; border-top: 1px solid var(--line); background: none; cursor: pointer; font: 500 14px/1 var(--body); color: var(--accent-dark); }
.share-copy svg { width: 16px; height: 16px; flex: none; }
.share-copy.is-copied { color: var(--ok); }
.nl { background: var(--bg-cream); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 26px 28px; margin: 36px 0 8px; }
.article .nl-title { font: 500 28px/1.15 var(--serif); margin: 0 0 10px; }
.nl-text { font-size: 16.5px; line-height: 1.55; color: var(--muted-strong); margin: 0 0 16px; max-width: 60ch; }
.nl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.nl-row { display: flex; gap: 10px; align-items: stretch; }
.nl-field { flex: 1; min-width: 0; }
.nl-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nl-input { width: 100%; height: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); font: 400 16px/1 var(--body); color: var(--text); }
.nl-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.nl-input[aria-invalid="true"] { border-color: var(--bad); }
.nl-btn { padding: 0 22px; min-height: 46px; background: var(--accent); color: #fff; border: 1px solid var(--accent); border-radius: var(--r); font: 500 15.5px/1 var(--body); cursor: pointer; white-space: nowrap; }
.nl-btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.nl-btn:disabled { opacity: 0.6; cursor: default; }
.nl-error { color: var(--bad); font-size: 14.5px; margin: 8px 0 0; min-height: 0; }
.nl-error:empty { display: none; }
.nl-fine { font-size: 13.5px; line-height: 1.5; color: var(--muted-strong); margin: 10px 0 0; }
.nl-done { display: none; font: 500 18px/1.4 var(--body); color: var(--text); margin: 0; }
.nl[data-state="done"] .nl-form { display: none; }
.nl[data-state="done"] .nl-done { display: block; }
@media (max-width: 860px) {
  .nl { padding: 20px 18px; }
  .nl-row { flex-direction: column; }
  .nl-btn { width: 100%; }
  .article .nl-title { font-size: 25px; }
}
.step-lead { font: italic 500 21px/1.42 var(--serif); color: var(--text); margin: 4px 0 14px; }
.card .step-lead { font-size: 19px; margin: 6px 0 12px; }
.box.case { border-left: 3px solid var(--accent); }
.box.case small { display: block; margin-top: 8px; font-size: 13.5px; color: var(--muted-strong); }
.article .box.crisis { border-left: 3px solid var(--accent); }
.article .byline { display: flex; align-items: center; gap: 10px; margin: -6px 0 22px; font-size: 14.5px; line-height: 1.4; color: var(--muted-strong); }
.article .byline img { border-radius: 999px; flex: none; object-fit: cover; }
.viewer-toggle { display: none; }
@media (max-width: 900px) {
  .author { flex-direction: column; gap: 12px; padding: 18px; }
  .viewer { transition: height .25s cubic-bezier(0.22, 1, 0.36, 1); }
  .viewer.min { height: 44px; }
  .viewer.min iframe { visibility: hidden; height: 0; flex: 0; }
  .viewer-toggle { display: block; position: absolute; right: 8px; top: 6px; z-index: 6; padding: 7px 12px; font-size: 13.5px; background: var(--panel); }
  .viewer { position: sticky; }
}

/* кнопка «Другие разделы сайта» (виджет основного сайта) в шапке атласа */
.top .topnav-switch { margin-left: auto; }
.top .mode ~ .topnav-switch, .top .toplinks ~ .mode { margin-left: 0; }
.author-channels { margin: 8px 0 0; font-size: 15px; color: var(--muted-strong); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.print-btn { margin-left: 10px; padding: 11px 16px; background: none; border: 1px solid var(--line); border-radius: var(--r); font: 500 15px/1 var(--body); color: var(--muted-strong); cursor: pointer; }
.print-btn:hover { border-color: var(--accent); color: var(--accent-dark); }
.lib-search { display: block; margin: 18px 0 6px; }
.lib-search span { display: block; font: 500 13px/1 var(--body); letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted-strong); margin-bottom: 8px; }
.lib-search input { width: 100%; max-width: 520px; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); font: 400 16px/1 var(--body); color: var(--text); }
.lib-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.lib-empty { color: var(--muted-strong); }
@media (max-width: 860px) {
  .print-btn { display: none; }
  /* в самом атласе на телефоне: кнопка разделов сайта остаётся, шапка уплотняется */
  body:not(.page) .top { gap: 8px; }
  body:not(.page) .top .topnav-switch { margin-left: 0; }
}
/* Печать: раздаточный лист — только текст материала */
@media print {
  .top, .crumbs, .viewer, .viewer-toggle, .share, .nl, .colleague, .toc, .cta, .prevnext, .foot, .skip, .lib-search, .author-links, .author-channels, details > summary::marker { display: none !important; }
  body.page { background: #fff; }
  .with-viewer { display: block !important; }
  .article { max-width: none; padding: 0; font-size: 12pt; }
  .article a { color: inherit; text-decoration: none; }
  .article .box, .author { break-inside: avoid; border-color: #bbb; background: #fff; }
  .article h2 { break-after: avoid; }
  details { display: block; } details > * { display: block !important; }
}

/* под заголовком темы: открыть 3D и переключить вид «для клиента» */
.viewbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0 6px; }
.viewbar .cta { margin: 0; }
.view-toggle { padding: 11px 16px; background: none; border: 1px solid var(--line); border-radius: var(--r); font: 500 15px/1 var(--body); color: var(--text); cursor: pointer; }
.view-toggle:hover, .view-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-dark); }
.client-note { font-size: 15px; color: var(--muted-strong); margin: 4px 0 10px; }
body.client-view .pro-only, body.client-view .toc, body.client-view .colleague, body.client-view .nl, body.client-view ol.src, body.client-view #istochniki, body.client-view #istochniki ~ p.src, body.client-view .author-channels { display: none !important; }
.crisis-wrap { max-width: 1440px; margin: 0 auto; padding: 12px 24px 0; }
.crisis-wrap .box { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-lg); padding: 16px 20px; margin: 0; }
.article h2[id] { scroll-margin-top: 76px; }
@media (max-width: 860px) {
  .viewer { height: 34vh; min-height: 200px; }
  .article h2[id] { scroll-margin-top: calc(34vh + 16px); }
  .crisis-wrap { padding: 10px 14px 10px; }
  .viewbar .cta, .view-toggle { flex: 1 1 100%; text-align: center; }
}
@media print { .viewbar, .client-note, .crisis-wrap + .with-viewer .viewer { display: none !important; } body.client-view .pro-only { display: none !important; } }

/* ——— Подвал основного сайта (site-footer.html) ——— */
/* Главная атласа на компьютере: приложение занимает экран целиком, подвал — ниже, до него докручивают страницу */
@media (min-width: 861px) {
  body:not(.page):not(.embed) { height: auto; min-height: 100%; }
  body:not(.page):not(.embed) .layout { flex: none; height: calc(100vh - var(--top-h, 59px)); height: calc(100dvh - var(--top-h, 59px)); }
}
/* На телефоне app.js переносит подвал в конец панели описания: на всю её ширину, без внутренних отступов карточки */
.card > .site-footer { margin: 36px -16px calc(-28px - env(safe-area-inset-bottom)); }
.card > .foot { margin: 28px -16px 0; padding: 18px 16px; }
body.embed .site-footer, body.embed .foot, body.shot .site-footer { display: none !important; }
.foot + .site-footer, .foot { border-top: 1px solid rgba(245, 241, 236, .12); }
@media print { .site-footer { display: none !important; } }
/* Узкий телефон: на главной атласа в шапке знак AL, переключатель, «Темы» и разделы сайта — подпись «Атлас мозга» есть в панели описания */
@media (max-width: 430px) {
  body:not(.page):not(.embed) .top .brand-text { display: none; }
}
.foot { background: #2A2520; }
/* открытое меню «Другие разделы сайта» — поверх модели и панели описания */
body:not(.page) .top:has(.topnav-switch[data-open="true"]) { position: relative; z-index: 60; }

/* ——— Курс ——— */
.course-bar { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin: 14px 0 4px; padding: 10px 14px; border-left: 2px solid var(--accent); background: var(--bg-cream); font-size: 15px; color: var(--muted-strong); }
.course-bar a { font-weight: 500; }
.course-bar .course-done-mark { color: var(--accent-dark); font-weight: 500; }
.course-end { margin: 34px 0 8px; padding: 20px 22px; border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: var(--r); background: var(--panel); }
.course-end .kicker { margin: 0 0 12px; }
.course-mark { padding: 11px 16px; border: 1px solid var(--accent); border-radius: var(--r); background: none; color: var(--accent-dark); font: 500 15px/1.2 var(--body); cursor: pointer; }
.course-mark:hover, .course-mark[aria-pressed="true"] { background: var(--accent); color: #fff; }
.course-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 18px; margin: 16px 0 0; font-size: 16px; }
.course-links a { text-decoration: none; }
.course-links .course-next { margin-left: auto; font-weight: 500; text-align: right; }
.course-end.is-done .course-next { color: var(--accent-dark); text-decoration: underline; }
.course-note { margin: 14px 0 0; font-size: 14px; color: var(--muted-strong); }
.course-invite { margin: 10px 0 4px; padding: 12px 16px; border-left: 2px solid var(--accent); background: var(--bg-cream); }
.course-progress { margin: 22px 0 10px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.course-progress p { margin: 0 0 10px; }
.course-meter { height: 6px; background: var(--line); border-radius: 2px; overflow: hidden; margin: 0 0 16px; }
.course-meter span { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.course-progress .cta { margin: 0 12px 0 0; }
.course-reset { margin-top: 10px; padding: 9px 14px; background: none; border: 1px solid var(--line); border-radius: var(--r); font: 400 14px/1 var(--body); color: var(--muted-strong); cursor: pointer; }
.course-express { margin: 26px 0 8px; padding: 4px 20px 8px; border: 1px solid var(--accent-line); border-radius: var(--r); }
.module { margin: 30px 0 10px; }
.module h3 { margin-top: 4px; }
.module-meta { font-size: 14px; color: var(--muted-strong); margin: 4px 0 10px; }
ol.lessons { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.lesson a { display: grid; grid-template-columns: 40px 1fr; column-gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); text-decoration: none; color: var(--text); }
.lesson a:hover { border-color: var(--accent); }
.lesson-n { grid-row: span 4; font: 500 22px/1.1 var(--serif); color: var(--accent); }
.lesson b { font-weight: 500; }
.lesson small { display: block; font-size: 14.5px; color: var(--muted-strong); margin-top: 3px; }
.lesson .lesson-meta { font-size: 13.5px; }
.lesson .lesson-skip { color: var(--accent-dark); }
.lesson-done { font: 500 13px/1 var(--body); letter-spacing: 1px; text-transform: uppercase; color: var(--accent-dark); margin-top: 6px; }
.lesson.is-done a { background: var(--bg-cream); }
.lesson.is-done .lesson-n { color: var(--muted-strong); }
.lesson.is-next a { border-color: var(--accent); border-left-width: 3px; }
/* 3D: вкладка «Курс» и блок урока в карточке */
.course-side-intro { font-size: 14px; color: var(--muted-strong); margin: 4px 6px 10px; line-height: 1.45; }
.list .theme.is-done b { color: var(--muted-strong); font-weight: 400; }
.list .theme small { display: block; font: 500 11px/1.3 var(--body); letter-spacing: 1px; text-transform: uppercase; color: var(--accent-dark); margin-top: 3px; }
.list .theme.is-next { border-left: 2px solid var(--accent); }
.card .course-box .kicker { margin-bottom: 6px; }
.card .course-box p { margin: 8px 0 0; }
.card .course-box button.go { background: var(--accent); border-color: var(--accent); color: #fff; text-align: left; }
.card .course-start { margin: 14px 0; padding: 12px 14px; border-left: 2px solid var(--accent); background: var(--bg-cream); }
.card .course-start a { font-weight: 500; }
@media print { .course-bar, .course-end, .course-invite { display: none !important; } }
@media (max-width: 860px) { .course-links .course-next { margin-left: 0; text-align: left; } .lesson a { grid-template-columns: 30px 1fr; } }
.article .module h3 { font: 500 28px/1.2 var(--serif); letter-spacing: 0; text-transform: none; color: var(--text); margin: 6px 0 8px; }
.course-skip { margin-left: 10px; padding: 11px 16px; border: 1px solid var(--line); border-radius: var(--r); background: none; color: var(--muted-strong); font: 500 15px/1.2 var(--body); cursor: pointer; }
.course-skip:hover, .course-skip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-dark); }
.course-error { margin: 12px 0 0; color: #9A3B2C; font-size: 15px; }
.lesson-skipped { font: 500 13px/1 var(--body); letter-spacing: 1px; text-transform: uppercase; color: var(--muted-strong); margin-top: 6px; }
.lesson.is-skipped a { background: var(--bg-cream); border-style: dashed; }
details.module > summary { list-style: none; cursor: pointer; padding: 4px 0 2px; }
details.module > summary::-webkit-details-marker { display: none; }
details.module > summary h3::after { content: " +"; color: var(--accent); font-family: var(--body); font-size: 22px; }
details.module[open] > summary h3::after { content: " −"; }
details.module { border-top: 1px solid var(--line); padding-top: 14px; }
.card .course-box button[data-course-skip] { margin-left: 8px; }

/* ——— Пояснения терминов ——— */
button.term { all: unset; cursor: help; border-bottom: 1px dotted var(--accent); color: inherit; font: inherit; }
button.term:hover, button.term[aria-expanded="true"] { color: var(--accent-dark); border-bottom-style: solid; }
button.term:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.term-pop { display: block; margin: 8px 0 10px; padding: 12px 14px; border: 1px solid var(--accent-line); border-left: 2px solid var(--accent); border-radius: var(--r); background: var(--bg-cream); font: 400 15.5px/1.5 var(--body); color: var(--text); }
.term-pop .term-text { display: block; }
.term-pop .term-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 8px; font-size: 14.5px; }
.term-pop .term-row button { padding: 7px 12px; font-size: 14px; }
body.client-view button.term { border-bottom: 0; cursor: text; pointer-events: none; }
/* курс: предупреждение, «перед уроком», связка, цели, углубление */
.course-warn, .course-before { margin: 6px 0 4px; padding: 8px 14px; font-size: 15px; color: var(--muted-strong); border-left: 2px solid var(--line); }
.course-warn { border-left-color: var(--accent); }
.course-bridge { margin: 16px 0 0; font-size: 16.5px; }
p.module-goals { margin: 10px 0 2px; font-size: 15.5px; }
ul.module-goals { margin: 0 0 12px; padding-left: 20px; font-size: 15.5px; color: var(--muted-strong); }
details.deep > summary { cursor: pointer; color: var(--accent-dark); font: 500 15px/1.4 var(--body); padding: 6px 0; }
/* подписи подсвеченных структур на модели */
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
#labels span { position: absolute; left: 0; top: 0; background: rgba(42, 37, 32, .86); color: var(--light); border-radius: var(--r); padding: 3px 8px; font: 500 12.5px/1.25 var(--body); white-space: nowrap; will-change: transform; }
#labels span::after { content: ""; position: absolute; left: var(--stem-x, 50%); top: 100%; width: 1px; height: var(--stem, 9px); background: rgba(42, 37, 32, .7); }
#labels span.below::after { top: auto; bottom: 100%; }
body.shot #labels { display: none; }
@media print { .term-pop, .course-warn, .course-before { display: none !important; } button.term { border: 0; } }
@media (pointer: coarse) { button.term { padding: 7px 3px; margin: -7px -3px; } }
.lesson-part { margin: 10px 0 0; font: 500 12px/1.3 var(--body); letter-spacing: 2px; text-transform: uppercase; color: var(--accent); }

/* итог модуля и словарь */
details.module-quiz { margin: 16px 0 6px; padding: 4px 16px 10px; border: 1px solid var(--accent-line); border-radius: var(--r); background: var(--bg-cream); }
details.module-quiz > summary { cursor: pointer; padding: 10px 0; font: 500 16px/1.3 var(--body); color: var(--accent-dark); }
.mq-note { font-size: 14px; color: var(--muted-strong); margin: 0 0 6px; }
.mq { padding: 12px 0; border-top: 1px solid var(--line); }
.mq-q { margin: 0 0 8px; font-weight: 500; }
.mq-opts { display: grid; gap: 6px; }
.mq-opt { text-align: left; padding: 10px 14px; min-height: 44px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); font: 400 16px/1.35 var(--body); color: var(--text); cursor: pointer; }
.mq-opt:disabled { opacity: 1; cursor: default; }
.mq-opt.is-right { border-color: #4E7A4E; background: #EEF4EC; }
.mq-opt.is-picked-wrong { border-color: #9A3B2C; background: #F8ECE8; }
.mq-why { margin: 10px 0 0; font-size: 15.5px; }
dl.glossary dt { margin-top: 22px; font: 500 22px/1.25 var(--serif); scroll-margin-top: 80px; }
dl.glossary dd { margin: 6px 0 0; }
dl.glossary dd small { display: block; margin-top: 4px; font-size: 14.5px; color: var(--muted-strong); }
/* встроенная модель на телефоне невысокая: заголовок шага в одну строку, чтобы не обрезался */
@media (max-height: 420px) { body.embed .sheet-head .t b { -webkit-line-clamp: 1; } }
.course-reset { min-height: 40px; }
.mq-verdict { font-weight: 500; color: var(--accent-dark); }

/* панель инструментов: сворачивание на компьютере */
.bar-show { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 4; padding: 9px 16px; }
.bar-show[hidden] { display: none; }
@media (min-width: 861px) { body.bar-min:not(.embed) .bar { display: none; } }
@media (max-width: 860px) { .bar-min-btn, .bar-show { display: none !important; } }
body.embed .bar-min-btn, body.embed .bar-show, body.shot .bar-show { display: none !important; }

/* масштаб: кнопки «+» и «−» и модель во весь экран */
.zoom { position: absolute; right: 14px; bottom: 14px; z-index: 4; display: flex; flex-direction: column; gap: 6px; }
.zoom button { width: 40px; height: 40px; padding: 0; font: 500 22px/1 var(--body); display: grid; place-items: center; }
.zoom .zoom-full { font-size: 18px; }
body.shot .zoom { display: none; }
body.embed .zoom { right: 8px; bottom: 8px; } body.embed .zoom .zoom-full { display: none; }
#stage:fullscreen { background: radial-gradient(ellipse at 50% 38%, #FBF8F3, var(--stage) 78%); }
@media (max-width: 860px) {
  body:not(.embed) .zoom { top: 124px; bottom: auto; right: 10px; z-index: 4; }
  body:not(.embed) .zoom button { width: 44px; height: 44px; }
  body:not(.embed) .zoom .zoom-full { display: none; }
}
.zoom .zoom-reset { font-size: 20px; margin-top: 6px; }

/* пульт поворота модели (компьютер): стрелки, наклон и «шарик», который можно тянуть */
.pad { position: absolute; left: 14px; bottom: 14px; z-index: 4; display: grid; grid-template-columns: repeat(3, 38px); grid-auto-rows: 38px; gap: 4px; }
.pad button { padding: 0; font: 500 18px/1 var(--body); display: grid; place-items: center; }
.pad-ball { border-radius: 50%; border: 1px solid var(--line); cursor: grab; touch-action: none;
  background: radial-gradient(circle at 35% 30%, #fff, var(--bg-cream) 55%, #D9CFC0); }
.pad-ball:hover { border-color: var(--accent); }
.pad-ball.on { cursor: grabbing; border-color: var(--accent); }
body.shot .pad, body.embed .pad { display: none; }
@media (max-width: 860px) { .pad { display: none; } }
/* на не очень широком экране пульт и масштаб уходят к середине боковых краёв, чтобы не встречаться с панелью инструментов */


.zoom button[hidden] { display: none; }
.zoom button, .pad button { touch-action: none; }
/* панель инструментов на компьютере: широкая и низкая; слои, «Разобрать» и «Срез» открываются кнопкой «Слои и срез» */
@media (min-width: 861px) {
  body:not(.embed) .bar { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 18px; padding: 7px 10px; bottom: 10px; max-width: calc(100% - 20px); width: max-content; }
  body:not(.embed) .bar .row { gap: 5px 6px; }
  body:not(.embed) .bar button { padding: 6px 10px; font-size: 13px; }
  body:not(.embed) #more { display: inline-block; }
  body:not(.embed) .bar:not(.open) .layers, body:not(.embed) .bar:not(.open) .sliders { display: none; }
  body:not(.embed) .bar .layers, body:not(.embed) .bar .sliders { gap: 4px 14px; }
}

/* кнопки поворота и масштаба — в левом нижнем углу сцены, над панелью инструментов */
@media (min-width: 861px) {
  body:not(.embed) .pad { left: 14px; bottom: calc(var(--bar-h, 0px) + 24px); top: auto; transform: none; }
  body:not(.embed) .zoom { left: 152px; right: auto; bottom: calc(var(--bar-h, 0px) + 24px); top: auto; transform: none; display: grid; grid-template-columns: 38px 38px; grid-auto-rows: 38px; gap: 4px; align-content: end; }
  body:not(.embed) .zoom button { width: 38px; height: 38px; }
  body:not(.embed) .zoom .zoom-reset { margin-top: 0; }
  body.bar-min:not(.embed) .pad, body.bar-min:not(.embed) .zoom { bottom: 14px; }
  body.bar-min:not(.embed) .bar-show { left: auto; right: 14px; transform: none; }
}
/* кнопка обучения над списком */
.study-cta { display: block; width: calc(100% - 28px); margin: 14px 14px 0; padding: 12px 14px; text-align: left; background: var(--accent); border-color: var(--accent); color: #fff; }
.study-cta:hover:not(:disabled) { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.study-cta b { display: block; font: 500 16.5px/1.25 var(--body); }
.study-cta small { display: block; margin-top: 4px; font: 400 12.5px/1.35 var(--body); color: rgba(255, 255, 255, .88); }
.study-cta.is-on { outline: 2px solid var(--accent-dark); outline-offset: 2px; }
.study-box { margin: 4px 4px 10px; padding: 12px; border: 1px solid var(--accent-line); border-radius: var(--r); background: var(--panel); display: grid; gap: 8px; }
.study-box p { margin: 0; font-size: 14.5px; line-height: 1.4; }
.study-box button { text-align: left; }
.study-box button.go { background: var(--accent); border-color: var(--accent); color: #fff; }
.study-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 0 0 14px; padding: 9px 12px; background: var(--bg-cream); border-left: 2px solid var(--accent); font-size: 14px; color: var(--muted-strong); }
.study-strip button { padding: 4px 10px; font-size: 13px; }
.study-meter { flex-basis: 100%; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.study-meter span { display: block; height: 100%; background: var(--accent); }
.card-home { margin: 0 0 10px; }
.card-home button { padding: 4px 10px; font-size: 13px; color: var(--muted-strong); }
.card .course-start { margin: 14px 0; padding: 14px; border-left: 2px solid var(--accent); background: var(--bg-cream); }
.card .course-start p { margin: 8px 0 0; font-size: 15px; }
.card .course-start button.go { background: var(--accent); border-color: var(--accent); color: #fff; padding: 11px 18px; font-size: 16px; }
.card .steps button.go { background: var(--accent); border-color: var(--accent); color: #fff; }
/* скрытие боковых колонок (компьютер) */
.col-toggle { position: absolute; top: 44px; z-index: 5; width: 22px; height: 56px; padding: 0; font: 500 18px/1 var(--body); display: grid; place-items: center; background: var(--panel); }
.col-toggle-l { left: 0; border-left: 0; border-radius: 0 var(--r) var(--r) 0; }
.col-toggle-r { right: 0; border-right: 0; border-radius: var(--r) 0 0 var(--r); }
@media (min-width: 861px) {
  body.side-off:not(.embed) .layout { grid-template-columns: minmax(0, 1fr) 440px; }
  body.card-off:not(.embed) .layout { grid-template-columns: 280px minmax(0, 1fr); }
  body.side-off.card-off:not(.embed) .layout { grid-template-columns: minmax(0, 1fr); }
  body.side-off:not(.embed) .side, body.card-off:not(.embed) .sheet { display: none; }
}
@media (min-width: 861px) and (max-width: 1240px) {
  body.side-off:not(.embed) .layout { grid-template-columns: minmax(0, 1fr) 380px; }
  body.card-off:not(.embed) .layout { grid-template-columns: 236px minmax(0, 1fr); }
  body.side-off.card-off:not(.embed) .layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) { .col-toggle, .tip-once { display: none !important; } }
body.embed .col-toggle, body.shot .col-toggle, body.embed .tip-once { display: none !important; }
.tip-once { position: absolute; left: 36px; top: 36px; z-index: 6; max-width: 300px; padding: 12px 14px; background: var(--dark); color: var(--light); border-radius: var(--r); font-size: 14px; line-height: 1.45; }
.tip-once[hidden] { display: none; }
.tip-once button { display: block; margin-top: 8px; padding: 5px 12px; font-size: 13px; background: transparent; color: var(--light); border-color: rgba(245, 241, 236, .4); }
.course-3d { display: inline-block; text-decoration: none; margin: 8px 12px 0 0; }
.study-warn { flex-basis: 100%; color: #9A3B2C; font-size: 13px; }
.study-strip button.go { background: var(--accent); border-color: var(--accent); color: #fff; }
.card .study-result { border-left: 2px solid var(--accent); }
.card .study-result p { margin: 10px 0 0; }
.card .study-result button.go { background: var(--accent); border-color: var(--accent); color: #fff; }

/* строка разделов атласа под шапкой на телефоне (текстовые страницы) */
.atlas-nav { display: none; }
@media (max-width: 860px) {
  .atlas-nav { display: flex; gap: 18px; padding: 10px 16px; overflow-x: auto; white-space: nowrap; background: var(--bg-cream); border-bottom: 1px solid var(--line); font-size: 15px; -webkit-overflow-scrolling: touch; }
  .atlas-nav a { text-decoration: none; color: var(--text); }
  .grab-btn { display: block; width: 100%; padding: 6px 0 4px; margin: -6px 0 0; background: none; border: 0; cursor: pointer; }
  .grab-btn .grab-bar { margin: 2px auto 6px; }
  .sheet-head button.go-text { font-size: 13.5px; padding: 8px 10px; white-space: nowrap; }
}
@media print { .atlas-nav { display: none !important; } }
/* стрелки скрытия колонок — крупнее, чтобы попадать пальцем на планшете */
.col-toggle { width: 28px; height: 68px; }
dl.glossary dt[hidden], dl.glossary dd[hidden] { display: none; }

/* «Сброс» — с подписью, во всю ширину блока масштаба */
.zoom .zoom-reset { width: auto; padding: 0 10px; font: 500 14px/1 var(--body); display: flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
@media (min-width: 861px) { body:not(.embed) .zoom .zoom-reset { grid-column: 1 / -1; width: auto; order: 3; } body:not(.embed) .zoom .zoom-full { order: 2; } }
@media (max-width: 860px) { body:not(.embed) .zoom .zoom-reset { width: auto; min-width: 44px; padding: 0 8px; font-size: 12.5px; flex-direction: column; gap: 2px; } }
body.embed .zoom .zoom-reset { width: 40px; padding: 0; font-size: 0; } body.embed .zoom .zoom-reset span { font-size: 20px; }

/* маршруты: подборки тем вокруг одного запроса */
.route { margin: 34px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.route-phrase { font-family: var(--serif, inherit); font-style: italic; font-size: 1.15em; margin: 4px 0 10px; }
.concl-ref { color: var(--muted); white-space: nowrap; }
.concl-ref a { color: inherit; }
.phrases dt { margin-top: 22px; }
.phrases dd { margin: 6px 0 0; }

/* Переход в конце шага */
.card .step-next { margin: 22px 0 8px; }
.card .step-next button.go { display: block; width: 100%; text-align: left; padding: 12px 16px; background: var(--accent); border-color: var(--accent); color: #fff; font-size: 16px; line-height: 1.35; }
.card .step-next button.go:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.card .step-next small { display: block; font: 500 11.5px/1.3 var(--body); letter-spacing: 1.5px; text-transform: uppercase; opacity: .85; margin-bottom: 3px; }
