/* ============================================================================
   Кайдзен-додзё — дизайн-система оболочки (чекпоинт 001)
   Тёмное «ночное додзё»: тушь суми-э, бумага васи, киноварный акцент.
   Mobile-first, колонка приложения по центру.
   ============================================================================ */

:root {
  --bg:#14120F; --bg-deep:#0F0D0B; --surface:#1E1B17; --surface2:#26221D;
  --line:#332E27; --text:#EFE9DD; --muted:#9A917F; --accent:#D84B33;
  --accent-soft:#8A2F20; --grass:#6F8F5A; --washi:#F1E8D8; --washi-text:#2A2620;
  --radius:14px;
  --font:'Manrope',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --font-jp:'Noto Sans JP',var(--font);
}

/* ── reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing:border-box; }
html, body { margin:0; padding:0; }
body {
  background:var(--bg-deep);
  color:var(--text);
  font-family:var(--font);
  font-size:16px;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
button { font-family:inherit; color:inherit; }
a { color:inherit; }

::selection { background:var(--accent-soft); color:var(--text); }

/* тонкий тёмный скроллбар */
* { scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:var(--line); border-radius:6px; }
::-webkit-scrollbar-thumb:hover { background:var(--surface2); }

/* ── оболочка: колонка приложения ──────────────────────────────────────── */
#app {
  position:relative;
  display:flex;
  flex-direction:column;
  width:100%;
  max-width:480px;
  min-height:100dvh;
  margin:0 auto;
  background:var(--bg);
  border-left:1px solid var(--line);
  border-right:1px solid var(--line);
  overflow:hidden;
}
/* лёгкое тепло-угольное свечение сверху колонки */
#app::before {
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(130% 55% at 50% -12%, rgba(216,75,51,.07), transparent 58%),
    radial-gradient(120% 40% at 50% 112%, rgba(15,13,11,.6), transparent 60%);
  z-index:0;
}

/* ── верхняя панель ────────────────────────────────────────────────────── */
#topbar {
  position:relative;
  z-index:2;
  display:none;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  height:52px;
  padding:0 16px;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg, rgba(30,27,23,.6), rgba(30,27,23,0));
  flex:0 0 auto;
}
#topbar.visible { display:flex; }
#topbar .rank-pill { gap:8px; }
#topbar .rank-dot {
  width:7px; height:7px; border-radius:50%;
  background:var(--accent); box-shadow:0 0 8px rgba(216,75,51,.6);
}
#topbar .day-count { font-size:12px; color:var(--muted); letter-spacing:.02em; }

/* ── область экрана ────────────────────────────────────────────────────── */
#screen {
  position:relative;
  z-index:1;
  flex:1 1 auto;
  overflow-y:auto;
  padding:20px 16px 96px;
}
.screen-wrap { position:relative; z-index:1; }
.screen-wrap > * { position:relative; z-index:1; }
.screen-wrap > .kanji-bg { z-index:0; }

/* ── нижний таббар ─────────────────────────────────────────────────────── */
#tabbar {
  position:fixed;
  bottom:0;
  left:50%;
  transform:translateX(-50%);
  width:100%;
  max-width:480px;
  z-index:20;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  background:var(--surface);
  border-top:1px solid var(--line);
  padding:6px 4px calc(6px + env(safe-area-inset-bottom,0px));
}
.tab {
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:3px;
  padding:8px 2px 6px;
  background:none;
  border:0;
  cursor:pointer;
  color:var(--muted);
  transition:color .18s ease;
}
.tab svg { width:24px; height:24px; display:block; }
.tab .tab-label { font-size:11px; font-weight:500; letter-spacing:.01em; }
.tab::before {
  content:'';
  position:absolute;
  top:-1px; left:50%;
  transform:translateX(-50%) scaleX(0);
  width:26px; height:2px;
  border-radius:0 0 2px 2px;
  background:var(--accent);
  transition:transform .2s ease;
}
.tab:hover { color:var(--text); }
.tab.active { color:var(--accent); }
.tab.active::before { transform:translateX(-50%) scaleX(1); }
/* бейдж-точка «есть новое» (новые свитки на табе «Ещё») */
.tab-badge {
  position:absolute; top:5px; left:calc(50% + 8px);
  width:8px; height:8px; border-radius:50%;
  background:var(--accent); box-shadow:0 0 0 2px var(--surface);
}

/* ── компоненты ────────────────────────────────────────────────────────── */
.card {
  position:relative;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px;
}

.h1 { font-size:24px; font-weight:700; line-height:1.2; letter-spacing:-.01em; margin:0; }
.h2 { font-size:18px; font-weight:700; line-height:1.25; margin:0; }
.sub { font-size:14px; color:var(--muted); line-height:1.5; margin:0; }
.font-jp { font-family:var(--font-jp); }

.list { display:flex; flex-direction:column; gap:10px; }

.btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  height:48px;
  padding:0 20px;
  border-radius:12px;
  border:1px solid transparent;
  font-size:15px;
  font-weight:500;
  cursor:pointer;
  background:none;
  transition:transform .12s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
}
.btn:active { transform:translateY(1px); }
.btn-block { display:flex; width:100%; }
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:hover { background:#e35a44; }
.btn-ghost { background:transparent; border-color:var(--line); color:var(--text); }
.btn-ghost:hover { border-color:var(--muted); background:var(--surface2); }
.btn-washi { background:var(--washi); color:var(--washi-text); font-weight:700; }
.btn-washi:hover { background:#e7dcc6; }
.btn:disabled { opacity:.42; cursor:not-allowed; }
.btn:disabled:active { transform:none; }

.pill {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 12px;
  border-radius:999px;
  background:var(--surface2);
  border:1px solid var(--line);
  font-size:12.5px;
  font-weight:500;
  color:var(--text);
}

.kanji-bg {
  position:absolute;
  top:-14px;
  right:-8px;
  font-family:var(--font-jp);
  font-weight:700;
  font-size:140px;
  line-height:1;
  color:rgba(239,233,221,.05);
  user-select:none;
  pointer-events:none;
  z-index:0;
}

.fade-in { animation:fadeIn 240ms ease both; }
@keyframes fadeIn {
  from { opacity:0; transform:translateY(6px); }
  to   { opacity:1; transform:none; }
}

/* ── стоп-текст экранов ────────────────────────────────────────────────── */
.screen-head { margin-bottom:16px; }
.screen-head .h1 { margin-bottom:6px; }

/* ══════════════════════════════════════════════════════════════════════
   ПУТЬ — лестница из пяти залов, ритм «зал в день» (чекпоинт 006)
   ══════════════════════════════════════════════════════════════════════ */
.path-ladder {
  list-style:none; margin:14px 0 0; padding:0;
  display:flex; flex-direction:column; gap:12px;
}
.path-step { position:relative; }

/* строка зала: рельс с узлом-кандзи слева + карточка справа */
.hall-row {
  position:relative; display:flex; align-items:stretch; gap:14px;
  text-decoration:none; color:var(--text); cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:transform .12s ease;
}
.hall-row:active { transform:translateY(1px); }
.hall-row.is-static { cursor:default; }

/* рельс-колонка; вертикальная тропа — псевдоэлемент по центру */
.hall-rail {
  position:relative; flex:0 0 46px;
  display:flex; align-items:center; justify-content:center;
}
.hall-rail::before {
  content:''; position:absolute; left:50%; top:-12px; bottom:-12px;
  width:2px; transform:translateX(-1px);
  background:var(--line); z-index:0;
}
/* первый шаг — тропа стартует от узла; последний — обрывается на узле */
.path-step:first-child .hall-rail::before { top:50%; }
.path-step:last-child  .hall-rail::before { bottom:50%; }
/* отрезок тропы у пройденного зала — травяной */
.path-step.trail-walked .hall-rail::before { background:var(--grass); }

/* узел-кандзи — «станция» на тропе */
.hall-node {
  position:relative; z-index:1;
  width:46px; height:46px;
  display:flex; align-items:center; justify-content:center;
  font-size:24px; font-weight:700; line-height:1;
  color:var(--accent-soft);
  background:var(--surface2);
  border:1px solid var(--line);
  border-radius:12px;
}
.path-step.is-open .hall-node { color:var(--accent); border-color:var(--accent-soft); }
.path-step.is-done .hall-node {
  color:var(--grass); border-color:var(--grass); background:rgba(111,143,90,.12);
}

/* карточка зала */
.hall-card {
  position:relative; flex:1 1 auto; min-width:0;
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--radius); padding:14px 16px;
  transition:border-color .18s ease;
}
.hall-num {
  font-size:11px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--muted); margin-bottom:3px;
}
.hall-title { font-size:16px; margin-bottom:4px; }
.hall-status {
  display:flex; align-items:center; gap:6px;
  font-size:13px; line-height:1.4; color:var(--muted);
}
.hall-lock { display:inline-flex; flex:0 0 auto; color:var(--muted); }

/* открытый зал — киноварное свечение рамки, кликается */
.hall-row:hover .hall-card { border-color:var(--muted); }
.path-step.is-open .hall-card {
  border-color:var(--accent-soft);
  box-shadow:0 0 0 1px rgba(216,75,51,.12), 0 0 22px -7px rgba(216,75,51,.34);
}
.path-step.is-open .hall-row:hover .hall-card { border-color:var(--accent); }

/* приглушённые залы: prereq — вся строка; rhythm — всё, кроме «открыть сейчас» */
.path-step.is-prereq .hall-row { opacity:.55; }
.path-step.is-rhythm .hall-node,
.path-step.is-rhythm .hall-num,
.path-step.is-rhythm .hall-title,
.path-step.is-rhythm .hall-status { opacity:.5; }

/* печать «済» — киноварный оттиск на пройденном зале */
.hall-stamp {
  position:absolute; top:50%; right:14px; transform:translateY(-50%) rotate(-8deg);
  width:42px; height:42px;
  display:flex; align-items:center; justify-content:center;
  font-size:22px; font-weight:700; line-height:1;
  color:var(--accent);
  border:2px solid var(--accent); border-radius:9px;
  background:rgba(216,75,51,.06);
  box-shadow:inset 0 0 0 2px rgba(216,75,51,.22), 0 0 14px -4px rgba(216,75,51,.5);
  opacity:.92;
}
.path-step.is-done .hall-card { padding-right:66px; }

/* ритм-замок: «открыть сейчас» */
.hall-early-wrap { margin-top:12px; }
.hall-early { height:44px; padding:0 18px; font-size:13px; border-radius:10px; }
.hall-early-note {
  display:block; margin-top:8px; font-size:11.5px; line-height:1.4; color:var(--muted);
}

/* ══════════════════════════════════════════════════════════════════════
   ЗАЛ — список тренировок (чекпоинт 006)
   ══════════════════════════════════════════════════════════════════════ */
.hall-head { margin-bottom:18px; }
.hall-eyebrow {
  font-size:11px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--accent-soft); margin-bottom:6px;
}
.hall-h1 { margin-bottom:8px; }
.hall-intro { line-height:1.6; }

/* пункт-тренировка */
.tr-item {
  display:flex; align-items:center; gap:13px;
  padding:13px 14px; text-decoration:none; color:var(--text); cursor:pointer;
  transition:border-color .18s ease, background .18s ease, transform .12s ease;
}
.tr-item:hover { border-color:var(--muted); background:var(--surface2); }
.tr-item:active { transform:translateY(1px); }
.tr-item-mark {
  flex:0 0 auto; width:32px; height:32px;
  display:flex; align-items:center; justify-content:center;
  border-radius:50%;
  background:var(--surface2); border:1px solid var(--line);
  font-size:14px; font-weight:700; color:var(--muted);
}
.tr-item-mark.is-done {
  color:var(--grass); border-color:var(--grass); background:rgba(111,143,90,.14);
}
.tr-item-body { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:2px; }
.tr-item-title { font-size:15px; font-weight:600; line-height:1.3; }
.tr-item-status { font-size:12.5px; line-height:1.3; color:var(--muted); }
.tr-item-status.is-done { color:var(--grass); font-weight:600; }
.tr-item-cta { flex:0 0 auto; font-size:12px; color:var(--muted); letter-spacing:.02em; }
.tr-item-chev { flex:0 0 auto; color:var(--muted); }

/* плашка «Зал пройден» */
.hall-cleared {
  position:relative; margin-top:16px; padding:20px 16px; text-align:center;
  border-color:var(--grass); background:rgba(111,143,90,.07);
}
.hall-cleared-stamp {
  display:inline-flex; align-items:center; justify-content:center;
  width:48px; height:48px; margin-bottom:10px;
  font-size:26px; font-weight:700; line-height:1; color:var(--accent);
  border:2px solid var(--accent); border-radius:10px; transform:rotate(-8deg);
  background:rgba(216,75,51,.06);
  box-shadow:inset 0 0 0 2px rgba(216,75,51,.22);
}
.hall-cleared-title { font-size:17px; font-weight:700; color:var(--washi); }
.hall-cleared-sub {
  margin:6px auto 0; max-width:300px; font-size:13px; line-height:1.5; color:var(--muted);
}

/* ссылка на свиток внутри плашки */
.hall-scroll-link {
  display:flex; align-items:center; gap:12px; text-align:left;
  margin-top:16px; padding:12px 14px; border-radius:12px;
  background:var(--surface2); border:1px solid var(--line);
  text-decoration:none; color:var(--text); cursor:pointer;
  transition:border-color .18s ease, background .18s ease;
}
.hall-scroll-link:hover { border-color:var(--muted); }
.hall-scroll-link:active { transform:translateY(1px); }
.hall-scroll-k {
  flex:0 0 auto; width:36px; height:36px;
  display:flex; align-items:center; justify-content:center;
  font-size:20px; font-weight:700; line-height:1; color:var(--washi);
  background:var(--surface); border:1px solid var(--line); border-radius:9px;
}
.hall-scroll-body { flex:1 1 auto; min-width:0; }
.hall-scroll-label {
  display:block; font-size:10.5px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--muted);
}
.hall-scroll-title { display:block; font-size:15px; font-weight:700; color:var(--washi); }

/* пункт меню «Ещё» */
.menu-item {
  display:flex; align-items:center; gap:14px;
  text-decoration:none; color:var(--text); cursor:pointer;
  transition:border-color .18s ease, background .18s ease, transform .12s ease;
}
.menu-item:hover { border-color:var(--muted); background:var(--surface2); }
.menu-item:active { transform:translateY(1px); }
.menu-ico {
  flex:0 0 auto;
  width:42px; height:42px;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-jp);
  font-size:22px; font-weight:700;
  color:var(--text);
  background:var(--surface2);
  border:1px solid var(--line);
  border-radius:11px;
}
.menu-body { flex:1 1 auto; min-width:0; }
.menu-body .h2 { font-size:16px; margin-bottom:2px; }
.menu-chev { flex:0 0 auto; color:var(--muted); }

