/* ============================================================
   Тренажёр администратора — базовая система и раскладка
   ============================================================ */

:root {
  --bg: #FAF6F2;
  --bg-soft: #F4EDE6;
  --surface: #FFFFFF;
  --surface-2: #FCF8F5;
  --surface-3: #F6EEE8;
  --ink: #2B2725;
  --ink-2: #6D635D;
  --ink-3: #9C918A;
  --line: #EADFD7;
  --line-2: #F3EAE4;
  --accent: #C9887F;
  --accent-2: #B8736B;
  --accent-soft: #F7E9E6;
  --accent-ink: #8C4E47;
  --ok: #63A184;
  --ok-soft: #E8F1EC;
  --warn: #CF9A4B;
  --warn-soft: #FAF0DF;
  --bad: #C4685C;
  --bad-soft: #F8E7E4;
  --info: #7B90B4;
  --info-soft: #EAF0F7;
  --gold: #BE9A54;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --sh-1: 0 1px 2px rgba(43, 39, 37, .04), 0 10px 26px -18px rgba(43, 39, 37, .28);
  --sh-2: 0 2px 6px rgba(43, 39, 37, .05), 0 22px 48px -26px rgba(43, 39, 37, .35);
  --sh-3: 0 30px 70px -30px rgba(43, 39, 37, .45);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: Georgia, "PT Serif", "Times New Roman", serif;

  --topbar-h: 60px;
  --rail: 268px;
  --side: 330px;
  --gap: 14px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 15px;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(201, 136, 127, .13), transparent 60%),
    radial-gradient(900px 520px at 100% 0%, rgba(143, 175, 159, .12), transparent 62%),
    radial-gradient(800px 700px at 50% 120%, rgba(214, 169, 107, .09), transparent 60%);
  z-index: 0;
}

.sprite { display: none; }

h1, h2, h3, h4, p, ul, ol, fieldset, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }

.icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--l { transform: rotate(90deg); }
.icon--r { transform: rotate(-90deg); }
.icon--rot { transform: rotate(180deg); }
.icon--sm { width: 16px; height: 16px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

/* ---------- типографика ---------- */
.eyebrow {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}

.title-lg { font-family: var(--font-head); font-size: clamp(20px, 2vw, 26px); line-height: 1.2; }
.muted { color: var(--ink-2); }
.tiny { font-size: 12.5px; }
strong { font-weight: 650; }

/* ---------- экраны ---------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

.app-busy .screen { pointer-events: none; }

/* ============================================================
   Стартовый экран
   ============================================================ */
.start {
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vh, 40px) 18px calc(20px + env(safe-area-inset-bottom));
  overflow: auto;
  overscroll-behavior: contain;
}

.start__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(680px 380px at 50% 8%, rgba(255, 255, 255, .75), transparent 70%);
  pointer-events: none;
}

.start__card {
  position: relative;
  width: min(720px, 100%);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: var(--sh-2);
  border-radius: var(--r-xl);
  padding: clamp(22px, 3.4vw, 40px);
  display: grid;
  gap: clamp(16px, 2.4vh, 26px);
  animation: rise .6s var(--ease) both;
}

.start__head { display: flex; align-items: center; gap: 14px; }
.start__title { font-family: var(--font-head); font-size: clamp(24px, 3.2vw, 34px); line-height: 1.1; }
.start__lead { color: var(--ink-2); max-width: 52ch; }

.logo {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(160deg, #fff, var(--accent-soft));
  border: 1px solid rgba(201, 136, 127, .28);
  color: var(--accent-2);
  flex: none;
}
.logo svg { width: 19px; height: 19px; fill: currentColor; stroke: none; }
.logo--lg { width: 48px; height: 48px; border-radius: 16px; }
.logo--lg svg { width: 26px; height: 26px; }

.start__form { display: grid; gap: 18px; }

.field { display: grid; gap: 7px; }
.field__label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }

.input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 15px;
  min-height: 48px;
  transition: border-color .18s, box-shadow .18s;
}
.input:hover { border-color: #DFD2C9; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); outline: none; }

.crm-pick { border: 0; padding: 0; display: grid; gap: 9px; }
.crm-pick__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }

.crmcard {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 14px;
  display: grid;
  gap: 3px;
  cursor: pointer;
  transition: transform .18s var(--ease), border-color .18s, box-shadow .18s, background .18s;
  position: relative;
}
.crmcard:hover { transform: translateY(-2px); box-shadow: var(--sh-1); }
.crmcard b { font-size: 14.5px; }
.crmcard span { font-size: 12.5px; color: var(--ink-3); }
.crmcard[aria-checked="true"] {
  border-color: var(--accent);
  background: linear-gradient(180deg, #fff, var(--accent-soft));
  box-shadow: 0 0 0 3px rgba(201, 136, 127, .14);
}
.crmcard[aria-checked="true"]::after {
  content: "";
  position: absolute;
  top: 11px; right: 12px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

.start__points { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.start__points li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  font-size: 13.5px;
  color: var(--ink-2);
  animation: rise .5s var(--ease) both;
}
.start__points li:nth-child(2) { animation-delay: .08s; }
.start__points li:nth-child(3) { animation-delay: .16s; }
.start__points .icon { color: var(--accent-2); margin-top: 1px; }
.start__foot { font-size: 12.5px; color: var(--ink-3); }

.linkbtn {
  background: none; border: 0; padding: 0;
  color: var(--accent-ink);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes pop {
  0% { opacity: 0; transform: scale(.94); }
  100% { opacity: 1; transform: none; }
}

/* ============================================================
   Кнопки
   ============================================================ */
.btn {
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .16s var(--ease), box-shadow .18s, background .18s, border-color .18s, opacity .18s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.btn--primary {
  background: linear-gradient(180deg, #D2958C, var(--accent));
  color: #fff;
  border-color: rgba(140, 78, 71, .25);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 12px 24px -14px rgba(140, 78, 71, .8);
}
.btn--primary:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 16px 30px -14px rgba(140, 78, 71, .85); }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover { border-color: #DFD2C9; color: var(--ink); }
.btn--soft { background: var(--accent-soft); color: var(--accent-ink); border-color: rgba(201, 136, 127, .28); }
.btn--quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn--lg { min-height: 54px; font-size: 16px; border-radius: 16px; padding: 0 24px; }
.btn--sm { min-height: 38px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn--ok { background: var(--ok-soft); color: #3F7359; border-color: rgba(99, 161, 132, .3); }
.btn--bad { background: var(--bad-soft); color: #94453A; border-color: rgba(196, 104, 92, .3); }
.btn__count {
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 12px;
  display: grid; place-items: center;
  font-weight: 700;
}

.iconbtn {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 13px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
  flex: none;
}
.iconbtn:hover { background: rgba(43, 39, 37, .05); color: var(--ink); }
.iconbtn--ghost { color: var(--ink-2); }
.iconbtn.is-on { color: var(--accent-ink); background: var(--accent-soft); }
.iconbtn--bare { width: 34px; height: 34px; border-radius: 10px; }

/* ============================================================
   Рабочий стол: верхняя панель
   ============================================================ */
.work {
  display: grid;
  grid-template-rows: var(--topbar-h) minmax(0, 1fr) auto;
  z-index: 2;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 clamp(12px, 2vw, 20px);
  min-height: var(--topbar-h);
}

.topbar__left, .topbar__right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar__left { gap: 9px; }

.crumb { display: flex; align-items: baseline; gap: 7px; min-width: 0; font-size: 13.5px; }
.crumb__salon { font-weight: 650; color: var(--ink); white-space: nowrap; }
.crumb__sep { color: var(--ink-3); }
.crumb__lesson {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xpchip {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 13px;
  box-shadow: var(--sh-1);
}
.xpchip__lvl { font-size: 12.5px; font-weight: 650; color: var(--accent-ink); white-space: nowrap; }
.xpchip__bar { width: 62px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.xpchip__bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width .5s var(--ease); }
.xpchip__val { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.repchip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 12px;
  font-size: 13px;
  box-shadow: var(--sh-1);
  animation: fade .3s both;
}
.repchip .icon { width: 16px; height: 16px; color: var(--bad); fill: currentColor; stroke: none; }

/* ============================================================
   Сетка рабочего стола
   ============================================================ */
.workgrid {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr) var(--side);
  gap: var(--gap);
  padding: 0 clamp(12px, 2vw, 20px) var(--gap);
  min-height: 0;
  transition: grid-template-columns .3s var(--ease);
}
.workgrid.is-collapsed { grid-template-columns: 0 minmax(0, 1fr) var(--side); }
.workgrid.is-collapsed .pane--map { opacity: 0; pointer-events: none; transform: translateX(-12px); }

.pane {
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}

.pane__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
}
.pane__title { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); font-weight: 650; }
.pane__hint { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pane__body { overflow: auto; overscroll-behavior: contain; padding: 4px 12px 14px; flex: 1; }

/* ---------- карта обучения ---------- */
.block {
  border-radius: var(--r-md);
  margin-bottom: 6px;
  transition: background .2s;
}
.block__head {
  width: 100%;
  display: flex; align-items: center; gap: 11px;
  padding: 10px 11px;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: left;
  transition: background .18s;
}
.block__head:hover { background: var(--surface-2); }
.block__icon {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--surface-3);
  color: var(--ink-2);
  flex: none;
}
.block__icon .icon { width: 18px; height: 18px; }
.block__text { min-width: 0; flex: 1; }
.block__num {
  flex: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.block__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block__title { font-size: 14px; font-weight: 620; display: flex; align-items: center; gap: 6px; min-width: 0; }
.block__sub { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block__meta { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.block__chev { color: var(--ink-3); transition: transform .25s var(--ease); }
.block.is-open .block__chev { transform: rotate(180deg); }
.block.is-current .block__icon { background: var(--accent-soft); color: var(--accent-ink); }
.block.is-locked .block__icon { color: var(--ink-3); }
.block.is-soon { opacity: .72; }
.block__lessons { display: grid; gap: 2px; padding: 2px 0 8px 0; animation: fade .25s both; }

.lesson {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 9px 11px 9px 13px;
  background: none; border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: left;
  color: var(--ink-2);
  transition: background .18s, color .18s;
}
.lesson:hover { background: var(--surface-2); color: var(--ink); }
.lesson__dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-3);
  color: var(--ink-3);
  flex: none;
  font-size: 11px;
  font-weight: 700;
}
.lesson__dot .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.lesson__title { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson__stars { font-size: 11px; color: var(--gold); letter-spacing: 1px; }
.lesson.is-done { color: var(--ink); }
.lesson.is-done .lesson__dot { background: var(--ok-soft); color: #3F7359; }
.lesson.is-current { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.lesson.is-current .lesson__dot { background: #fff; color: var(--accent-ink); }
.lesson.is-locked { opacity: .55; cursor: not-allowed; }
.lesson--test .lesson__title { font-weight: 600; }
.lesson--soon { opacity: .6; cursor: default; font-size: 12.5px; }

.rail { display: grid; gap: 8px; padding: 6px; }
.rail__btn {
  width: 44px; height: 44px;
  border-radius: 13px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--ink-2);
  cursor: pointer;
}
.rail__btn.is-current { background: var(--accent-soft); color: var(--accent-ink); border-color: rgba(201, 136, 127, .3); }
.rail__btn.is-locked { opacity: .5; }

/* ---------- сцена ---------- */
.pane--stage { background: transparent; border: 0; box-shadow: none; gap: var(--gap); overflow: visible; }

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stage--flat { background: transparent; border: 0; box-shadow: none; padding: 0; }

.stage__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.stage__title { font-family: var(--font-head); font-size: clamp(17px, 1.7vw, 21px); line-height: 1.2; }
.stage__goal { color: var(--ink-2); font-size: 13.5px; max-width: 62ch; margin-top: 3px; }
.stage__body { display: flex; flex-direction: column; gap: 14px; flex: 1; min-height: 0; }

.stagebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  min-height: 66px;
}
.stagebar__goal { min-width: 0; }
.stagebar__task { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stagebar__dots { display: flex; gap: 4px; margin-top: 6px; }
.stagebar__dots i {
  width: 14px; height: 4px; border-radius: 999px; background: var(--surface-3);
  transition: background .25s;
}
.stagebar__dots i.is-done { background: var(--ok); }
.stagebar__dots i.is-current { background: var(--accent); }
.stagebar__actions { display: flex; gap: 8px; flex: none; }

/* ---------- наставница ---------- */
.pane--side { background: transparent; border: 0; box-shadow: none; overflow: visible; gap: var(--gap); }

.mentor {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 180px;
}
.mentor__head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, #fff, var(--surface-2));
}
.mentor__avatar { width: 38px; height: 38px; border-radius: 13px; flex: none; }
.mentor__name { font-size: 13.5px; font-weight: 650; }
.mentor__role { font-size: 11.5px; color: var(--ink-3); }
.mentor__body { padding: 13px 14px 16px; overflow: auto; overscroll-behavior: contain; flex: 1; display: grid; gap: 10px; align-content: start; }

.speech {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 4px 16px 16px 16px;
  padding: 11px 13px;
  font-size: 13.5px;
  line-height: 1.55;
  animation: rise .3s var(--ease) both;
}
.speech--accent { background: var(--accent-soft); border-color: rgba(201, 136, 127, .25); }
.speech--ok { background: var(--ok-soft); border-color: rgba(99, 161, 132, .25); }
.speech--bad { background: var(--bad-soft); border-color: rgba(196, 104, 92, .25); }
.speech--warn { background: var(--warn-soft); border-color: rgba(207, 154, 75, .28); }
.speech::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 12px; height: 12px;
  background: inherit;
  border-left: 1px solid inherit;
  border-top: 1px solid inherit;
}
.speech b { font-weight: 650; }
.speech__tag {
  display: inline-block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 650; margin-bottom: 4px;
}

/* ---------- пульс ---------- */
.pulse {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: 13px 14px;
  display: grid;
  gap: 11px;
  flex: 0 0 auto;
}
.pulse__head { display: flex; align-items: center; justify-content: space-between; }
.pulse__title { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 650; }
.pulse__idle { font-size: 12.5px; color: var(--ink-3); }

/* ============================================================
   Мобильная навигация и адаптив
   ============================================================ */
.mobileNav { display: none; }

@media (max-width: 1240px) {
  :root { --rail: 240px; --side: 300px; }
}
@media (max-width: 1120px) {
  .xpchip__bar { width: 40px; }
  .xpchip__val { display: none; }
}

@media (max-width: 1023px) {
  :root { --topbar-h: 56px; }

  .workgrid {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 10px calc(10px + env(safe-area-inset-bottom));
    gap: 10px;
  }
  .workgrid.is-collapsed { grid-template-columns: minmax(0, 1fr); }

  .pane { border-radius: var(--r-md); }

  .pane--map, .pane--side, .pane--stage { display: none; }
  body[data-tab="work"] .pane--stage { display: flex; }
  body[data-tab="map"] .pane--map { display: flex; }
  body[data-tab="mentor"] .pane--side { display: flex; }
  body[data-tab="mentor"] .pane--side .pulse { display: none; }
  body[data-tab="pulse"] .pane--side { display: flex; }
  body[data-tab="pulse"] .pane--side .mentor { display: none; }

  .pane--map .pane__body, .pane--side { overflow: auto; }

  .mobileNav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    position: relative;
    z-index: 3;
  }
  .mobileNav__btn {
    display: grid;
    justify-items: center;
    gap: 2px;
    padding: 8px 4px;
    border: 0;
    background: none;
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
  }
  .mobileNav__btn .icon { width: 21px; height: 21px; }
  .mobileNav__btn.is-active { color: var(--accent-ink); background: var(--accent-soft); }
  .mobileNav__dot {
    position: absolute;
    top: 8px; right: 24%;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--warn);
  }

  .stagebar { flex-direction: column; align-items: stretch; min-height: 0; gap: 10px; }
  .stagebar__actions { display: grid; grid-template-columns: auto 1fr; }
  .stagebar__actions .btn--primary { justify-content: center; }
  .stage { padding: 13px; border-radius: var(--r-md); }
  .stage--flat { padding: 0; }
  .crumb__salon { display: none; }
  .crumb__sep { display: none; }
}

@media (max-width: 620px) {
  body { font-size: 14.5px; }
  .start__card { padding: 20px 16px; border-radius: var(--r-lg); }
  .start__points { grid-template-columns: 1fr; }
  .crm-pick__grid { grid-template-columns: 1fr; }
  .stagebar__actions .btn { padding: 0 13px; }
  .btn__count { min-width: 20px; height: 20px; }
  .topbar { padding: 0 10px; }
  .xpchip { padding: 4px 10px; gap: 7px; }
  .repchip { display: none; }
}

/* ---------- фокус и клавиатура ---------- */
.key-hint {
  font-size: 11px;
  color: var(--ink-3);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 5px;
  background: var(--surface-2);
}

/* ---------- тосты ---------- */
.toasts {
  position: fixed;
  right: 18px;
  top: calc(var(--topbar-h) + 10px);
  display: grid;
  gap: 8px;
  z-index: 60;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
  justify-items: end;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: rgba(43, 39, 37, .94);
  color: #fff;
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 13.5px;
  box-shadow: var(--sh-2);
  animation: rise .28s var(--ease) both;
  max-width: 100%;
}

@media (max-width: 1023px) {
  .toasts { right: 10px; left: 10px; width: auto; top: calc(var(--topbar-h) + 8px); }
}
.toast .icon { color: var(--accent); }
.toast--ok .icon { color: #9ED3B6; }
.toast--warn .icon { color: #EFC98A; }
.toast--bad .icon { color: #F0A79C; }
.toast--xp { background: rgba(140, 78, 71, .95); }

/* ---------- модальные окна ---------- */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(43, 39, 37, .35);
  backdrop-filter: blur(6px);
  animation: fade .2s both;
}
.modal {
  width: min(760px, 100%);
  max-height: min(88dvh, 860px);
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop .28s var(--ease) both;
}
.modal--sm { width: min(520px, 100%); }
.modal--lg { width: min(920px, 100%); }
.modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 20px 12px;
}
.modal__title { font-family: var(--font-head); font-size: 21px; }
.modal__sub { font-size: 13px; color: var(--ink-3); }
.modal__body { padding: 4px 20px 20px; overflow: auto; overscroll-behavior: contain; }
.modal__foot {
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-2);
  display: flex; gap: 10px; justify-content: flex-end;
  flex-wrap: wrap;
}

/* ---------- пузырь Анны на телефоне ---------- */
.bubble {
  position: fixed;
  right: 14px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 40;
  width: min(340px, calc(100vw - 28px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  padding: 12px 14px;
  font-size: 13.5px;
  animation: rise .3s var(--ease) both;
}
.bubble__close { position: absolute; top: 6px; right: 6px; }

.fx { position: fixed; inset: 0; z-index: 80; pointer-events: none; }

/* ============================================================
   Экраны результата, теста, сертификата, профиля
   ============================================================ */
.result { display: grid; gap: 16px; animation: rise .35s var(--ease) both; }
.result__hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.result__stars { display: flex; gap: 6px; }
.result__stars .icon { width: 26px; height: 26px; color: var(--surface-3); fill: currentColor; stroke: none; }
.result__stars .icon.is-on { color: var(--gold); animation: pop .4s var(--ease) both; }
.result__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.metric {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 12px 14px;
}
.metric__label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 650; }
.metric__value { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.metric__value small { font-size: 13px; color: var(--ink-3); font-weight: 500; }

.review { display: grid; gap: 8px; }
.review__item {
  display: flex; gap: 10px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-size: 13.5px;
  align-items: flex-start;
}
.review__item--bad { background: var(--bad-soft); border-color: rgba(196, 104, 92, .24); }
.review__item--ok { background: var(--ok-soft); border-color: rgba(99, 161, 132, .24); }
.review__item .icon { margin-top: 2px; }

.profile__grid { display: grid; gap: 16px; }
.achievements { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ach {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 12px;
  border-radius: var(--r-md);
  border: 1px dashed var(--line);
  background: var(--surface-2);
  opacity: .55;
  font-size: 12.5px;
}
.ach.is-on { opacity: 1; border-style: solid; border-color: rgba(190, 154, 84, .4); background: linear-gradient(180deg, #fff, #FDF6E8); }
.ach__ico { width: 30px; height: 30px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.ach.is-on .ach__ico { background: #F7EBD2; color: #9A7A34; }

.readiness { display: grid; gap: 8px; }
.readiness__bar { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.readiness__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), var(--gold)); transition: width .6s var(--ease); }
.comp-list { display: grid; gap: 4px; max-height: 240px; overflow: auto; }
.comp {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 10px;
}
.comp:hover { background: var(--surface-2); }
.comp__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); flex: none; }
.comp__dot.is-on { background: var(--ok); }
.comp__dot.is-part { background: var(--warn); }
.comp__w { margin-left: auto; font-size: 11.5px; color: var(--ink-3); }

.rules-list { display: grid; gap: 10px; }
.rule {
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  padding: 12px 14px;
  background: var(--surface-2);
  font-size: 13.5px;
}
.rule b { display: block; margin-bottom: 3px; }
.rule__say { color: var(--accent-ink); font-style: italic; }

/* ---------- сертификат ---------- */
.cert { align-items: center; justify-content: center; padding: 18px; overflow: auto; }
.cert__paper {
  width: min(820px, 100%);
  background: linear-gradient(180deg, #fff, #FDFAF7);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
  padding: clamp(24px, 4vw, 52px);
  display: grid;
  gap: 18px;
  text-align: center;
  animation: rise .4s var(--ease) both;
}
.cert__seal {
  width: 74px; height: 74px; margin: 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #FDF3E3, #F3E1BC);
  border: 1px solid rgba(190, 154, 84, .45);
  color: #9A7A34;
}
.cert__seal .icon { width: 34px; height: 34px; }
.cert__name { font-family: var(--font-head); font-size: clamp(24px, 3.6vw, 36px); }
.cert__sign { display: flex; justify-content: space-between; gap: 20px; margin-top: 8px; font-size: 13px; color: var(--ink-2); text-align: left; flex-wrap: wrap; }
.cert__sign i { display: block; border-bottom: 1px solid var(--line); width: 190px; height: 26px; }

/* ---------- утилиты ---------- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.stack { display: grid; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}
.chip--ok { background: var(--ok-soft); color: #3F7359; }
.chip--warn { background: var(--warn-soft); color: #8A6522; }
.chip--bad { background: var(--bad-soft); color: #94453A; }
.chip--accent { background: var(--accent-soft); color: var(--accent-ink); }

/* ============================================================
   Шаги урока: карточки, экскурсия, чек-лист, сортировка, таймлайн
   ============================================================ */
.stepcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  padding: 15px 16px;
  display: grid;
  gap: 11px;
  animation: rise .3s var(--ease) both;
}
.stepcard--accent { background: linear-gradient(180deg, #fff, var(--accent-soft)); border-color: rgba(201, 136, 127, .34); }
.stepcard--warn { background: linear-gradient(180deg, #fff, var(--warn-soft)); border-color: rgba(207, 154, 75, .34); }
.stepcard--ok { background: linear-gradient(180deg, #fff, var(--ok-soft)); border-color: rgba(99, 161, 132, .34); }
.stepcard__title { font-family: var(--font-head); font-size: 18px; }
.stepcard__note { font-size: 13px; color: var(--ink-2); }
.stepcard__text { font-size: 14.5px; line-height: 1.6; white-space: pre-line; }

.steplist { display: grid; gap: 7px; }
.steplist li { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; }
.steplist .icon { color: var(--ok); margin-top: 2px; flex: none; }

.tourlist { display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.tourlist__item {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 13px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 13.5px;
  text-align: left;
  min-height: 46px;
  transition: border-color .18s, background .18s, transform .18s;
}
.tourlist__item:hover { border-color: var(--accent); transform: translateY(-1px); }
.tourlist__item .icon { color: var(--ink-3); }
.tourlist__item.is-visited { border-style: solid; border-color: rgba(99, 161, 132, .45); background: var(--ok-soft); }
.tourlist__item.is-visited .icon { color: var(--ok); }
.tourdetail { border-top: 1px solid var(--line-2); padding-top: 10px; display: grid; gap: 6px; min-height: 62px; }

.checklist { display: grid; gap: 6px; }
.checkitem {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 13.5px;
  color: var(--ink-2);
}
.checkitem .icon { color: var(--ink-3); }
.checkitem.is-done { background: var(--ok-soft); border-color: rgba(99, 161, 132, .3); color: #2F5945; }
.checkitem.is-done .icon { color: var(--ok); }

.dropgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.droppool { display: flex; gap: 8px; flex-wrap: wrap; min-height: 44px; }

.timeline { display: grid; gap: 4px; }
.timeline__item {
  display: flex; gap: 10px; align-items: center;
  font-size: 13px; color: var(--ink-3);
  padding: 6px 9px; border-radius: 9px;
}
.timeline__item time { font-variant-numeric: tabular-nums; min-width: 54px; }
.timeline__item.is-current { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.timeline__item.is-done { color: var(--ok); }

.tabbar { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line-2); padding-bottom: 10px; }
.tabbar__btn {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  min-height: 40px;
}
.tabbar__btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.tabbar__btn.is-on { background: var(--accent-soft); border-color: rgba(201, 136, 127, .4); color: var(--accent-ink); }

.windows--grid3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body * { visibility: hidden; }
  .cert__paper, .cert__paper * { visibility: visible; }
  .cert__paper { position: fixed; inset: 0; box-shadow: none; border: 0; }
}