/* ── онбординг «Кайдзен-додзё» ──────────────────────────────────────────── */
body.onboarding #tabbar { display:none; }
body.onboarding #screen {
  display:flex;
  flex-direction:column;
  padding-bottom:calc(24px + env(safe-area-inset-bottom,0px));
}

.onb {
  position:relative;
  z-index:1;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  min-height:100%;
}

/* прогресс — шесть черт, активная киноварная */
.onb-progress {
  display:flex;
  gap:7px;
  justify-content:center;
  padding:2px 0 26px;
}
.onb-dot {
  width:26px; height:3px; border-radius:2px;
  background:var(--line);
  transition:background .35s ease;
}
.onb-dot.done   { background:var(--accent-soft); }
.onb-dot.active { background:var(--accent); }

.onb-body { flex:1 1 auto; display:flex; flex-direction:column; }
.onb-sub  { margin-top:14px; }
.onb-foot { flex:0 0 auto; padding-top:22px; }

/* ── диалог с мастером: аватар 師 + пузыри-реплики ──────────────────────── */
.onb-master { display:flex; align-items:flex-start; gap:12px; margin-bottom:4px; }
.onb-master-ava {
  flex:0 0 auto;
  display:flex; align-items:center; justify-content:center;
  width:46px; height:46px; border-radius:50%;
  background:var(--washi); color:var(--washi-text);
  font-size:22px; font-weight:700; line-height:1;
  /* кольцо вокруг бумаги-васи: зазор цвета фона + тонкий киноварный обод */
  box-shadow:0 0 0 2px var(--bg), 0 0 0 3.5px var(--accent-soft), 0 0 16px rgba(216,75,51,.16);
  user-select:none;
}
.onb-master-lines {
  flex:1 1 auto; min-width:0;
  display:flex; flex-direction:column; align-items:flex-start; gap:8px;
  padding-top:4px;
}
.onb-bubble {
  padding:11px 14px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:14px;
  border-top-left-radius:4px; /* «хвостик» реплики к аватару */
  font-size:15px; line-height:1.55; color:var(--text);
}
.onb-bubble--title  { font-size:20px; font-weight:700; line-height:1.3; }
.onb-bubble--accent { color:var(--accent); }
.onb-bubble--scout  { border-left:2px solid var(--accent); color:var(--washi); }

/* чипы триггеров: облик np-chip + тач-цель ≥44px */
.onb-trig-chips { margin-top:16px; }
.onb-chip {
  display:inline-flex; align-items:center;
  min-height:44px; padding:10px 16px;
}

/* мелкая текстовая кнопка («пока не знаю», «пропустить…») — тач-цель ≥44px */
.onb-textbtn {
  display:flex; align-items:center; justify-content:center;
  width:100%; min-height:44px;
  margin-top:6px; padding:10px;
  background:none; border:0; cursor:pointer;
  color:var(--muted); font-size:13.5px; font-weight:500;
  transition:color .18s ease;
}
.onb-textbtn:hover { color:var(--text); }

/* шаг 5 — мини-волна и скрытый финал */
.onb-wave-card { margin-top:16px; padding-bottom:6px; }
.onb-wave-final { margin-top:16px; }
.onb-wave-final .onb-bubble { margin-bottom:14px; }

/* шаг 6 — две крупные карточки облика пути */
.onb-mode-list { display:flex; flex-direction:column; gap:12px; margin-top:16px; }
.onb-mode-card {
  position:relative;
  display:flex; align-items:center; gap:16px;
  min-height:92px;
  padding:16px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  color:var(--text);
  text-align:left;
  cursor:pointer;
  transition:border-color .18s ease, background .18s ease, transform .12s ease;
}
.onb-mode-card:hover  { border-color:var(--muted); background:var(--surface2); }
.onb-mode-card:active { transform:translateY(1px); }
.onb-mode-card.selected { border-color:var(--accent); background:var(--surface2); }
/* киноварная точка выбранной карточки — общая форма (позиция у каждого класса своя) */
.onb-mode-card.selected::after, .habit-card.selected::after, .rb-card.selected::after,
.sf-change.selected::after, .mb-card.selected::after {
  content: ''; position: absolute;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px rgba(216, 75, 51, .6);
}
.onb-mode-card.selected::after { top: 12px; right: 12px; }
.onb-mode-glyph { flex:0 0 auto; font-size:34px; font-weight:700; line-height:1; color:var(--accent-soft); }
.onb-mode-card.selected .onb-mode-glyph { color:var(--accent); }
.onb-mode-body { display:flex; flex-direction:column; min-width:0; }
.onb-mode-name { font-size:16px; font-weight:700; line-height:1.3; }
.onb-mode-note { margin-top:4px; font-size:13px; line-height:1.45; color:var(--muted); }

/* шаг 1 — сетка привычек 2×N */
.habit-grid {
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:10px;
  margin-top:20px;
}
.habit-card {
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  min-height:106px;
  padding:14px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  color:var(--text);
  text-align:left;
  cursor:pointer;
  transition:border-color .18s ease, background .18s ease, transform .12s ease;
}
.habit-card:hover  { border-color:var(--muted); background:var(--surface2); }
.habit-card:active { transform:translateY(1px); }
.habit-card.selected { border-color:var(--accent); background:var(--surface2); }
.habit-card.selected::after { top: 11px; right: 11px; }
.habit-glyph { font-size:30px; font-weight:700; line-height:1; color:var(--accent-soft); }
.habit-card.selected .habit-glyph { color:var(--accent); }
.habit-name { font-size:14px; font-weight:500; line-height:1.25; }

/* поле «своя привычка» */
.onb-custom { margin-top:12px; }
.onb-input {
  width:100%; height:48px;
  padding:0 14px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:12px;
  color:var(--text);
  font-family:inherit; font-size:16px; /* <16px заставляет iOS Safari зумить вьюпорт при фокусе */
  outline:none;
  transition:border-color .18s ease;
}
.onb-input::placeholder { color:var(--muted); }
.onb-input:focus { border-color:var(--accent); }

/* шаг 2 — попытки */
.attempt-list { margin-top:20px; }
.attempt-card {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  width:100%;
  padding:18px 16px;
  color:var(--text);
  text-align:left;
  cursor:pointer;
}
.attempt-card:hover  { border-color:var(--muted); background:var(--surface2); }
.attempt-card:active { transform:translateY(1px); }
.attempt-label { font-size:15px; font-weight:500; }
.attempt-chev  { flex:0 0 auto; color:var(--muted); display:flex; }

/* шаг 3 — рефрейм (полноэкранная пауза) */
.onb-reframe { justify-content:center; padding:6px 0; }
.onb-kanji   { top:3%; right:-8px; font-size:200px; color:rgba(216,75,51,.055); }
.onb-reframe .h1 { font-size:26px; }
.onb-accent  { color:var(--accent); margin-top:4px; }
.onb-theses  { margin-top:24px; display:flex; flex-direction:column; gap:14px; }
.onb-thesis  { margin:0; font-size:16px; line-height:1.5; color:var(--text); }
.onb-scout   {
  padding-left:14px;
  border-left:2px solid var(--accent);
  color:var(--washi);
}
.onb-disclaimer { margin:28px 0 0; font-size:12px; line-height:1.5; color:var(--muted); }

/* ════════════════════════════════════════════════════════════════════════
   ТРЕНИРОВКИ (чекпоинт 003) — движок + пять простых типов
   ════════════════════════════════════════════════════════════════════════ */

/* ── шапка экрана тренировки ────────────────────────────────────────────── */
.tr-head { margin-bottom: 18px; }
.tr-back {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 13px; font-weight: 500;
  min-height: 44px; padding: 2px 10px 2px 0; margin-bottom: 6px;
  transition: color .18s ease;
}
.tr-back:hover { color: var(--text); }
.tr-back-ic { flex: 0 0 auto; }
.tr-progress {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px;
}
.tr-title { margin-bottom: 8px; }
.tr-intro { line-height: 1.55; }
.tr-body { position: relative; z-index: 1; }

/* заглушка «в разработке» / «не найдена» */
.tr-wip { text-align: left; }
.tr-wip-note { margin-top: 8px; line-height: 1.5; }
.tr-wip-back { margin-top: 16px; }

/* ── общий вид вариантов-кнопок (cards-choice, scenario-quiz, case) ─────── */
.cc-options, .sq-options, .cw-options { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.cc-opt, .sq-opt, .cw-opt {
  display: block; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--line);
  color: var(--text); font-size: 15px; line-height: 1.4; cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .12s ease, opacity .18s ease;
}
.cc-opt:hover, .sq-opt:hover, .cw-opt:hover { border-color: var(--muted); }
.cc-opt:active, .sq-opt:active, .cw-opt:active { transform: translateY(1px); }
.cc-opt.is-wrong, .sq-opt.is-wrong, .cw-opt.is-wrong {
  border-color: var(--accent-soft); background: rgba(138, 47, 32, .14);
}
.cc-opt.is-correct, .sq-opt.is-correct, .cw-opt.is-correct {
  border-color: var(--grass); background: rgba(111, 143, 90, .16); color: var(--text);
}
.cc-opt:disabled, .sq-opt:disabled, .cw-opt:disabled { cursor: default; }
.cc-opt:disabled:not(.is-correct), .sq-opt:disabled:not(.is-correct),
.cw-opt:disabled:not(.is-correct) { opacity: .5; }

.cc-hint, .sq-hint {
  margin-top: 14px; font-size: 13.5px; line-height: 1.5; color: var(--accent);
}
.cc-explain, .sq-explain {
  margin-top: 14px; padding-left: 14px;
  border-left: 2px solid var(--grass);
  font-size: 14.5px; line-height: 1.55; color: var(--washi);
}
.cc-foot:not(:empty), .sq-foot:not(:empty) { margin-top: 18px; }

/* ── cards-choice ──────────────────────────────────────────────────────── */
.cc-progress, .sq-progress {
  font-size: 12px; font-weight: 600; letter-spacing: .06em;
  color: var(--muted); margin-bottom: 10px; text-align: right;
}
.cc-voice {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-soft); margin-bottom: 8px;
}
.cc-label { font-size: 20px; font-weight: 700; line-height: 1.3; color: var(--text); }

/* ── needs-picker ──────────────────────────────────────────────────────── */
.np-question { font-size: 16px; line-height: 1.5; color: var(--text); margin-bottom: 16px; }
.np-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.np-chip {
  padding: 9px 15px; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--line);
  color: var(--text); font-size: 14px; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.np-chip:hover { border-color: var(--muted); }
.np-chip.selected { border-color: var(--accent); background: rgba(216, 75, 51, .16); }
.np-custom { display: flex; gap: 8px; margin-top: 14px; }
.np-input {
  flex: 1 1 auto; min-width: 0; height: 46px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); font-family: inherit; font-size: 16px; outline: none;
  transition: border-color .18s ease;
}
.np-input::placeholder { color: var(--muted); }
.np-input:focus { border-color: var(--accent); }
.np-add { flex: 0 0 auto; height: 46px; padding: 0 16px; }
.np-save { margin-top: 22px; }

/* ── text-form ─────────────────────────────────────────────────────────── */
.tf-field { margin-bottom: 18px; }
.tf-label {
  display: block; font-size: 14px; font-weight: 600;
  color: var(--text); margin-bottom: 8px;
}
.tf-textarea {
  width: 100%; min-height: 92px; resize: vertical;
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font-family: inherit; font-size: 16px; line-height: 1.5;
  outline: none; transition: border-color .18s ease;
}
.tf-textarea::placeholder { color: var(--muted); }
.tf-textarea:focus { border-color: var(--accent); }
.tf-counter { margin-top: 6px; font-size: 12px; color: var(--muted); text-align: right; }
.tf-counter.ok { color: var(--grass); }
.tf-save { margin-top: 6px; }

/* ── scenario-quiz ─────────────────────────────────────────────────────── */
.sq-scenario { font-size: 16px; line-height: 1.55; color: var(--text); }
.sq-question {
  margin-top: 14px; font-size: 13px; font-weight: 600;
  letter-spacing: .03em; color: var(--muted);
}
.sq-demon { margin-top: 20px; text-align: center; }
.sq-kanji {
  display: inline-block; transform-origin: center;
  font-size: 84px; line-height: 1; font-weight: 700; color: var(--accent);
  text-shadow: 0 0 22px rgba(216, 75, 51, .35);
  animation: demonShrink 620ms cubic-bezier(.4, 0, .2, 1) forwards;
}
@keyframes demonShrink {
  from { transform: scale(1); opacity: .92; }
  to   { transform: scale(.6); opacity: 1; }
}
.sq-demon-cap {
  margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--text);
}
.sq-demon .sq-explain { text-align: left; margin-top: 14px; }

/* ── unlock-info + церемониальное подтверждение ────────────────────────── */
.ui-title { margin-bottom: 14px; }
.ui-paras { display: flex; flex-direction: column; gap: 14px; }
.ui-para { margin: 0; font-size: 16px; line-height: 1.62; color: rgba(239, 233, 221, .86); }
.ui-confirm { margin-top: 24px; text-align: center; }
.ui-confirm-text { margin: 16px auto 0; max-width: 300px; line-height: 1.5; }

/* ── holdButton — кнопка-удержание с кольцом прогресса ─────────────────── */
.hold-btn {
  position: relative;
  width: 132px; height: 132px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface2); border: 1px solid var(--line);
  color: var(--text); font-size: 13px; font-weight: 600;
  text-align: center; padding: 0 24px; cursor: pointer;
  user-select: none; -webkit-user-select: none;
  touch-action: none; -webkit-tap-highlight-color: transparent;
  transition: border-color .2s ease, background .2s ease;
}
.hold-btn:active { background: var(--surface); }
.hold-btn.is-holding { border-color: var(--accent-soft); }
.hold-btn.is-done { border-color: var(--grass); background: rgba(111, 143, 90, .12); }
.hold-label { position: relative; z-index: 1; }
.hold-ring { position: absolute; inset: -1px; pointer-events: none; }
.hold-ring svg { display: block; width: 100%; height: 100%; transform: rotate(-90deg); }
.hold-track { fill: none; stroke: var(--line); stroke-width: 5; }
.hold-arc {
  fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round;
  transition: stroke .25s ease;
}
.hold-btn.is-done .hold-arc { stroke: var(--grass); }

/* ── экран «Тренировка пройдена» ───────────────────────────────────────── */
.tr-outcome, .hall-outcome {
  min-height: 62vh; display: flex; flex-direction: column; justify-content: center;
}
.tr-done, .hall-done { text-align: center; padding: 30px 22px; }
.tr-done .h1, .hall-done .h1 { margin-bottom: 8px; }
.tr-summary { max-width: 320px; margin: 0 auto; line-height: 1.55; }
.tr-done-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.tr-seal {
  width: 64px; height: 64px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--grass); border: 1.5px solid var(--grass);
  background: rgba(111, 143, 90, .10);
}
.tr-seal svg { width: 30px; height: 30px; }

/* ── церемония «Тренировка пройдена»: сцена самурая + мазок кисти ─────────
   .is-ceremony: мазок и кнопки скрыты, играет видео-сцена (тушь на бумаге).
   .is-revealed: мазок рисуется (dashoffset), брызги проявляются, кнопки
   всплывают. Глобальное prefers-reduced-motion правило гасит анимации, а
   JS в reduce-режиме вовсе не строит сцену. */
.tr-seal--brush {
  border: none; background: none; border-radius: 0;
  width: 96px; height: 72px; color: var(--accent);
}
.tr-seal--brush svg { width: 96px; height: 72px; filter: drop-shadow(0 0 10px rgba(216, 75, 51, .35)); }
.tr-done.is-ceremony .tr-seal--brush,
.tr-done.is-ceremony .tr-done-actions { display: none; }
.tr-scene {
  position: relative; width: min(100%, 300px); margin: 0 auto 16px;
  border-radius: 12px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line);
  transition: opacity .45s ease;
}
.tr-scene.is-gone { opacity: 0; pointer-events: none; }
.tr-scene-video { display: block; width: 100%; height: auto; }
.tr-scene-skip {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 14px 0 8px;
  text-align: center; font-size: 11.5px; letter-spacing: .04em;
  color: rgba(42, 38, 32, .6);
  background: linear-gradient(transparent, rgba(241, 232, 216, .75));
}
.brush-check-main { stroke-dasharray: 132; stroke-dashoffset: 132; }
.tr-done.is-revealed .brush-check-main { animation: brush-draw .6s cubic-bezier(.5, 0, .3, 1) forwards; }
@keyframes brush-draw { to { stroke-dashoffset: 0; } }
.brush-check-fleck { opacity: 0; }
.tr-done.is-revealed .brush-check-fleck { animation: brush-fleck .35s ease .5s forwards; }
@keyframes brush-fleck { to { opacity: .85; } }
.tr-done.is-revealed .tr-done-actions { animation: fadeup .5s ease .55s both; }
@keyframes fadeup { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tr-xp {
  margin: 14px auto 0; display: inline-flex; align-items: baseline; gap: 1px;
  padding: 7px 16px; border-radius: 999px;
  background: rgba(111, 143, 90, .14); border: 1px solid rgba(111, 143, 90, .5);
  color: var(--grass); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.tr-xp span { font-size: 12px; font-weight: 600; opacity: .8; }

/* ── экран «Зал пройден» — киноварная печать ───────────────────────────── */
.hall-seal {
  width: 92px; height: 92px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  font-size: 48px; font-weight: 700; color: #fff;
  background: var(--accent);
  box-shadow: 0 0 30px rgba(216, 75, 51, .4), inset 0 0 0 2px rgba(255, 255, 255, .14);
}
.scroll-unlock {
  margin-top: 22px; padding: 16px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--line);
}
.scroll-unlock-label {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 4px;
}
.scroll-unlock-title { font-size: 16px; font-weight: 700; color: var(--washi); margin-bottom: 14px; }
.hall-done .tr-done-actions { margin-top: 22px; }
.hall-done-rhythm { margin: 16px auto 0; max-width: 320px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.hall-done-announce {
  display: flex; align-items: center; gap: 12px; text-align: left;
  margin-top: 18px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface2); text-decoration: none; color: var(--text); cursor: pointer;
  transition: border-color .18s ease;
}
.hall-done-announce:hover { border-color: var(--muted); }
.hall-done-announce-k {
  flex: 0 0 auto; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--washi);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.hall-done-announce-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.hall-done-announce-title { font-size: 13.5px; font-weight: 700; color: var(--washi); line-height: 1.35; }
.hall-done-announce-sub { font-size: 12px; color: var(--accent-soft); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════════════
   СИМУЛЯЦИИ (чекпоинт 004): волна, подавление, пауза 3с, скан тела, цикл
   ══════════════════════════════════════════════════════════════════════ */

/* ── waveCanvas — волна тяги ───────────────────────────────────────────── */
.wave-card { padding: 14px 14px 16px; }
.wave-stage { position: relative; }
.wave-canvas { display: block; width: 100%; }
.wave-phase { min-height: 116px; margin-top: 6px; }
.wave-phase-name {
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px;
}
.wave-phase-inner.is-peak .wave-phase-name { color: var(--accent); }
.wave-phase-text { font-size: 14.5px; line-height: 1.55; color: var(--text); }
.wave-peak {
  margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--accent);
  font-size: 13.5px; line-height: 1.5; color: var(--accent);
}
.wave-foot { margin-top: 16px; }
.wave-timer {
  font-size: 12px; font-weight: 600; letter-spacing: .06em;
  color: var(--muted); text-align: center; margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.wave-giveup { padding: 22px 18px; }
.wave-give-title { font-size: 15.5px; line-height: 1.6; color: var(--text); }
.wave-give-phase {
  margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--line);
  font-size: 14px; line-height: 1.5; color: var(--muted);
}
.wave-give-phase b { color: var(--washi); font-weight: 700; }
.wave-give-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

/* ── breathCircle — дыхательный круг ───────────────────────────────────── */
.breath {
  position: relative; width: 200px; height: 200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
}
.breath-ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.breath-track { fill: none; stroke: var(--line); stroke-width: 2.5; }
.breath-prog { fill: none; stroke: var(--grass); stroke-width: 2.5; stroke-linecap: round; }
.breath-orb {
  width: 108px; height: 108px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(241, 232, 216, .28), rgba(241, 232, 216, .06) 62%),
    rgba(111, 143, 90, .16);
  border: 1px solid rgba(241, 232, 216, .25);
  box-shadow: 0 0 34px rgba(111, 143, 90, .28);
  display: flex; align-items: center; justify-content: center;
  will-change: transform;
}
.breath[data-phase="in"] .breath-orb { box-shadow: 0 0 44px rgba(111, 143, 90, .38); }
.breath-core {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--washi); opacity: .9;
}
.breath-label {
  position: absolute; left: 0; right: 0; bottom: -34px;
  text-align: center; font-size: 13px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
.breath[data-phase="in"] .breath-label { color: var(--washi); }

/* ── suppress-sim — шкала тяги ─────────────────────────────────────────── */
.ss-wrap { display: flex; flex-direction: column; align-items: center; }
.ss-readout { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.ss-readout-num {
  font-size: 44px; font-weight: 700; line-height: 1; color: var(--text);
  font-variant-numeric: tabular-nums; min-width: 58px; text-align: right;
}
.ss-readout-cap {
  font-size: 11px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--muted);
}
.ss-meter { display: flex; justify-content: center; }
.ss-track {
  position: relative; width: 64px; height: 220px;
  border-radius: 999px; overflow: hidden;
  background: var(--surface2); border: 1px solid var(--line);
}
.ss-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: 55%;
  background: linear-gradient(0deg, var(--grass) 0%, #a3854a 55%, var(--accent) 100%);
  border-radius: 0 0 999px 999px;
  transition: filter .3s ease, box-shadow .3s ease;
}
.ss-fill.is-peak {
  filter: saturate(1.5) brightness(1.15);
  box-shadow: 0 0 26px rgba(216, 75, 51, .5);
}
.ss-hint {
  margin-top: 14px; max-width: 300px; text-align: center;
  font-size: 13.5px; line-height: 1.5; color: var(--accent);
}
.ss-actions { display: flex; gap: 10px; margin-top: 18px; width: 100%; }
.ss-actions .btn { flex: 1 1 0; }
.ss-observe {
  user-select: none; -webkit-user-select: none;
  touch-action: none; -webkit-tap-highlight-color: transparent;
}
.ss-observe.is-holding {
  border-color: var(--grass); background: rgba(111, 143, 90, .16); color: var(--washi);
}
.ss-note { margin-top: 14px; text-align: center; max-width: 330px; }

/* ── hold-rounds — пауза в 3 секунды ───────────────────────────────────── */
.hr-status { text-align: center; }
.hr-count {
  font-size: 12px; font-weight: 600; letter-spacing: .08em;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.hr-wait {
  margin-top: 64px; margin-bottom: 64px;
  font-size: 15px; color: var(--muted); text-align: center;
  animation: hrPulse 1.6s ease-in-out infinite;
}
@keyframes hrPulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
.hr-impulse {
  display: block; width: 100%; margin-top: 16px;
  padding: 22px 18px; border-radius: var(--radius); cursor: pointer;
  background: rgba(216, 75, 51, .13);
  border: 1px solid var(--accent-soft);
  color: var(--washi); font-size: 18px; font-weight: 700; line-height: 1.35;
  text-align: center;
  animation: hrShake 420ms cubic-bezier(.36, .07, .19, .97) both;
  -webkit-tap-highlight-color: transparent;
}
@keyframes hrShake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
.hr-hold-wrap { margin-top: 26px; }
.hr-tip { margin-top: 18px; text-align: center; }
.hr-auto { margin-top: 20px; padding: 20px 18px; }
.hr-auto-text { font-size: 15px; line-height: 1.55; color: var(--text); text-align: center; }
.hr-fail { margin-top: 16px; padding: 24px 18px; text-align: center; }
.hr-fail-title { font-size: 18px; font-weight: 700; line-height: 1.3; }
.hr-fail-score { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.hr-fail-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

/* ── body-scan — силуэт и зоны ─────────────────────────────────────────── */
.bs-guide { margin: 0 0 6px; font-size: 15px; line-height: 1.6; color: var(--text); }
.bs-figure-wrap { display: flex; justify-content: center; margin-top: 10px; }
.bs-figure { width: 200px; height: 280px; }
.bs-line { stroke: var(--muted); stroke-width: 1.6; fill: none; opacity: .85; }
.bs-fill { stroke: var(--muted); stroke-width: 1.6; fill: rgba(239, 233, 221, .035); opacity: .85; }
.bs-zone { cursor: pointer; outline: none; }
.bs-zone-halo {
  fill: rgba(216, 75, 51, .07); stroke: none;
  transform-origin: center; transform-box: fill-box;
  animation: bsPulse 2.4s ease-in-out infinite;
}
.bs-zone-dot {
  fill: rgba(216, 75, 51, .14); stroke: rgba(216, 75, 51, .55);
  stroke-width: 1.2; stroke-dasharray: 3 4;
  transition: fill .2s ease, stroke .2s ease;
}
@keyframes bsPulse {
  0%, 100% { transform: scale(1); opacity: .5; }
  50% { transform: scale(1.18); opacity: 1; }
}
.bs-zone:hover .bs-zone-dot, .bs-zone:focus-visible .bs-zone-dot {
  fill: rgba(216, 75, 51, .3); stroke: var(--accent);
}
.bs-zone.is-active .bs-zone-dot {
  fill: rgba(216, 75, 51, .45); stroke: var(--accent); stroke-dasharray: none;
}
.bs-scan-tip { margin-top: 10px; text-align: center; }
.bs-pick-q { font-size: 15.5px; line-height: 1.5; color: var(--text); margin-bottom: 16px; }
.bs-demons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.bs-demon {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 12px 6px 10px; border-radius: 12px; cursor: pointer;
  background: var(--surface2); border: 1px solid var(--line); color: var(--text);
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.bs-demon:hover { border-color: var(--accent-soft); }
.bs-demon:active { transform: translateY(1px); }
.bs-demon-k { font-size: 26px; line-height: 1; font-weight: 700; color: var(--washi); }
.bs-demon-n { font-size: 10.5px; line-height: 1.25; color: var(--muted); text-align: center; }
.bs-breath { text-align: center; padding-top: 8px; }
.bs-breath-cap {
  font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 26px;
}
/* label дыхания абсолютный (bottom:-34px) — отступ ниже стейджа даём margin'ом,
   padding ушёл бы внутрь фиксированных 200px самого круга */
.bs-breath-stage { margin-bottom: 48px; }
.bs-breath-named { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* ── cycle-break — порочный круг ───────────────────────────────────────── */
.cb-task {
  font-size: 13px; font-weight: 700; letter-spacing: .06em;
  color: var(--washi); text-align: center; margin-bottom: 4px;
}
.cb-stage { display: flex; justify-content: center; }
.cb-svg { width: 100%; max-width: 330px; height: auto; }
.cb-arrow-line { fill: none; stroke: var(--muted); stroke-width: 1.4; opacity: .55; }
.cb-arrow-head { fill: none; stroke: var(--muted); stroke-width: 1.4; opacity: .55; }
.cb-arrow-close .cb-arrow-line, .cb-arrow-close .cb-arrow-head { stroke: var(--accent-soft); opacity: .8; }
.cb-arrow { transition: opacity .5s ease; }
.cb-arrow.is-broken { opacity: 0; }
.cb-node { cursor: pointer; outline: none; }
.cb-cap {
  fill: var(--surface2); stroke: var(--line); stroke-width: 1.2;
  transition: fill .2s ease, stroke .2s ease;
}
.cb-node:hover .cb-cap, .cb-node:focus-visible .cb-cap { stroke: var(--muted); }
.cb-label {
  fill: var(--text); font-size: 14px; font-weight: 600;
  font-family: var(--font); pointer-events: none;
}
.cb-crack {
  fill: none; stroke: var(--accent); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40; opacity: 0;
}
.cb-node.is-broken .cb-cap {
  fill: rgba(111, 143, 90, .12); stroke: var(--grass);
  animation: cbCrackCap 520ms ease both;
}
.cb-node.is-broken .cb-crack {
  opacity: 1;
  animation: cbCrackLine 460ms ease-out 120ms both;
}
.cb-node.is-broken .cb-label { fill: var(--washi); }
@keyframes cbCrackCap {
  0% { transform: translateX(0); }
  22% { transform: translateX(-2px); }
  44% { transform: translateX(2px); }
  66% { transform: translateX(-1px); }
  100% { transform: translateX(0); }
}
@keyframes cbCrackLine { to { stroke-dashoffset: 0; } }
.cb-node.cb-shake { animation: cbWrong 380ms ease both; }
@keyframes cbWrong {
  20% { transform: translateX(-3px); }
  45% { transform: translateX(3px); }
  70% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}
.cb-replacement {
  margin-top: 4px; padding: 14px 16px; border-radius: 12px;
  background: rgba(111, 143, 90, .1); border: 1px solid rgba(111, 143, 90, .45);
  font-size: 15px; line-height: 1.5; color: var(--grass); font-weight: 600;
}
.cb-replacement-mark {
  display: block; font-size: 10.5px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--grass); opacity: .75; margin-bottom: 4px;
}
.cb-hint {
  margin-top: 12px; font-size: 13.5px; line-height: 1.55; color: var(--accent);
}
.cb-foot:not(:empty) { margin-top: 18px; }

/* ══════════════════════════════════════════════════════════════════════
   КОНСТРУКТОРЫ (чекпоинт 005): замена, сцена, утро, формула срыва, свиток
   ══════════════════════════════════════════════════════════════════════ */

/* ── replace-builder — конструктор замены ──────────────────────────────── */
/* общий кикер лейблов тренировок/журнала (консолидация одинаковых правил) */
.rb-link-label, .rb-final-label, .sf-scene-label, .sf-final-label, .mb-final-label, .cw-story-label, .jr-day-head {
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}

.rb-link { padding: 14px 16px; margin-bottom: 16px; }
.rb-link-label {
  color: var(--accent-soft); margin-bottom: 6px;
}
.rb-link-needs { font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--washi); }
.rb-link-empty { font-size: 14px; font-weight: 500; color: var(--muted); }
.rb-pick-cap { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 10px 2px; }
.rb-list { display: flex; flex-direction: column; gap: 10px; }
.rb-card {
  position: relative; display: block; width: 100%; text-align: left;
  padding: 13px 38px 13px 16px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--line);
  color: var(--text); cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.rb-card:hover { border-color: var(--muted); }
.rb-card:active { transform: translateY(1px); }
.rb-card.selected { border-color: var(--accent); background: rgba(216, 75, 51, .08); }
.rb-card.selected::after { top: 16px; right: 14px; }
.rb-name { display: block; font-size: 15px; font-weight: 600; line-height: 1.35; }
.rb-desc { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.rb-custom { margin-top: 10px; }
.rb-input {
  width: 100%; height: 46px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); font-family: inherit; font-size: 16px; outline: none;
  transition: border-color .18s ease;
}
.rb-input::placeholder { color: var(--muted); }
.rb-input:focus { border-color: var(--accent); }
.rb-next { margin-top: 18px; }
.rb-check { padding: 20px 18px; }
.rb-choice-name { font-size: 19px; font-weight: 700; line-height: 1.3; color: var(--washi); }
.rb-question { margin-top: 14px; font-size: 15px; line-height: 1.55; color: var(--text); }
.rb-check-actions { display: flex; gap: 10px; margin-top: 20px; }
.rb-check-actions .btn { flex: 1 1 0; }
.rb-warn { padding: 20px 18px; border-color: var(--accent-soft); }
.rb-warn-kanji {
  font-size: 44px; line-height: 1; font-weight: 700;
  color: var(--accent); opacity: .8; margin-bottom: 12px;
}
.rb-warn-text { font-size: 15px; line-height: 1.6; color: var(--text); }
.rb-final { padding: 22px 18px; text-align: center; }
.rb-final-label {
  color: var(--muted); margin-bottom: 8px;
}
.rb-final-name { font-size: 21px; font-weight: 700; line-height: 1.3; color: var(--washi); }
.rb-final-outro { margin: 14px auto 0; max-width: 330px; font-size: 14px; line-height: 1.55; color: var(--muted); }

/* ── scene-form — разрушение сцены ─────────────────────────────────────── */
.sf-group { margin-bottom: 18px; }
.sf-group-title { font-size: 13px; font-weight: 700; color: var(--washi); margin-bottom: 9px; }
.sf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-custom { margin-top: 10px; }
.sf-custom .np-input, .sf-custom .np-add { height: 44px; }
.sf-next { margin-top: 6px; }
.sf-scene { padding: 14px 16px; margin-bottom: 18px; }
.sf-scene-label {
  color: var(--accent-soft); margin-bottom: 6px;
}
.sf-scene-line { font-size: 15.5px; font-weight: 600; line-height: 1.45; color: var(--washi); }
.sf-changes { display: flex; flex-direction: column; gap: 9px; }
.sf-change {
  position: relative; display: block; width: 100%; text-align: left;
  padding: 12px 36px 12px 15px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--line);
  color: var(--text); font-size: 14px; line-height: 1.45; cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.sf-change:hover { border-color: var(--muted); }
.sf-change:active { transform: translateY(1px); }
.sf-change.selected { border-color: var(--accent); background: rgba(216, 75, 51, .08); }
.sf-change.selected::after { top: 15px; right: 13px; }
.sf-final { padding: 22px 18px; }
.sf-final-label {
  color: var(--accent); margin-bottom: 8px;
}
.sf-final-change { font-size: 18px; font-weight: 700; line-height: 1.4; color: var(--washi); }
.sf-outro { margin: 14px 0 0; font-size: 14px; line-height: 1.55; color: var(--muted); }

/* ── morning-builder — утреннее обнуление ──────────────────────────────── */
.mb-count {
  font-size: 12px; font-weight: 600; letter-spacing: .08em;
  color: var(--muted); margin-bottom: 10px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.mb-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.mb-card {
  position: relative; min-height: 62px; padding: 11px 26px 11px 13px;
  display: flex; align-items: center; text-align: left;
  background: var(--surface2); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); font-size: 13.5px; line-height: 1.35; font-weight: 500; cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .12s ease, opacity .18s ease;
}
.mb-card:hover { border-color: var(--muted); }
.mb-card:active { transform: translateY(1px); }
.mb-card.selected { border-color: var(--accent); background: rgba(216, 75, 51, .08); }
.mb-card.selected::after { top: 10px; right: 10px; width: 7px; height: 7px; }
.mb-card.is-blocked { opacity: .45; cursor: default; }
.mb-custom { margin-top: 12px; }
.mb-build { margin-top: 18px; }
.mb-final { padding: 22px 18px; }
.mb-final-label {
  color: var(--accent-soft); margin-bottom: 14px;
}
.mb-final-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.mb-final-item { display: flex; align-items: center; gap: 12px; }
.mb-seal {
  flex: 0 0 auto; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 17px; font-weight: 700;
  color: var(--accent); background: rgba(216, 75, 51, .1);
  border: 1px solid rgba(216, 75, 51, .45);
}
.mb-final-text { font-size: 15px; font-weight: 600; line-height: 1.35; }
.mb-outro { margin: 16px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }

/* ── case-walkthrough — формула срыва ──────────────────────────────────── */
.cw-story { padding: 18px 16px; }
.cw-story-label {
  color: var(--accent-soft); margin-bottom: 8px;
}
.cw-story-text { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text); }
.cw-name { color: var(--washi); font-weight: 700; }
.cw-next { margin-top: 16px; }
.cw-progress {
  font-size: 12px; font-weight: 600; letter-spacing: .06em;
  color: var(--muted); margin-bottom: 10px; text-align: right;
}
.cw-question { font-size: 16px; font-weight: 700; line-height: 1.4; }
.cw-comment-wrong {
  margin-top: 14px; padding-left: 14px;
  border-left: 2px solid var(--accent-soft);
  font-size: 13.5px; line-height: 1.55; color: var(--accent);
}
.cw-comment-ok {
  margin-top: 14px; padding-left: 14px;
  border-left: 2px solid var(--grass);
  font-size: 14.5px; line-height: 1.55; color: var(--washi);
}
.cw-foot:not(:empty) { margin-top: 18px; }
.cw-final { padding: 20px 18px; }
.cw-outro { margin: 0; font-size: 15px; line-height: 1.6; color: var(--text); }
.cw-plaque {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px; padding: 13px 14px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--washi);
}
.cw-plaque-k { flex: 0 0 auto; font-size: 22px; line-height: 1; color: var(--accent); }

/* ── formula-final — свиток личной формулы на бумаге васи ──────────────── */
.ff-scroll { position: relative; padding: 0 6px; }
.ff-roller {
  position: relative; height: 16px; border-radius: 8px; z-index: 1;
  background: linear-gradient(180deg, #4A4033, #2B241C 58%, #191510);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .4), inset 0 1px 0 rgba(241, 232, 216, .14);
}
.ff-roller::before, .ff-roller::after {
  content: ''; position: absolute; top: 3px;
  width: 9px; height: 10px; border-radius: 4px;
  background: linear-gradient(180deg, #6B5C46, #3A3125);
}
.ff-roller::before { left: -6px; }
.ff-roller::after { right: -6px; }
.ff-paper {
  position: relative; margin: -4px 8px; padding: 24px 20px 22px;
  background:
    radial-gradient(150% 70% at 50% -15%, rgba(42, 38, 32, .07), transparent 55%),
    radial-gradient(150% 70% at 50% 115%, rgba(42, 38, 32, .07), transparent 55%),
    repeating-linear-gradient(0deg, rgba(42, 38, 32, .018) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(42, 38, 32, .012) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, #F5EDDE, var(--washi) 40%, #EBDFC8);
  color: var(--washi-text);
  box-shadow: inset 0 0 34px rgba(42, 38, 32, .07);
}
.ff-kicker {
  font-size: 10.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(42, 38, 32, .5); text-align: center;
}
.ff-title { margin: 6px 0 0; font-size: 22px; font-weight: 700; text-align: center; color: var(--washi-text); }
.ff-rule { width: 46px; height: 2px; margin: 14px auto 20px; background: var(--accent); }
.ff-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 15px; }
.ff-item { display: flex; align-items: flex-start; gap: 12px; }
.ff-num {
  flex: 0 0 auto; width: 27px; height: 27px; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(216, 75, 51, .5); border-radius: 8px;
  font-size: 14px; font-weight: 700; color: #B03A26;
}
.ff-text { font-size: 14.5px; line-height: 1.55; color: #38322A; }
.ff-var {
  font-style: normal; font-weight: 700; color: var(--washi-text);
  border-bottom: 1px solid rgba(216, 75, 51, .45);
}
.ff-outro { margin: 18px 6px 0; text-align: center; }
.ff-accept { margin-top: 16px; }

/* ══════════════════════════════════════════════════════════════════════
   ЭКРАН «СЕГОДНЯ» (чекпоинт 007): тропа, SOS, чек-ин, ритуалы, формула
   ══════════════════════════════════════════════════════════════════════ */
.today-wrap { display: flex; flex-direction: column; gap: 14px; }
.today-head .h1 { margin-bottom: 4px; }
.today-status { margin: 6px 0 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* ── ведущая нить: карточка «Следующий шаг» (главный CTA экрана) ─────────── */
.next-step {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  padding: 16px; min-height: 64px;
  border: 1px solid var(--accent-soft);
  background: linear-gradient(150deg, rgba(241, 232, 216, .10), rgba(216, 75, 51, .06) 62%, rgba(216, 75, 51, .02));
}
.next-step::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
}
.next-step-training {
  text-decoration: none; color: var(--text); cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.next-step-training:hover { border-color: var(--accent); }
.next-step-training:active { transform: translateY(1px); }
.next-step.is-fresh {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(216, 75, 51, .22), 0 10px 34px -14px rgba(216, 75, 51, .7);
}
.next-step-k {
  flex: 0 0 auto; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: var(--washi);
  background: rgba(241, 232, 216, .08); border: 1px solid var(--line); border-radius: 12px;
}
.next-step-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.next-step-return { display: block; font-size: 12px; font-weight: 600; color: var(--grass); margin-bottom: 5px; }
.next-step-kicker {
  display: block; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-soft); margin-bottom: 4px;
}
.next-step-kicker.is-fresh { color: var(--accent); font-weight: 700; }
.next-step-title { display: block; font-size: 17px; font-weight: 700; line-height: 1.3; color: var(--washi); }
.next-step-sub { display: block; font-size: 13px; line-height: 1.45; color: var(--muted); margin-top: 3px; }
.next-step .tr-item-chev { color: var(--accent-soft); }
.next-step-early {
  align-self: flex-start; margin-top: 12px;
  min-height: 44px; padding: 0 16px;
  display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 600; color: var(--accent);
  background: transparent; border: 1px solid var(--accent-soft); border-radius: 10px; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.next-step-early:hover { border-color: var(--accent); background: rgba(216, 75, 51, .06); }
.next-step-done-link {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px;
  font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; cursor: pointer;
}
.next-step-done-link:hover { color: #e35a44; }

/* разбор срыва в ведущей нити — киноварный акцент сильнее обычного шага */
.next-step-slip {
  text-decoration: none; color: var(--text); cursor: pointer;
  border-color: var(--accent);
  background: linear-gradient(150deg, rgba(216, 75, 51, .12), rgba(216, 75, 51, .05) 62%, rgba(216, 75, 51, .02));
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.next-step-slip:hover { background: linear-gradient(150deg, rgba(216, 75, 51, .16), rgba(216, 75, 51, .06)); }
.next-step-slip:active { transform: translateY(1px); }
.next-step-slip .next-step-k { color: var(--accent); }
.next-step-kicker.is-slip { color: var(--accent); font-weight: 700; }

/* ── сцена тропы ────────────────────────────────────────────────────────── */
.today-trail { padding: 16px 16px 14px; }
.trail-svg { display: block; width: 100%; height: auto; }
.trail-ground { fill: none; stroke: rgba(239, 233, 221, .09); stroke-width: 1; stroke-linecap: round; }
.trail-old-base { fill: none; stroke: #4A443C; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.trail-grass { stroke: var(--grass); stroke-width: 1.5; stroke-linecap: round; }
.trail-new { fill: none; stroke: #D8CFBD; stroke-linecap: round; stroke-linejoin: round; }
.trail-enso { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; opacity: .8; }
.trail-legend {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 4px 12px; margin-top: 12px;
}
.trail-leg { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; line-height: 1.4; color: var(--muted); }
.trail-leg:first-child { margin-right: auto; }
.trail-leg:last-child { margin-left: auto; }
.trail-leg b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.trail-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; }
.trail-dot-old { background: var(--grass); }
.trail-dot-new { background: #D8CFBD; }

/* ── SOS — тёмная поверхность с киноварной рамкой (разведена с обычными CTA) ──
   В момент тяги контрастирует пульсацией рамки; в спокойный день не «орёт»
   сплошным красным, как «Сделал»/primary. */
.sos-btn {
  position: relative; display: flex; flex-direction: row; align-items: center; gap: 14px;
  width: 100%; min-height: 64px; padding: 12px 18px; text-align: left;
  border: 2px solid var(--accent); border-radius: var(--radius);
  background: var(--surface2); color: var(--accent); cursor: pointer;
  box-shadow: 0 0 0 1px rgba(216, 75, 51, .16), 0 0 20px -8px rgba(216, 75, 51, .6);
  animation: sosPulse 3s ease-in-out infinite;
  -webkit-tap-highlight-color: transparent;
}
.sos-btn:active { transform: translateY(1px); }
.sos-btn-glyph {
  flex: 0 0 auto; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); border-radius: 11px;
  background: rgba(216, 75, 51, .1); border: 1px solid var(--accent-soft);
}
.sos-btn-glyph svg { width: 22px; height: 22px; }
.sos-btn-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sos-btn-label { color: var(--accent); }
.sos-btn-sub { font-size: 12px; font-weight: 500; color: var(--muted); }
/* пульсация свечения рамки (reduced-motion глушит глобальным правилом ниже) */
@keyframes sosPulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(216, 75, 51, .14), 0 0 16px -8px rgba(216, 75, 51, .5); }
  50%      { box-shadow: 0 0 0 1px rgba(216, 75, 51, .4), 0 0 30px -6px rgba(216, 75, 51, .9); }
}

/* ── плашка «Открыт мусин» (одноразовая на «Сегодня») ────────────────────── */
.musin-intro { display: flex; gap: 14px; align-items: flex-start; border-color: var(--accent-soft); background: rgba(216, 75, 51, .05); }
.musin-intro-k { flex: 0 0 auto; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: var(--accent); }
.musin-intro-body { flex: 1 1 auto; min-width: 0; }
.musin-intro-title { font-size: 16px; font-weight: 700; color: var(--washi); margin: 2px 0 5px; }
.musin-intro-text { margin: 0 0 12px; font-size: 13.5px; line-height: 1.55; color: var(--text); }
.musin-intro-ok { min-height: 44px; }

/* ── весть от мастера (экран «Сегодня») ─────────────────────────────────── */
.mnote { position: relative; display: flex; gap: 14px; align-items: flex-start; }
.mnote-k {
  flex: 0 0 auto; width: 44px; height: 44px; display: flex; align-items: center;
  justify-content: center; border-radius: 50%; font-size: 22px; font-weight: 700;
  color: var(--washi-text); background: var(--washi);
  box-shadow: 0 0 0 1.5px var(--accent-soft);
}
.mnote-body { flex: 1 1 auto; min-width: 0; padding-right: 30px; }
.mnote-text { margin: 4px 0 10px; font-size: 14px; line-height: 1.6; color: var(--text); }
.mnote-link {
  display: inline-flex; align-items: center; min-height: 44px;
  font-size: 13.5px; font-weight: 600; color: var(--accent); cursor: pointer;
}
.mnote-close {
  position: absolute; top: 4px; right: 4px; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--muted); cursor: pointer;
}
.mnote-close svg { width: 16px; height: 16px; }
.mnote-close:hover { color: var(--text); }

/* ── чек-ин ─────────────────────────────────────────────────────────────── */
.checkin-card { display: flex; flex-direction: column; gap: 12px; }
.checkin-card.is-done { flex-direction: row; align-items: center; gap: 14px; border-color: rgba(111, 143, 90, .5); background: rgba(111, 143, 90, .06); }
.checkin-body { flex: 1 1 auto; min-width: 0; }
.checkin-title { font-size: 16px; font-weight: 700; }
.checkin-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.checkin-card.is-done .checkin-sub { color: var(--grass); font-weight: 600; }
.checkin-check {
  flex: 0 0 auto; width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  color: var(--grass); border: 1.5px solid var(--grass); background: rgba(111, 143, 90, .12);
}
.checkin-check svg { width: 20px; height: 20px; }

/* ── общий кикер задания ────────────────────────────────────────────────── */
.task-kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-soft); margin-bottom: 6px; }

/* ── разовое задание сцены ──────────────────────────────────────────────── */
.scene-task-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.scene-task-change { margin: 0 0 14px; font-size: 14.5px; line-height: 1.5; color: var(--washi); }

/* ── ритуалы ────────────────────────────────────────────────────────────── */
.ritual-section { display: flex; flex-direction: column; gap: 10px; }
.section-cap { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.ritual-head { margin-bottom: 12px; }
.ritual-label { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.ritual-name { display: block; font-size: 16px; font-weight: 700; line-height: 1.35; color: var(--washi); }
.ritual-note { display: block; margin-top: 4px; font-size: 12px; line-height: 1.4; color: var(--muted); }
/* пояснение термина «мусин» — один раз над блоком ритуалов */
.ritual-musin-explain { margin: 0 2px 2px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.ritual-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.ritual-do { height: 44px; padding: 0 16px; font-size: 14px; flex: 1 1 auto; }
.ritual-musin { flex: 1 1 100%; }
.ritual-musin-note { margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.ritual-done { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--grass); }
.ritual-done svg { flex: 0 0 auto; width: 18px; height: 18px; }
.ritual-empty p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.ritual-empty-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 600; color: var(--accent); cursor: pointer; text-decoration: none; }
.ritual-empty-link:hover { color: #e35a44; }

/* ── утреннее обнуление — суб-чеки ──────────────────────────────────────── */
.morning-steps { display: flex; flex-direction: column; gap: 8px; }
.morning-step {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 9px 12px; border-radius: 11px;
  background: var(--surface2); border: 1px solid var(--line); color: var(--text); cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.morning-step:hover { border-color: var(--muted); }
.morning-step.is-on { border-color: var(--grass); background: rgba(111, 143, 90, .1); }
.morning-box {
  flex: 0 0 auto; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; border: 1.5px solid var(--line); color: var(--grass);
}
.morning-step.is-on .morning-box { border-color: var(--grass); background: rgba(111, 143, 90, .18); }
.morning-box svg { width: 14px; height: 14px; }
.morning-text { font-size: 14px; line-height: 1.3; }
.morning-prompt { margin-top: 12px; }
.morning-prompt-q { font-size: 13px; font-weight: 700; color: var(--washi); margin-bottom: 9px; }

/* ── микро-победа ───────────────────────────────────────────────────────── */
.micro-card { display: flex; align-items: center; gap: 14px; }
.micro-body { flex: 1 1 auto; min-width: 0; }
.micro-title { font-size: 15px; font-weight: 700; }
.micro-count { font-size: 12.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.micro-count b { color: var(--text); font-weight: 700; }
.micro-btn { flex: 0 0 auto; height: 44px; padding: 0 16px; }

/* ── карточка «Моя формула» ─────────────────────────────────────────────── */
.formula-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.formula-card:hover { border-color: var(--muted); background: var(--surface2); }
.formula-card:active { transform: translateY(1px); }
.formula-k {
  flex: 0 0 auto; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: var(--washi);
  background: var(--surface2); border: 1px solid var(--line); border-radius: 11px;
}
.formula-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.formula-title { font-size: 16px; font-weight: 700; }
.formula-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ── оверлей формулы ────────────────────────────────────────────────────── */
.formula-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 24px 16px;
}
.formula-backdrop {
  position: absolute; inset: 0; background: rgba(10, 9, 7, .8);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.formula-dialog {
  position: relative; z-index: 1; width: 100%; max-width: 420px;
  max-height: 92vh; overflow-y: auto; overscroll-behavior: contain;
  padding: 44px 2px 8px;
}
.formula-close {
  position: absolute; top: 2px; right: 2px; z-index: 2;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--line);
  color: var(--text); cursor: pointer; transition: border-color .18s ease, background .18s ease;
}
.formula-close:hover { border-color: var(--muted); background: var(--surface2); }
.formula-close svg { width: 18px; height: 18px; }

/* ══════════════════════════════════════════════════════════════════════
   SOS-ПРОТОКОЛ «ВОЛНА ПРИШЛА» + РАЗБОР СРЫВА (чекпоинт 008)
   ══════════════════════════════════════════════════════════════════════ */

/* полноэкранный режим: таббар скрыт, экран — колонка на всю высоту */
body.sosmode #tabbar { display: none; }
body.sosmode #screen {
  display: flex; flex-direction: column;
  padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
}

.sos-flow {
  position: relative; z-index: 1;
  flex: 1 1 auto; display: flex; flex-direction: column; min-height: 100%;
}
.sos-flow--embed { min-height: 66vh; }              /* репетиция внутри тренировки */
.sos-flow--intro { min-height: 100%; }

/* ── вводная «Правило десяти минут» (новичок до t23) ────────────────────── */
.sos-intro { padding: 8px 0; }
.sos-intro-k { font-size: 52px; line-height: 1; font-weight: 700; color: var(--accent-soft); opacity: .85; margin-bottom: 22px; }
.sos-intro-plate {
  width: 100%; max-width: 340px; padding: 22px 20px; text-align: center;
  border-radius: 14px; border: 1px solid #d9ccb0; color: var(--washi-text);
  background: linear-gradient(180deg, #F5EDDE, var(--washi) 45%, #EBDFC8);
  box-shadow: 0 14px 40px -20px rgba(0, 0, 0, .7);
}
.sos-intro-title { font-size: 18px; font-weight: 700; color: var(--washi-text); margin-bottom: 10px; }
.sos-intro-text { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--washi-text); opacity: .92; }
.sos-intro-go { margin-top: 26px; max-width: 340px; }
.sos-intro-later {
  margin-top: 14px; background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 13px; padding: 8px 10px; transition: color .18s ease;
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
}
.sos-intro-later:hover { color: var(--text); }

/* верх: индикатор из черт + мелкая ссылка «уйти» */
.sos-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 30px; margin-bottom: 10px;
}
.sos-dots { display: flex; gap: 6px; }
.sos-dot { width: 26px; height: 3px; border-radius: 2px; background: var(--line); transition: background .35s ease; }
.sos-dot.done { background: var(--accent-soft); }
.sos-dot.active { background: var(--accent); }
.sos-exit {
  display: inline-flex; align-items: center; min-height: 44px;
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font-size: 13px; font-weight: 500; padding: 0 8px; transition: color .18s ease;
}
.sos-exit:hover { color: var(--text); }
.sos-exit-spacer { width: 1px; height: 1px; }

.sos-stage { position: relative; flex: 1 1 auto; display: flex; flex-direction: column; }

/* программный фокус на заголовок шага (a11y кризисного флоу) — без обводки:
   цель недостижима с клавиатуры (tabindex=-1), фокус ставит только код */
.sos-flow [data-sos-focus]:focus { outline: none; }

.sos-center {
  flex: 1 1 auto; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 12px 0 8px;
}

/* ── общие заголовки шагов ─────────────────────────────────────────────── */
.sos-head { margin-bottom: 16px; }
.sos-q { font-size: 22px; line-height: 1.25; }
.sos-lead { margin-top: 8px; line-height: 1.55; }

/* ── шаг 1 «Стоп» ──────────────────────────────────────────────────────── */
.sos-stop-title { font-size: 66px; font-weight: 700; line-height: 1; letter-spacing: -.02em; color: var(--washi); }
.sos-stop-sub { margin: 18px auto 0; max-width: 300px; font-size: 16px; line-height: 1.55; color: var(--muted); }
.sos-hold-wrap { margin-top: 42px; }
.sos-stop-tip { margin-top: 26px; }

/* ── шаг 2/3 — силуэт и сетка демонов ──────────────────────────────────── */
.sos-figure { margin-top: 4px; }
.sos-demons { margin-top: 4px; }
.sos-unknown {
  display: block; width: 100%; margin-top: 14px; padding: 13px 16px;
  border-radius: 12px; background: transparent; border: 1px dashed var(--line);
  color: var(--muted); font-size: 14px; cursor: pointer;
  transition: border-color .18s ease, color .18s ease;
}
.sos-unknown:hover { border-color: var(--muted); color: var(--text); }

/* вспышка «демон назван» */
.sos-flash-k {
  font-size: 88px; line-height: 1; font-weight: 700; color: var(--accent);
  text-shadow: 0 0 28px rgba(216, 75, 51, .4);
  animation: demonShrink 620ms cubic-bezier(.4, 0, .2, 1) forwards;
}
.sos-flash-cap { margin-top: 16px; max-width: 300px; font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--washi); }

/* ── шаг 4 «Волна» — тьма, тушь, мягкий текст ──────────────────────────── */
.sos-wave { display: flex; flex-direction: column; padding-top: 10px; }
.sos-wave-stage { position: relative; margin: 0 -4px; }
.sos-wave-cap {
  min-height: 86px; margin-top: 12px; text-align: center;
  font-size: 15.5px; line-height: 1.6; color: rgba(239, 233, 221, .9);
}
.sos-wave-cap.is-peak { color: var(--accent); }
.sos-wave-cap.is-done { color: var(--grass); }
.sos-wave-timer {
  margin-top: 6px; text-align: center; font-size: 13px; font-weight: 600;
  letter-spacing: .08em; color: var(--muted); font-variant-numeric: tabular-nums;
}
.sos-wave-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
/* во время праздника победы кнопки растворяются — сцена принадлежит волне */
.sos-wave-actions.is-celebrating { opacity: .18; pointer-events: none; transition: opacity .6s ease; }
/* подпись под неактивной «Волна прошла» — гаснет при активации кнопки */
.sos-wave-passed-hint { margin-top: 10px; text-align: center; font-size: 12.5px; line-height: 1.4; color: var(--muted); }

/* ── подтверждение выхода ──────────────────────────────────────────────── */
.sos-confirm { width: 100%; max-width: 340px; text-align: center; }
.sos-confirm-title { margin-bottom: 8px; }
.sos-confirm-sub { margin: 0 auto 22px; max-width: 300px; }
.sos-confirm-actions { display: flex; flex-direction: column; gap: 10px; }

/* ── шаг 5 «Итог» / финал разбора ──────────────────────────────────────── */
.sos-outcome { padding: 8px 4px 4px; }
.sos-outcome .h1 { margin-top: 6px; }
.sos-outcome--survived .h1, .sos-outcome--review .h1 { color: var(--washi); }
.sos-outcome-lead { margin: 12px auto 0; max-width: 320px; font-size: 15px; line-height: 1.6; color: var(--muted); }
.sos-outcome-seal {
  width: 72px; height: 72px; margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  color: var(--grass); border: 1.5px solid var(--grass); background: rgba(111, 143, 90, .12);
  box-shadow: 0 0 30px -8px rgba(111, 143, 90, .55);
}
.sos-outcome-seal svg { width: 34px; height: 34px; }
/* победный экран: печать «выпрыгивает» (reduced-motion гасится глобальным правилом) */
.sos-outcome--survived .sos-outcome-seal { animation: seal-pop .55s cubic-bezier(.3, 1.45, .45, 1) both; }
@keyframes seal-pop {
  0% { transform: scale(.5); opacity: 0; }
  62% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
.sos-outcome-mins {
  margin: 14px auto 0; max-width: 320px;
  font-size: 13.5px; font-weight: 600; line-height: 1.5; color: var(--grass);
}
.sos-outcome-k { font-size: 58px; line-height: 1; font-weight: 700; color: var(--accent); opacity: .85; margin-bottom: 2px; }
.sos-xp {
  margin: 18px auto 0; display: inline-flex; align-items: baseline; gap: 1px;
  padding: 8px 18px; border-radius: 999px;
  background: rgba(111, 143, 90, .14); border: 1px solid rgba(111, 143, 90, .5);
  color: var(--grass); font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.sos-xp span { font-size: 12px; font-weight: 600; opacity: .8; }
.sos-outcome > .btn, .sos-outcome-actions, .sos-plan { margin-top: 22px; }
.sos-outcome-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; }

/* ── разбор срыва — кикер, карточки, чипы ──────────────────────────────── */
.sos-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent-soft); margin-bottom: 12px;
}
.sos-cards { display: flex; flex-direction: column; gap: 10px; }
.sos-card {
  position: relative; display: block; width: 100%; text-align: left;
  padding: 15px 40px 15px 16px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--line);
  color: var(--text); font-size: 15px; line-height: 1.45; cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.sos-card:hover { border-color: var(--muted); }
.sos-card:active { transform: translateY(1px); }
.sos-card.selected { border-color: var(--accent); background: rgba(216, 75, 51, .08); }
.sos-card.selected::after {
  content: ''; position: absolute; top: 50%; right: 14px; transform: translateY(-50%);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px rgba(216, 75, 51, .6);
}
.sos-card--custom { border-style: dashed; color: var(--muted); }
.sos-card--custom.selected { color: var(--text); }
.sos-other { margin-top: 10px; }
.sos-feel { margin-bottom: 2px; }
.sos-cta { margin-top: 20px; }

/* план после падения — бумага васи */
.sos-plan { width: 100%; }
.sos-plan-paper {
  text-align: left; padding: 18px 18px 16px; border-radius: 12px; color: var(--washi-text);
  background: linear-gradient(180deg, #F5EDDE, var(--washi) 45%, #EBDFC8);
  box-shadow: inset 0 0 26px rgba(42, 38, 32, .07);
}
.sos-plan-kicker {
  font-size: 10.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: rgba(42, 38, 32, .55); margin-bottom: 12px;
}
.sos-plan-row { padding: 9px 0; border-top: 1px solid rgba(42, 38, 32, .14); }
.sos-plan-row:first-of-type { border-top: 0; padding-top: 0; }
.sos-plan-label { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #B03A26; margin-bottom: 3px; }
.sos-plan-val { font-size: 14.5px; line-height: 1.5; color: #38322A; }

/* ── репетиция (t23): плашка-note над флоу ─────────────────────────────── */
.sos-tut-note { display: flex; gap: 13px; align-items: flex-start; border-color: var(--accent-soft); background: rgba(138, 47, 32, .06); }
.sos-tut-k { flex: 0 0 auto; font-size: 30px; line-height: 1; color: var(--accent); opacity: .85; }
.sos-tut-text { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--text); }
.sos-tut-flow { margin-top: 16px; }

/* ══════════════════════════════════════════════════════════════════════
   ЖУРНАЛ · ДЕМОНЫ · СВИТКИ (чекпоинт 009)
   ══════════════════════════════════════════════════════════════════════ */

/* ── Журнал: стат-плитки 2×2 ───────────────────────────────────────────── */
.journal-wrap { display: flex; flex-direction: column; gap: 16px; }
.jr-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.jr-stat {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 15px;
}
.jr-stat-num {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 30px; font-weight: 700; line-height: 1; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.jr-stat-suffix { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.jr-stat-cap { margin-top: 8px; font-size: 12px; line-height: 1.3; color: var(--muted); }

/* ── Журнал: лента по дням ─────────────────────────────────────────────── */
.jr-day-head {
  color: var(--accent-soft); margin-bottom: 10px;
}
.journal-wrap .jr-day + .jr-day { margin-top: 4px; }
.jr-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.jr-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line);
}
.jr-glyph {
  flex: 0 0 auto; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; line-height: 1;
  color: var(--muted); background: var(--surface2);
  border: 1px solid var(--line); border-radius: 8px;
}
.jr-text { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 1.45; color: var(--text); }
/* акценты по типам события */
.jr-item.is-hall .jr-glyph {
  color: var(--accent); border-color: var(--accent-soft); background: rgba(216, 75, 51, .08);
}
.jr-item.is-hall .jr-text { color: var(--washi); font-weight: 600; }
.jr-item.is-wave .jr-glyph, .jr-item.is-slip .jr-glyph {
  color: var(--grass); border-color: rgba(111, 143, 90, .5); background: rgba(111, 143, 90, .1);
}
.jr-item.is-slip .jr-text { color: var(--washi); }
/* «волна победила» — намеренно нейтрально, без тревоги */
.jr-item.is-gaveup .jr-glyph { color: var(--muted); }
.jr-item.is-gaveup .jr-text { color: var(--muted); }
.jr-item.is-micro .jr-glyph { color: var(--muted); }
.jr-badge {
  display: inline-block; margin-left: 8px; padding: 2px 8px; vertical-align: middle;
  border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  color: var(--accent); background: rgba(216, 75, 51, .1); border: 1px solid rgba(216, 75, 51, .4);
}

/* ── Журнал: пустое состояние ──────────────────────────────────────────── */
.jr-empty { text-align: center; padding: 30px 22px; }
.jr-empty-k { display: block; font-size: 46px; line-height: 1; color: rgba(239, 233, 221, .14); margin-bottom: 12px; }
.jr-empty-text { margin: 0 auto 18px; max-width: 280px; font-size: 14.5px; line-height: 1.55; color: var(--muted); }

/* ── Демоны: сетка 3×3 ─────────────────────────────────────────────────── */
.dm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; align-items: start; margin-top: 4px; }
.dm-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px;
  min-height: 130px; padding: 16px 8px 13px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-align: center; cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .12s ease;
}
.dm-card:hover { border-color: var(--accent-soft); }
.dm-card:active { transform: translateY(1px); }
.dm-kanji {
  display: flex; align-items: center; justify-content: center; height: 64px;
  line-height: 1; font-weight: 700; color: var(--accent);
  text-shadow: 0 0 20px rgba(216, 75, 51, .28);
}
.dm-name { font-size: 12.5px; font-weight: 700; line-height: 1.2; color: var(--washi); }
.dm-count { font-size: 10.5px; line-height: 1.25; color: var(--muted); }
/* не названный демон — тусклый силуэт */
.dm-card.is-unnamed { border-style: dashed; }
.dm-card.is-unnamed .dm-kanji { color: var(--text); opacity: .25; text-shadow: none; }
.dm-card.is-unnamed .dm-name { color: var(--muted); }
/* раскрытие подсказки — регион-сосед кнопки (a11y: aria-controls + hidden);
   в сетке занимает всю строку сразу под рядом своего демона */
.dm-card.is-open { border-color: var(--accent-soft); }
.dm-hint {
  grid-column: 1 / -1; display: block; text-align: left;
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--accent-soft);
  animation: fadeIn 240ms ease both;
}
.dm-hint[hidden] { display: none; }
.dm-hint-cap {
  display: block; font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-soft); margin-bottom: 5px;
}
.dm-hint-text { font-size: 13px; line-height: 1.5; color: var(--muted); }

/* ── Свитки: список карточек ───────────────────────────────────────────── */
.sc-list { display: flex; flex-direction: column; gap: 10px; }
.sc-card {
  position: relative; display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left; padding: 15px 16px; border-radius: var(--radius);
}
/* открытый свиток — бумага васи, кликается */
.sc-card.sc-open {
  cursor: pointer; color: var(--washi-text);
  background: linear-gradient(180deg, #F5EDDE, var(--washi) 45%, #EBDFC8);
  border: 1px solid #D9CCB0; box-shadow: inset 0 0 26px rgba(42, 38, 32, .06);
  transition: transform .12s ease, box-shadow .2s ease;
}
.sc-open:hover { box-shadow: inset 0 0 26px rgba(42, 38, 32, .06), 0 8px 22px -13px rgba(0, 0, 0, .55); }
.sc-open:active { transform: translateY(1px); }
.sc-open-k {
  flex: 0 0 auto; width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; line-height: 1; color: #B03A26;
  background: rgba(176, 58, 38, .08); border: 1px solid rgba(176, 58, 38, .28); border-radius: 10px;
}
.sc-open-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sc-open-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(42, 38, 32, .5);
}
.sc-open-title { font-size: 16px; font-weight: 700; line-height: 1.3; color: var(--washi-text); }
.sc-open .tr-item-chev { flex: 0 0 auto; color: rgba(42, 38, 32, .42); }
.sc-badge {
  position: absolute; top: -7px; right: 12px; z-index: 1;
  padding: 3px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #fff; background: var(--accent); box-shadow: 0 4px 12px -4px rgba(216, 75, 51, .7);
}
/* закрытый свиток — тёмная карточка с условием */
.sc-card.sc-locked { align-items: flex-start; background: var(--surface); border: 1px solid var(--line); }
.sc-locked-k {
  flex: 0 0 auto; width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; line-height: 1; color: var(--muted);
  background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; opacity: .5;
}
.sc-locked-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; padding-top: 2px; }
.sc-locked-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.sc-locked-cond { font-size: 13.5px; line-height: 1.4; color: var(--text); }

/* ── Свитки: чтение (под-режим экрана) ─────────────────────────────────── */
.sc-reader { display: flex; flex-direction: column; }
.sc-reader-back { margin-bottom: 14px; }
.sc-paper {
  position: relative; padding: 26px 22px 24px; border-radius: var(--radius); color: var(--washi-text);
  background:
    repeating-linear-gradient(0deg, rgba(42, 38, 32, .016) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, rgba(42, 38, 32, .01) 0 1px, transparent 1px 6px),
    linear-gradient(180deg, #F5EDDE, var(--washi) 40%, #EBDFC8);
  box-shadow: inset 0 0 34px rgba(42, 38, 32, .07);
}
.sc-paper-kicker {
  font-size: 10.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase;
  color: rgba(42, 38, 32, .5);
}
.sc-paper-title { margin: 6px 0 0; font-size: 22px; font-weight: 700; line-height: 1.25; color: var(--washi-text); }
.sc-paper-rule { width: 46px; height: 2px; margin: 14px 0 18px; background: var(--accent); }
.sc-paper-text { margin: 0; font-size: 17px; line-height: 1.7; color: #38322A; }
.sc-reader-collapse { margin-top: 16px; }

/* ── экран «Настройки» ─────────────────────────────────────────────────── */
.set-list { gap: 12px; }
.set-card-title { margin-bottom: 4px; }
.set-card-sub { margin-bottom: 14px; }

/* режим подачи — радио-пара */
.set-modes { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.set-mode {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface2); cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.set-mode input[type="radio"] {
  flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0;
  accent-color: var(--accent); cursor: pointer;
}
.set-mode.is-active { border-color: var(--accent); background: rgba(216,75,51,.08); }
.set-mode.is-disabled { opacity: .5; cursor: not-allowed; }
.set-mode.is-disabled input { cursor: not-allowed; }
.set-mode-body { display: flex; flex-direction: column; gap: 3px; }
.set-mode-name { font-size: 15px; font-weight: 700; color: var(--washi); }
.set-mode-note { font-size: 13px; line-height: 1.45; color: var(--muted); }

/* имя воина */
.set-name-input { margin-bottom: 12px; }
.set-name-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.set-name-cur { font-size: 13px; color: var(--muted); }
.set-name-cur b { color: var(--text); font-weight: 600; }
.set-name-save { height: 44px; padding: 0 18px; }

/* данные — сброс */
.set-danger .set-reset-btn { color: var(--accent); border-color: var(--accent-soft); width: 100%; }
/* .btn задаёт display, поэтому UA-правило [hidden]{display:none} не срабатывает — гасим явно */
.set-reset-btn[hidden] { display: none; }
.set-danger .set-reset-btn:hover { border-color: var(--accent); background: rgba(216,75,51,.06); }
.set-reset-confirm { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.set-reset-warn { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--text); }
.set-reset-actions { display: flex; gap: 10px; }
.set-reset-actions .btn { flex: 1; height: 44px; }
.set-reset-yes { background: var(--accent); color: #fff; }
.set-reset-yes:hover { background: #e35a44; }

/* о тренажёре */
.set-about-text { margin-bottom: 14px; }
.set-version { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }

/* инлайн-форма имени воина (раскрывается при выборе «Максимальной игры») */
.set-warrior-form { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.set-warrior-form[hidden] { display: none; }
.set-warrior-q { display: block; font-size: 14px; font-weight: 600; color: var(--washi); margin-bottom: 10px; }
.set-warrior-input { margin-bottom: 6px; }
.set-warrior-err { font-size: 12.5px; line-height: 1.4; color: var(--accent); margin: 2px 0 10px; }
.set-warrior-err[hidden] { display: none; }
.set-warrior-go { margin-top: 8px; }

/* ── аккаунт: синк пути с сервером (Task 21) ────────────────────────────── */
.set-account-form { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.set-account-input { margin: 0; }
.set-account-warn { margin: 2px 0 2px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.set-account-actions { display: flex; flex-direction: column; gap: 8px; }
.set-account-actions .btn { height: 46px; }
.set-account-err { font-size: 13px; line-height: 1.45; color: var(--accent); }
.set-account-err:empty { display: none; }
/* залогинен */
.set-account-me { display: flex; align-items: center; gap: 9px; margin-top: 2px; }
.set-account-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; }
.set-account-dot.is-ok { background: var(--grass); box-shadow: 0 0 8px -1px rgba(111, 143, 90, .8); }
.set-account-dot.is-off { background: var(--muted); }
.set-account-dot.is-err { background: var(--accent); box-shadow: 0 0 8px -1px rgba(216, 75, 51, .7); }
.set-account-who { font-size: 15px; color: var(--text); }
.set-account-who b { font-weight: 700; color: var(--washi); }
.set-account-sync-note { margin: 6px 0 14px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.set-account-logout-note { margin: 8px 0 0; font-size: 12px; line-height: 1.4; color: var(--muted); text-align: center; }
/* однократная зелёная строка «Путь сохранён на сервере» */
.set-account-saved {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px;
  font-size: 13.5px; font-weight: 600; color: var(--grass);
}
.set-account-saved svg { flex: 0 0 auto; }

/* ══════════════════════════════════════════════════════════════════════
   РЕЖИМ «МАКСИМАЛЬНАЯ ИГРА»: карта «Путь воина» (редизайн Stitch),
   персонаж (011)
   ══════════════════════════════════════════════════════════════════════ */

/* ── карта: полноэкранная бумага васи между тёмными топбаром и таббаром ─── */
.mp-wrap {
  --mp-paper: #F4EDDC; --mp-ink: #2A2620; --mp-ink-soft: #6B6357;
  --mp-seal: #9B2130; --mp-seal-dark: #8A2F24; --mp-seal-deep: #6E1220;
  --mp-cur: #B22235; --mp-glow: 233, 92, 122;
  margin: -20px -16px -96px;          /* вырваться из паддингов #screen */
}
.mp-paper {
  position: relative; overflow: hidden; color: var(--mp-ink);
  padding: 24px 0 110px;              /* низ — просвет под фикс-таббар */
  background:
    radial-gradient(120% 30% at 14% 6%, rgba(150, 122, 82, .10), transparent 60%),
    radial-gradient(90% 24% at 90% 30%, rgba(150, 122, 82, .08), transparent 55%),
    radial-gradient(100% 26% at 24% 62%, rgba(150, 122, 82, .07), transparent 60%),
    radial-gradient(110% 24% at 80% 88%, rgba(150, 122, 82, .08), transparent 60%),
    linear-gradient(180deg, #F6F0E2, var(--mp-paper) 40%, #EDE2C9);
}

/* шапка карты: крупный заголовок в 2 строки + имя воина кикером */
.mp-head { position: relative; z-index: 2; padding: 8px 22px 4px; }
.mp-title {
  margin: 0; font-size: 45px; line-height: .98; font-weight: 800;
  letter-spacing: -.015em; color: var(--mp-ink);
}
.mp-warrior {
  margin-top: 10px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--mp-ink-soft);
}

/* секции провинций: всё позиционировано в макетной сетке 480px (см. MP в
   game.js) — x в процентах, y в px; высота секции задаётся инлайном */
.mp-provinces { position: relative; display: flex; flex-direction: column; }
.mp-prov { position: relative; }

/* шапка провинции — слева; врата босса встают правее неё */
.mp-prov-head {
  position: absolute; z-index: 2; left: 22px; right: 47%; top: 12px;
  pointer-events: none;
}
.mp-prov-name { font-size: 24px; font-weight: 700; line-height: 1.12; color: var(--mp-seal-dark); }
.mp-prov-status { margin-top: 5px; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--mp-ink-soft); }
.mp-prov-status.is-done { color: var(--mp-seal-dark); }
.mp-prov-kanji { margin-top: 10px; font-size: 52px; line-height: 1; font-weight: 700; color: var(--mp-seal); }
/* закрытая провинция: имя и кандзи уходят в тушь (как на мокапе) */
.mp-prov-prereq .mp-prov-name, .mp-prov-rhythm .mp-prov-name { color: var(--mp-ink); }
.mp-prov-prereq .mp-prov-kanji, .mp-prov-rhythm .mp-prov-kanji { color: var(--mp-ink); opacity: .7; }

/* дорога: крупные киноварные точки по гладкой кривой (HTML-кружки — идеально
   круглые при любой ширине колонки) */
.mp-roadway { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.mp-dot {
  position: absolute; width: 5.5px; height: 5.5px; border-radius: 50%;
  background: var(--mp-seal); transform: translate(-50%, -50%); opacity: .92;
}
.mp-dot.is-done { background: var(--mp-seal-deep); }
.mp-dot.is-locked { opacity: .38; }
/* свечение сегмента у фронта пути — статика, reduced-motion не касается */
.mp-glowdot {
  position: absolute; width: 34px; height: 34px; border-radius: 50%;
  transform: translate(-50%, -50%); filter: blur(3px);
  background: radial-gradient(circle, rgba(var(--mp-glow), .34), rgba(var(--mp-glow), 0) 70%);
}

/* ── узлы-шаги ── */
.mp-node { position: absolute; z-index: 2; transform: translate(-50%, -50%); }
.mp-nd {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; padding: 0; border: 0; border-radius: 50%;
  background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.mp-nd[aria-disabled="true"] { cursor: default; }

/* пройденный: тёмно-бордовый диск с белой галкой */
.mp-node-done .mp-nd {
  background: linear-gradient(155deg, #8E1B2C, #6E1220 78%);
  box-shadow: 0 6px 16px rgba(70, 12, 20, .35), inset 0 1px 0 rgba(255, 255, 255, .16);
}
.mp-nd-check { width: 34px; height: 34px; color: #FDF8EC; }

/* текущий (фронт пути): крупнее, ярче, белый самурай, двойной ободок, ореол */
.mp-node-cur { z-index: 3; }
.mp-node-cur .mp-nd {
  width: 78px; height: 78px;
  background: radial-gradient(circle at 34% 28%, #C93147, var(--mp-cur) 52%, #8E1B2C);
  box-shadow:
    inset 0 0 0 2.5px rgba(255, 251, 240, .85),
    0 0 0 4px var(--mp-paper),
    0 0 0 5.5px rgba(155, 33, 48, .72),
    0 8px 26px rgba(178, 34, 53, .38),
    0 0 36px rgba(var(--mp-glow), .45);
}
.mp-node-cur .mp-nd::before {
  content: ''; position: absolute; inset: -20px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(var(--mp-glow), .4), rgba(var(--mp-glow), 0) 68%);
  animation: mpHalo 2.6s ease-out infinite;
}
@keyframes mpHalo {
  0% { transform: scale(.82); opacity: .65; }
  70% { opacity: .15; }
  100% { transform: scale(1.5); opacity: 0; }
}
/* фронт в ещё закрытой провинции (ритм «зал в день») — чуть приглушён */
.mp-node-cur .mp-nd[aria-disabled="true"] { filter: saturate(.72); opacity: .85; }
.mp-nd-sam { width: 42px; height: 41px; }
.mp-nd-sam .s-robe, .mp-nd-sam .s-head, .mp-nd-sam .s-kasa { fill: #FDF8EC; }
.mp-nd-sam .s-katana { stroke: #FDF8EC; stroke-width: .9; stroke-linecap: round; fill: none; }

/* открытый/закрытый: бумажный круг (непрозрачный — декор не просвечивает
   сквозь пиктограмму), ободок-пунктир точками, пиктограмма */
.mp-node-avail .mp-nd, .mp-node-locked .mp-nd { background: #FAF3E3; }
.mp-nd-ring { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--mp-seal); }
.mp-nd-ic { position: relative; width: 27px; height: 27px; color: var(--mp-seal-dark); }
.mp-nd-q { position: relative; font-size: 30px; font-weight: 800; line-height: 1; color: var(--mp-seal-dark); }
.mp-node-locked { opacity: .45; }

/* ── узлы-медальоны: суми-э иллюстрация шага в круге (16 из 17; t41 — старый вид) ── */
.mp-node--art .mp-nd {
  width: 74px; height: 74px; overflow: hidden; background: var(--mp-paper);
  box-shadow: 0 0 0 2px rgba(155, 33, 48, .5), 0 5px 14px rgba(70, 45, 22, .22);
}
.mp-nd-art { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.mp-nd-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* пройдено — травяной ободок + значок-галочка; арт остаётся виден */
.mp-node--art.mp-node-done .mp-nd {
  background: var(--mp-paper);
  box-shadow: 0 0 0 2px rgba(111, 143, 90, .8), 0 5px 14px rgba(40, 60, 30, .2);
}
.mp-nd-badge {
  position: absolute; right: -2px; top: -2px; width: 25px; height: 25px; border-radius: 50%;
  background: var(--grass); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3); z-index: 3;
}
.mp-nd-badge svg { width: 15px; height: 15px; }
/* закрыто — приглушено, обесцвечено */
.mp-node--art.mp-node-locked .mp-nd { box-shadow: 0 0 0 2px rgba(120, 110, 95, .5); }
.mp-node--art.mp-node-locked .mp-nd-art img { filter: grayscale(.55); }
/* текущий — крупнее, двойной вермилион-ободок + пульс (ореол ::before уже задан) */
.mp-node--art.mp-node-cur .mp-nd {
  width: 88px; height: 88px; background: var(--mp-paper);
  box-shadow:
    0 0 0 3px rgba(255, 251, 240, .9), 0 0 0 5px var(--mp-paper),
    0 0 0 7px rgba(155, 33, 48, .8), 0 8px 26px rgba(178, 34, 53, .34),
    0 0 34px rgba(var(--mp-glow), .4);
}

/* ── иллюстрация-герой провинции: суми-э сцена в верху секции, справа ── */
.mp-hero { position: absolute; top: 0; right: 0; width: 60%; height: 150px; z-index: 0; pointer-events: none; }
.mp-hero img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 38%;
  mix-blend-mode: multiply; opacity: .92;
  -webkit-mask-image: radial-gradient(130% 118% at 84% 40%, #000 40%, transparent 84%);
  mask-image: radial-gradient(130% 118% at 84% 40%, #000 40%, transparent 84%);
}
.mp-prov-locked .mp-hero img, .mp-prov-rhythm .mp-hero img { opacity: .5; filter: grayscale(.4); }

/* подпись узла: «Шаг N:» + название; сторона — от зигзага дороги */
.mp-nd-lab {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 1px;
  width: max-content; max-width: min(176px, 32vw); pointer-events: none;
}
.mp-nd-lab-r { left: calc(100% + 14px); }
.mp-nd-lab-l { right: calc(100% + 14px); align-items: flex-end; text-align: right; }
.mp-nd-step { font-size: 13px; font-weight: 600; color: var(--mp-ink-soft); }
.mp-nd-title { font-size: 17.5px; font-weight: 700; line-height: 1.18; color: var(--mp-ink); }
/* бумажный ореол подписей: текст обязан читаться поверх туш-декора */
.mp-nd-step, .mp-nd-title, .mp-prov-name, .mp-prov-status {
  text-shadow:
    0 1px 0 rgba(244, 237, 220, .95), 0 -1px 0 rgba(244, 237, 220, .95),
    1px 0 0 rgba(244, 237, 220, .95), -1px 0 0 rgba(244, 237, 220, .95),
    0 0 8px rgba(244, 237, 220, .9), 0 0 16px rgba(244, 237, 220, .8);
}

/* ── врата босса: штриховые тории ── */
.mp-gate .mp-nd { width: 64px; height: 56px; border-radius: 12px; }
.mp-gate-svg { width: 54px; height: 46px; color: #47413A; }
.mp-gate-svg path { stroke: currentColor; }
.mp-gate-locked { opacity: .8; }
/* в ещё закрытой провинции запертые врата приглушены сильнее */
.mp-prov-prereq .mp-gate-locked, .mp-prov-rhythm .mp-gate-locked { opacity: .55; }
.mp-gate-avail .mp-gate-svg {
  color: var(--mp-seal);
  filter: drop-shadow(0 0 9px rgba(var(--mp-glow), .55));
}
.mp-gate-done .mp-gate-svg { color: #3E3831; }
.mp-gate-stamp {
  position: absolute; top: 0; right: -4px; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border: 1.6px solid var(--mp-seal); border-radius: 5px; transform: rotate(-8deg);
  font-size: 12px; font-weight: 700; color: var(--mp-seal);
  background: rgba(252, 246, 232, .88);
}

/* киноварные печати «жизни» на обочине текущей провинции */
.mp-stamps { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.mp-stamp { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 64px; }
.mp-stamp-l { left: 8px; top: 46%; }
.mp-stamp-r { right: 8px; top: 66%; }
.mp-stamp-num {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; border: 2px solid rgba(155, 33, 48, .72);
  background: rgba(155, 33, 48, .05); color: var(--mp-seal);
  font-size: 17px; font-weight: 800; transform: rotate(-8deg);
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 0 0 1.5px rgba(155, 33, 48, .18);
}
.mp-stamp-cap { font-size: 10px; font-weight: 600; letter-spacing: .04em; color: var(--mp-ink-soft); }

/* футер-счётчик */
.mp-foot {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: center;
  gap: 8px; padding: 28px 16px 0; font-size: 12.5px; color: var(--mp-ink-soft);
}
.mp-foot-item { font-weight: 600; } .mp-foot-dot { opacity: .5; }

/* тултип «провинция закрыта» — плашка в тон бумаги */
.mp-tip {
  position: fixed; left: 50%; bottom: 86px; z-index: 30; transform: translateX(-50%);
  max-width: 300px; padding: 9px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--mp-ink);
  background: #FBF5E8; border: 1px solid rgba(155, 33, 48, .4);
  box-shadow: 0 6px 20px rgba(42, 32, 20, .3); animation: mpTipIn .16s ease;
}
.mp-tip[hidden] { display: none; }
@keyframes mpTipIn {
  from { opacity: 0; transform: translate(-50%, 6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ── экран «Персонаж» ───────────────────────────────────────────────────── */
.char-wrap { display: flex; flex-direction: column; gap: 18px; }
.char-eyebrow {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-soft); margin-bottom: 6px;
}
.char-name { margin-bottom: 2px; }
.char-section { display: flex; flex-direction: column; gap: 10px; }

/* характеристики — карточка с уровнем и прогресс-баром */
.char-stats { display: flex; flex-direction: column; gap: 10px; }
.char-stat { padding: 14px 16px; }
.char-stat-top {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 11px;
}
.char-stat-name { font-size: 15px; font-weight: 700; color: var(--washi); }
.char-stat-lvl { display: inline-flex; align-items: baseline; gap: 5px; flex: 0 0 auto; }
.char-stat-lvl-cap { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.char-stat-lvl-num {
  font-size: 18px; font-weight: 700; line-height: 1; color: var(--accent);
  min-width: 16px; text-align: right;
}
.char-stat-bar {
  position: relative; height: 8px; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--line); overflow: hidden;
}
.char-stat-fill {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  box-shadow: 0 0 14px -3px rgba(216, 75, 51, .6);
  transition: width .4s ease;
}
.char-stat-foot {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-top: 9px;
}
.char-stat-desc { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.char-stat-prog {
  flex: 0 0 auto; font-size: 12px; font-weight: 600; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* инвентарь техник — компакт-сетка 3×N */
.char-inv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.char-item {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 7px;
  min-height: 86px; padding: 12px 8px; border-radius: 12px;
  text-align: center; cursor: default;
}
.char-item.is-open { background: var(--surface2); border: 1px solid rgba(216, 75, 51, .4); }
.char-item.is-locked { background: var(--surface); border: 1px dashed var(--line); }
.char-item-glyph { font-size: 22px; line-height: 1; font-weight: 700; }
.char-item.is-open .char-item-glyph { color: var(--accent); text-shadow: 0 0 14px rgba(216, 75, 51, .3); }
.char-item.is-locked .char-item-glyph { color: var(--text); opacity: .22; }
.char-item-name { font-size: 11px; font-weight: 600; line-height: 1.25; color: var(--washi); }

/* низ — тизер боссов/карты */
.char-teaser { display: flex; align-items: center; gap: 14px; }
.char-teaser-k { flex: 0 0 auto; font-size: 30px; line-height: 1; color: var(--accent-soft); opacity: .85; }
.char-teaser-text { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* тушь-глиф предмета (общий для персонажа, инвентаря и SOS-опоры) */
.itg { display: block; width: 30px; height: 30px; }
.char-item-glyph { display: flex; align-items: center; justify-content: center; height: 30px; }
.char-item.is-open .char-item-glyph { color: var(--accent); }
.char-item.is-open .itg { filter: drop-shadow(0 0 8px rgba(216, 75, 51, .3)); }
.char-item-glyph--q { font-size: 22px; }

/* шапка блока инвентаря на персонаже + ссылка «весь инвентарь» */
.char-inv-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.char-inv-all {
  flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 44px;
  font-size: 12.5px; font-weight: 600; color: var(--accent);
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: color .18s ease;
}
.char-inv-all:hover { color: #e35a44; }
a.char-inv-grid { text-decoration: none; color: inherit; cursor: pointer; }
a.char-inv-grid:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; border-radius: 12px; }

/* ══════════════════════════════════════════════════════════════════════
   ИНВЕНТАРЬ ТЕХНИК #/inventory (чекпоинт 013)
   ══════════════════════════════════════════════════════════════════════ */
.inv-wrap { display: flex; flex-direction: column; gap: 14px; }
.inv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; align-items: start; }
.inv-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px;
  min-height: 126px; padding: 15px 9px 12px; border-radius: var(--radius);
  text-align: center;
}
.inv-item.is-open {
  background: var(--surface2); border: 1px solid rgba(216, 75, 51, .4);
  color: var(--text); cursor: pointer;
  transition: border-color .18s ease, transform .12s ease;
}
.inv-item.is-open:hover { border-color: var(--accent-soft); }
.inv-item.is-open:active { transform: translateY(1px); }
.inv-item.is-open.is-expanded { border-color: var(--accent); }
.inv-item.is-locked { background: var(--surface); border: 1px dashed var(--line); }
.inv-glyph { display: flex; align-items: center; justify-content: center; height: 34px; color: var(--accent); }
.inv-glyph .itg { width: 32px; height: 32px; filter: drop-shadow(0 0 9px rgba(216, 75, 51, .28)); }
.inv-glyph--q { font-size: 30px; font-weight: 700; color: var(--text); opacity: .22; }
.inv-name { font-size: 12.5px; font-weight: 700; line-height: 1.2; color: var(--washi); }
.inv-desc { font-size: 11px; line-height: 1.4; color: var(--muted); }
.inv-more {
  margin-top: 2px; font-size: 9.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent-soft);
}
.inv-item.is-expanded .inv-more { color: var(--accent); }
.inv-hint { font-size: 10.5px; line-height: 1.35; color: var(--muted); }
/* раскрытие подробности — во всю строку сетки под своим рядом */
.inv-detail {
  grid-column: 1 / -1; display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--accent-soft);
  animation: fadeIn 240ms ease both;
}
.inv-detail[hidden] { display: none; }
.inv-detail-row { display: flex; align-items: baseline; gap: 10px; }
.inv-detail-cap {
  flex: 0 0 92px; font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-soft);
}
.inv-detail-val { font-size: 13px; line-height: 1.45; color: var(--text); }

/* ══════════════════════════════════════════════════════════════════════
   БОЙ С БОССОМ #/boss/:id (чекпоинт 013)
   ══════════════════════════════════════════════════════════════════════ */
.boss-fight { display: flex; flex-direction: column; min-height: calc(100dvh - 128px); }
.boss-arena {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 4px; padding: 8px 2px;
}
.boss-k {
  font-size: 92px; line-height: 1; font-weight: 700; color: var(--accent);
  text-shadow: 0 0 34px rgba(216, 75, 51, .38); margin-bottom: 4px;
}
.boss-k--weak { font-size: 72px; opacity: .6; text-shadow: 0 0 22px rgba(216, 75, 51, .22); }
.boss-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent-soft);
}
.boss-eyebrow--win { color: var(--grass); }
.boss-name { margin: 3px 0 4px; }

/* полоса силы демона — киноварная, с числом */
.boss-power { width: 100%; max-width: 320px; margin: 12px auto 4px; }
.boss-power-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.boss-power-cap { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.boss-power-num {
  font-size: 15px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums;
}
.boss-power-bar {
  position: relative; height: 10px; border-radius: 999px;
  background: var(--surface2); border: 1px solid var(--line); overflow: hidden;
}
.boss-power-fill {
  position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  box-shadow: 0 0 14px -2px rgba(216, 75, 51, .7); transition: width .5s cubic-bezier(.4, 0, .2, 1);
}

/* реплика демона — «речь» с киноварной кавычкой-акцентом */
.boss-speech {
  position: relative; max-width: 340px; margin: 14px auto 0; padding: 14px 18px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  border-left: 3px solid var(--accent); font-size: 15px; line-height: 1.6;
  font-style: italic; color: rgba(239, 233, 221, .92); text-align: left;
}
.boss-speech-q { color: var(--accent); font-weight: 700; font-style: normal; }
.boss-speech--defeat { border-left-color: var(--grass); }
.boss-speech--defeat .boss-speech-q { color: var(--grass); }
.boss-named-note {
  max-width: 320px; margin: 12px auto 0; font-size: 13px; line-height: 1.5; color: var(--grass);
}

.boss-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; margin: 22px auto 0; }
.boss-name-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.boss-name-seal {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 5px; background: var(--accent);
  color: #fff; font-size: 13px; font-weight: 700; line-height: 1;
}
.boss-flee { color: var(--muted); }

/* верх раунда: счётчик + отступить + полоса силы */
.boss-round { justify-content: flex-start; }
.boss-round-top { padding-top: 4px; }
.boss-round-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.boss-round-count {
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-soft);
}
.boss-retreat {
  background: none; border: 0; cursor: pointer; color: var(--muted);
  font-size: 13px; font-weight: 500; padding: 4px 2px; transition: color .18s ease;
}
.boss-retreat:hover { color: var(--text); }
.boss-round-frame { margin-top: 14px; padding: 16px 15px 18px; border-color: var(--accent-soft); }
.boss-round-mount { position: relative; }

/* мини-сцена «демон слабеет» между раундами */
.boss-weaken-msg { font-size: 18px; font-weight: 600; font-style: italic; color: var(--muted); margin-top: 8px; }

/* победа: печать 討 поверх кандзи демона */
.boss-victory-seal { position: relative; width: 108px; height: 108px; margin: 0 auto 6px; }
.boss-victory-k {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  font-size: 90px; line-height: 1; font-weight: 700; color: var(--muted); opacity: .32;
}
.boss-victory-mark {
  position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%) rotate(-8deg);
  font-size: 52px; font-weight: 700; color: var(--accent);
  text-shadow: 0 0 26px rgba(216, 75, 51, .5);
  animation: bossSeal 520ms cubic-bezier(.34, 1.56, .64, 1) both;
}
@keyframes bossSeal {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(1.7); }
  100% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); }
}
.boss-xp {
  margin: 16px auto 0; font-size: 30px; font-weight: 700; color: var(--grass);
  letter-spacing: -.01em; line-height: 1;
}
.boss-xp span { font-size: 12px; font-weight: 600; opacity: .8; }
.boss-again {
  margin-top: 14px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}

/* подтверждение отступления — оверлей поверх раунда */
.boss-confirm {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(15, 13, 11, .74); backdrop-filter: blur(2px);
}
.boss-confirm-card {
  width: 100%; max-width: 340px; padding: 22px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); text-align: center;
}
.boss-confirm-title { margin-bottom: 8px; }
.boss-confirm-sub { line-height: 1.55; }
.boss-confirm-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

/* ══════════════════════════════════════════════════════════════════════
   ИГРОВЫЕ СЦЕНЫ В SOS (чекпоинт 013)
   ══════════════════════════════════════════════════════════════════════ */
/* опора «твои техники с тобой» над сеткой демонов (шаг 3) */
.sos-tech-strip {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  margin: 0 0 14px; padding: 12px 10px; border-radius: 12px;
  background: rgba(216, 75, 51, .06); border: 1px solid var(--line);
}
.sos-tech-cap {
  font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.sos-tech-row { display: flex; gap: 18px; }
.sos-tech { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--accent); }
.sos-tech-glyph { display: flex; align-items: center; justify-content: center; height: 24px; }
.sos-tech-glyph .itg { width: 24px; height: 24px; filter: drop-shadow(0 0 7px rgba(216, 75, 51, .3)); }
.sos-tech-name { font-size: 10px; font-weight: 600; color: var(--washi); }

/* сцена падения-подъёма перед разбором срыва (игровой режим) */
.sos-fall { cursor: pointer; }
.sos-fall-k {
  font-size: 100px; line-height: 1; font-weight: 700; color: var(--washi);
  text-shadow: 0 0 30px rgba(239, 233, 221, .2);
}
.sos-fall-k.is-rise {
  color: var(--grass); text-shadow: 0 0 32px rgba(111, 143, 90, .4);
  animation: fallRise 520ms cubic-bezier(.34, 1.56, .64, 1) both;
}
@keyframes fallRise {
  0% { opacity: .2; transform: translateY(10px) scale(.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.sos-fall-line {
  margin-top: 22px; max-width: 320px; font-size: 16px; line-height: 1.6; font-weight: 600; color: var(--washi);
}
.sos-fall-skip { margin-top: 20px; font-size: 12px; letter-spacing: .06em; }

/* «стычка выиграна» на итоге пережитой волны (игровой режим) */
.sos-skirmish {
  margin: 12px auto 0; max-width: 320px; padding: 8px 14px; border-radius: 999px;
  background: rgba(111, 143, 90, .12); border: 1px solid rgba(111, 143, 90, .4);
  font-size: 13px; font-weight: 600; color: var(--grass);
}

/* ── доступность движения ──────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration:.001ms !important;
    animation-delay:0s !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
    transition-delay:0s !important;
    scroll-behavior:auto !important;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   МАСТЕР — чат с ИИ-наставником (#/master, js/ui/master.js)
   ══════════════════════════════════════════════════════════════════════ */

/* пять вкладок вместо четырёх */
#tabbar { grid-template-columns:repeat(5,1fr); }

/* экран — колонка на всю высоту: лента растёт, ввод прижат к низу */
body.mastermode #screen { display:flex; flex-direction:column; }
.master-screen { flex:1 1 auto; display:flex; flex-direction:column; min-height:100%; }

/* шапка: круглый васи-аватар с глифом 師 (стиль пластин .sos-intro) */
.master-head { display:flex; align-items:center; gap:12px; margin-bottom:14px; }
.master-ava {
  flex:0 0 auto; width:46px; height:46px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  font-size:22px; font-weight:700; color:var(--washi-text);
  background:linear-gradient(180deg,#F5EDDE,var(--washi) 45%,#EBDFC8);
  border:1px solid #d9ccb0;
  box-shadow:0 0 0 3px rgba(216,75,51,.14), 0 8px 22px -14px rgba(0,0,0,.8);
}
.master-title { font-size:18px; font-weight:700; line-height:1.25; margin:0; }
.master-sub { margin:2px 0 0; font-size:12.5px; color:var(--muted); }

/* лента: пузыри мастера слева (васи), ученика справа (surface) */
.master-feed { flex:1 1 auto; display:flex; flex-direction:column; gap:10px; }
.master-msg {
  max-width:85%; padding:10px 14px; border-radius:var(--radius);
  font-size:14.5px; line-height:1.55; overflow-wrap:break-word;
}
.master-msg--master {
  align-self:flex-start; background:var(--washi); color:var(--washi-text);
  border:1px solid #d9ccb0; border-bottom-left-radius:5px;
}
.master-msg--user {
  align-self:flex-end; background:var(--surface2); color:var(--text);
  border:1px solid var(--line); border-bottom-right-radius:5px;
}

/* «мастер думает» — три точки (глобальный prefers-reduced-motion их гасит) */
.master-typing { position:relative; }
.master-typing-dots { display:inline-flex; gap:5px; padding:4px 0 2px; }
.master-typing-dots i {
  width:6px; height:6px; border-radius:50%; background:var(--washi-text);
  opacity:.3; animation:masterDot 1.1s ease-in-out infinite;
}
.master-typing-dots i:nth-child(2) { animation-delay:.18s; }
.master-typing-dots i:nth-child(3) { animation-delay:.36s; }
@keyframes masterDot {
  0%,100% { opacity:.25; transform:translateY(0); }
  35%     { opacity:.9;  transform:translateY(-3px); }
}
.master-srtext {
  position:absolute; width:1px; height:1px; overflow:hidden;
  clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap;
}

/* дисклеймер под лентой */
.master-note { margin:12px 2px 0; font-size:11.5px; line-height:1.5; color:var(--muted); }

/* плашка ошибок (429 / «тропа размыта») над вводом */
.master-banner {
  margin-top:10px; padding:10px 12px; border-radius:10px;
  background:rgba(216,75,51,.10); border:1px solid rgba(216,75,51,.35);
  color:var(--text); font-size:13px; line-height:1.45;
}

/* ввод: textarea 1–4 строки + кнопка «Спросить» (тач ≥44px);
   [hidden] обязан побеждать display:flex (оффлайн прячет ввод атрибутом) */
.master-input { display:flex; align-items:flex-end; gap:8px; margin-top:10px; }
.master-input[hidden] { display:none; }
.master-ta {
  flex:1 1 auto; min-height:44px; max-height:104px; resize:none;
  padding:11px 12px; border-radius:12px; border:1px solid var(--line);
  background:var(--surface); color:var(--text);
  font-family:inherit; font-size:15px; line-height:1.4;
}
.master-ta::placeholder { color:var(--muted); }
.master-ta:focus { outline:none; border-color:var(--muted); }
.master-ta:disabled { opacity:.55; }
.master-send { flex:0 0 auto; min-height:44px; height:44px; padding:0 16px; }

/* «мастер в горах» — заглушка вместо ввода (offline / file:// / нет ключа) */
.master-offline { margin-top:12px; text-align:center; padding:20px 16px; }
.master-offline-k {
  font-size:40px; line-height:1; font-weight:700;
  color:var(--accent-soft); opacity:.85; margin-bottom:10px;
}
.master-offline-txt { margin:0; font-size:14px; line-height:1.6; color:var(--muted); }

/* (старые стили SVG-подписей карты и ходячего самурая удалены: подписи и
   самурай теперь живут в узлах — см. блок «карта „Путь воина“» выше) */
