:root {
  --ink: #1d2530;
  --muted: #6d7885;
  --line: #dde3ea;
  --card: #ffffff;
  --accent: #2f7fd4;
  --gold: #e8b93f;
  --ok: #3f9e57;
  --shadow: 0 10px 30px rgba(20, 35, 60, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: #0f1622;
  -webkit-tap-highlight-color: transparent;
}

body.drawer-open { overflow: hidden; }

.muted { color: var(--muted); }

/* ── комната ─────────────────────────────────────────────────────────── */

.cabinet {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: clamp(0px, 2vw, 24px);
}

.room {
  position: relative;
  width: min(100%, 1040px);
  aspect-ratio: 4 / 3;
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border-radius: 14px;
  box-shadow: var(--shadow);
  isolation: isolate;
}

/* Сцена и персонаж живут в одной коробке: тогда фигура встаёт на нарисованный
   пол при любой раскладке, а не подгоняется процентами отдельно. */
.scene {
  position: absolute;
  inset: 0;
}

.room-bg, .room-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Персонаж стоит на полу по центру: низ кадра совпадает с линией пола сцены. */
.figure {
  position: absolute;
  left: 50%;
  bottom: 5%;
  transform: translateX(-50%);
  height: 64%;
  aspect-ratio: 420 / 576;
}

.figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.25));
}

#figB { transition: opacity 600ms ease; }

.floater {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 700;
  color: var(--ok);
  opacity: 0;
  text-shadow: 0 1px 0 #fff;
}

.floater.show { animation: rise 1.6s ease-out; }

@keyframes rise {
  0% { opacity: 0; transform: translate(-50%, 10px); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -40px); }
}

/* ── верхняя панель ──────────────────────────────────────────────────── */

.hud-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: linear-gradient(rgba(12, 20, 32, 0.55), rgba(12, 20, 32, 0));
  color: #fff;
}

.meters {
  display: flex;
  flex: 1;
  gap: 16px;
  min-width: 0;
}

.meter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  font-size: 13px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.meter-name { white-space: nowrap; opacity: 0.9; }
.meter b { font-variant-numeric: tabular-nums; }

.meter .bar {
  flex: 1;
  min-width: 40px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.meter .bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(#7ad07a, #3f9e57);
  transition: width 500ms ease;
}

.meter .bar.form span { background: linear-gradient(#7fc4f5, #2f7fd4); }

.coins {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(12, 20, 32, 0.6);
  font-variant-numeric: tabular-nums;
}

.coin { color: var(--gold); }

/* ── левая колонка ───────────────────────────────────────────────────── */

.hud-left {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: grid;
  gap: 6px;
  width: min(36%, 186px);
}

.rank-card, .streak {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 3px 10px rgba(15, 25, 40, 0.2);
  backdrop-filter: blur(2px);
}

.rank-title {
  display: block;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 13px;
}

.rank-bar {
  height: 6px;
  margin: 6px 0 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.rank-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
  transition: width 500ms ease;
}

.rank-next { font-size: 11px; }

.streak {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.streak .flame { color: #e2703a; }
.streak b { font-size: 16px; }
.streak.cold .flame { color: var(--muted); }

/* ── круглые кнопки справа ───────────────────────────────────────────── */

.hud-right {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: grid;
  gap: 8px;
  justify-items: center;
}

/* Подпись живёт под кругом, а не внутри: в круг она не помещается. */
.dial-slot {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: 74px;
}

.dial-slot span {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(12, 20, 32, 0.6);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
}

.dial {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #5a6673, #2b3542);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(10, 18, 30, 0.35);
  transition: transform 120ms ease, background 200ms ease;
}

.dial svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dial:hover { transform: scale(1.06); }
.dial.active { background: radial-gradient(circle at 35% 25%, #59a3e8, #1f5f9f); }

.toast {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  margin: 0;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(12, 20, 32, 0.82);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
}

.toast.show { animation: toast 2.6s ease-out; }

@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, 8px); }
  12%, 78% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; }
}

/* ── выдвижная панель ────────────────────────────────────────────────── */

.drawer[hidden] { display: none; }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: end center;
}

.drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(8, 14, 24, 0.55);
}

.drawer-body {
  position: relative;
  width: min(100%, 640px);
  max-height: 86dvh;
  overflow-y: auto;
  padding: 0 16px 24px;
  background: #f4f7fa;
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow);
  animation: slide 220ms ease-out;
}

@keyframes slide {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

.drawer-body > header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 10px;
  background: #f4f7fa;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.drawer-body h2 { margin: 0; font-size: 17px; }

.close {
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

/* ── тренировка ──────────────────────────────────────────────────────── */

.exercise {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.exercise h3 { margin: 0 0 2px; font-size: 15px; }
.goal { margin: 0 0 10px; color: var(--muted); font-size: 13px; }

.sets { display: flex; flex-wrap: wrap; gap: 8px; }

.set {
  min-width: 58px;
  padding: 12px 0;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

.set.done { border-color: var(--ok); background: #e9f6ed; color: var(--ok); }

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.stepper button {
  min-width: 46px;
  padding: 10px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 17px;
  cursor: pointer;
}

.stepper .ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.stepper .value { flex: 1; text-align: center; font-size: 14px; }

#complete {
  width: 100%;
  margin-top: 6px;
  padding: 15px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

#complete:disabled { background: #c6d2de; cursor: default; }

/* ── программа ───────────────────────────────────────────────────────── */

.day {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
}

.day.heavy { border-left-color: #d9534f; }
.day.light { border-left-color: #f0ad4e; }
.day.mobility { border-left-color: #5bc0de; }
.day.today { box-shadow: 0 0 0 2px rgba(47, 127, 212, 0.25); }

.day header { display: flex; justify-content: space-between; align-items: baseline; }
.day h3 { margin: 0; font-size: 14px; }
.day .kind, .day .check { font-size: 12px; color: var(--muted); }
.day .check { color: var(--ok); }
.day ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; }

/* ── тело ────────────────────────────────────────────────────────────── */

.overall { display: flex; align-items: baseline; gap: 6px; margin-bottom: 12px; }
.overall .label { color: var(--muted); font-size: 13px; }
.overall b { font-size: 30px; }
.overall .of { color: var(--muted); }

.groups { display: grid; gap: 8px; }

.group { display: grid; grid-template-columns: 62px 1fr 48px; align-items: center; gap: 10px; font-size: 13px; }

.group .bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.group .bar span { display: block; height: 100%; background: var(--accent); transition: width 500ms ease; }
.group .num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.group.gained .num { color: var(--ok); font-weight: 700; }

#bonus-note { margin-top: 12px; font-size: 13px; }

/* ── магазин ─────────────────────────────────────────────────────────── */

.shop {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.goods {
  display: grid;
  gap: 4px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
}

.goods.owned { background: #eef4ee; border-color: #c6ddc9; }
.goods h3 { margin: 0; font-size: 14px; }
.goods p { margin: 0; font-size: 12px; }

/* Превью предмета: тот же вектор, что и в комнате, просто в своей рамке. */
.goods-art {
  height: 76px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.goods-art svg { width: 100%; height: 100%; }

.buy {
  margin-top: 6px;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #43380f;
  font-weight: 700;
  cursor: pointer;
}

.buy:disabled { background: #dfe6ed; color: var(--muted); cursor: default; }

/*
 * На телефоне комната занимает весь экран: пропорция 4:3 оставила бы полосу
 * посреди пустоты. Бока сцены при этом обрезаются (slice в SVG), поэтому
 * важное — персонаж и снаряды у пола — стоит ближе к центру.
 */
@media (max-width: 620px) {
  .cabinet { padding: 0; }

  .room {
    aspect-ratio: auto;
    width: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    /* Обои продолжаются над сценой тем же шагом: период задан в процентах
       ширины, как в SVG, поэтому стык не виден. */
    background:
      radial-gradient(120% 40% at 50% 0, rgba(255, 248, 220, 0.55), rgba(255, 248, 220, 0) 70%),
      repeating-linear-gradient(90deg, #cfe3f2 0 3.5%, #bfd9ee 3.5% 7%);
  }

  /* Комната прижата к низу экрана — туда, где до неё дотягивается большой
     палец, — и слегка шире экрана: так персонаж крупнее, а по бокам теряются
     только пустые поля сцены. */
  .scene {
    inset: auto -15% 0 -15%;
    width: 130%;
    aspect-ratio: 4 / 3;
  }

  /* Звание и серия уезжают на свободную стену вверху, чтобы не лечь на мебель. */
  .hud-left {
    top: 46px;
    bottom: auto;
    width: 58%;
  }

  .dial { width: 46px; height: 46px; }
  .dial-slot { width: 54px; }
  .dial-slot span { display: none; }
  .hud-left { width: 56%; }
  .rank-title { font-size: 12px; }
  .meter-name { display: none; }

  .drawer-body { border-radius: 14px 14px 0 0; max-height: 90dvh; }
}

/* ── анатомия и нагрузка ─────────────────────────────────────────────── */

/*
 * Атлас — единственный тёмный блок в светлом ящике: карта тела читается на
 * тёмном так же, как в спортивных трекерах, а подсветка мышц не спорит с
 * белым фоном. Внутри карточки живёт всё управление картой, чтобы
 * переключатели и рисунок воспринимались как один прибор.
 */
.atlas {
  padding: 16px 14px 12px;
  margin-bottom: 14px;
  border: 1px solid #1c2532;
  border-radius: 18px;
  background: linear-gradient(180deg, #141b24, #0c1117);
  color: #e6edf5;
}

.atlas-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.stats-controls { display: grid; gap: 8px; margin-bottom: 10px; }

/* Базовый переключатель светлых панелей — программа и сферы развития. */
.switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: #e6ecf2;
  border-radius: 999px;
}

.switch button {
  flex: 1;
  padding: 8px 4px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.switch button.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(20, 35, 60, 0.15); }
.switch.small button { font-size: 12px; padding: 6px 4px; }

/* В атласе тот же переключатель живёт на тёмном: период — крупная пилюля,
   это главный выбор, от него меняются все числа на карте. */
.atlas .switch { padding: 4px; background: #1a2130; }
.atlas .switch button { padding: 9px 4px; color: #8b97a8; }
.atlas .switch button:hover { color: #cdd8e6; }
.atlas .switch button.active { background: #fff; color: #10161e; font-weight: 650; box-shadow: none; }

/* Режим — вторичный выбор, поэтому не пилюля, а подчёркнутая строка. */
.atlas .switch.small {
  margin-top: 6px;
  padding: 0;
  gap: 4px;
  background: none;
}

.atlas .switch.small button {
  padding: 6px 2px 8px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  font-size: 12px;
}

.atlas .switch.small button.active {
  background: none;
  color: #6fb4ff;
  border-bottom-color: #2f9dff;
  font-weight: 600;
}

.mode-note { margin: 10px 0 4px; font-size: 12.5px; color: #7f8b9b; }

/* Мягкое свечение под фигурами — единственный декоративный приём в карточке:
   оно отделяет тела от фона, не добавляя ни рамок, ни линий. */
.figures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 6px 0 4px;
  background: radial-gradient(58% 52% at 50% 42%, rgba(47, 157, 255, 0.09), rgba(47, 157, 255, 0) 72%);
}

.figures figure { margin: 0; display: grid; justify-items: center; gap: 8px; }

.figures figcaption { font-size: 12px; color: #778495; }

.figure-svg { width: 100%; max-height: 46vh; }

/* Силуэт — подложка; мышцы лежат поверх и принимают цвет режима. Клики он не
   ловит, иначе перехватывал бы попадания по мышце у средней линии. */
.silhouette {
  fill: #151c26;
  stroke: #0a0e14;
  stroke-width: 1.2;
  pointer-events: none;
}

.muscle path {
  fill: #263243;
  stroke: #0a0e14;
  stroke-width: 1;
  cursor: pointer;
  transition: fill 220ms ease, opacity 150ms ease;
}

.muscle:hover path { opacity: 0.82; }

/* Выбранная мышца обводится и слегка светится: на карте из двадцати пластин
   одной обводки мало, чтобы поймать её взглядом. */
.muscle.selected path { stroke: #eaf2ff; stroke-width: 1.6; }
.muscle.selected { filter: drop-shadow(0 0 6px rgba(120, 190, 255, 0.55)); }
.muscle:focus { outline: none; }
.muscle:focus-visible path { stroke: #fff; stroke-width: 2.2; }

/* Насечки внутри мышц: волокна груди, пучки бедра. Только читаемость формы. */
.details {
  fill: none;
  stroke: #0a0e14;
  stroke-width: 1;
  stroke-linecap: round;
  opacity: 0.7;
  pointer-events: none;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid #1c2532;
  font-size: 12px;
  color: #8b97a8;
}

.swatch { display: flex; align-items: center; gap: 5px; }
.swatch i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid #2b3644; }

.muscle-card {
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.muscle-card header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.muscle-card h3 { margin: 0; font-size: 15px; }

.muscle-card dl { display: grid; gap: 4px; margin: 0 0 8px; font-size: 13px; }
.muscle-card dl > div { display: flex; justify-content: space-between; gap: 12px; }
.muscle-card dt { color: var(--muted); }
.muscle-card dd { margin: 0; font-variant-numeric: tabular-nums; }
.muscle-card p { margin: 0; font-size: 12px; }

.verdict {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
  background: var(--line);
  color: var(--muted);
}

.verdict.behind { background: #fbe3e0; color: #a5342a; }
.verdict.ok { background: #e9f6ed; color: #2f7a46; }
.verdict.leading { background: #e4eefb; color: #1f5f9f; }

.muscle-list { display: grid; gap: 4px; }

.muscle-row {
  display: grid;
  grid-template-columns: 120px 1fr 62px;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.muscle-row:hover { background: #eaf0f6; }
.muscle-row.selected { border-color: var(--accent); background: #fff; }
.muscle-name { color: var(--ink); }

.muscle-row .bar { height: 9px; border-radius: 999px; background: var(--line); overflow: hidden; }
.muscle-row .bar span { display: block; height: 100%; transition: width 300ms ease; }
.muscle-row .verdict { text-align: center; }

@media (max-width: 620px) {
  .muscle-row { grid-template-columns: 96px 1fr 56px; font-size: 12px; }
  .figure-svg { max-height: 38vh; }
  .atlas { padding: 14px 10px 10px; }
}

/* ── экран развития ────────────────────────────────────────────────────── */

.radar-box { display: flex; justify-content: center; margin: 6px 0 2px; }
.radar { width: 100%; max-width: 340px; height: auto; }

.radar-ring { fill: none; stroke: var(--line); stroke-width: 1; }
.radar-spoke { stroke: var(--line); stroke-width: 1; }
.radar-label { font-size: 9px; fill: var(--muted); }

/* Бледный контур — прошлое; сплошной — сегодня. Прошлое рисуется первым,
   чтобы сегодняшний результат всегда лежал сверху и читался первым. */
.radar-was { fill: rgba(109, 120, 133, 0.12); stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.radar-now { fill: rgba(47, 127, 212, 0.22); stroke: var(--accent); stroke-width: 2; }

.radar-note { text-align: center; font-size: 12px; margin: 0 0 10px; }

.life-rank { margin-bottom: 10px; }
.life-list { display: grid; gap: 8px; margin-bottom: 12px; }

.life-row {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--card);
}
.life-row.derived { background: transparent; }
.life-row p { margin: 4px 0 0; font-size: 12px; }

.life-head { display: flex; align-items: baseline; gap: 8px; }
.life-head b { flex: 1; }
.life-dev { font-variant-numeric: tabular-nums; font-weight: 600; }

.life-mark {
  margin-top: 8px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.life-mark:hover { border-color: var(--accent); color: var(--accent); }

#life-close { width: 100%; }

/* Лавка ветви: свёрнута по умолчанию — она нужна раз в неделю, а отметка
   каждый день, и раскрытый список предметов топил бы главное. */
.life-shop { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
.life-shop summary { cursor: pointer; font-size: 12px; display: flex; gap: 8px; align-items: baseline; }
.life-shop summary::-webkit-details-marker { display: none; }

.life-purse { font-weight: 600; font-variant-numeric: tabular-nums; }

.life-offer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
}
.life-offer span:first-child { flex: 1; }
.life-offer.owned { opacity: 0.55; }

.life-offer button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  padding: 3px 9px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.life-offer button:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.life-offer button:disabled { opacity: 0.4; cursor: default; }

.life-owned { color: var(--ok); }
/* Справка по упражнению: кнопка у названия и свёрнутый блок под подходами. */
.howto-toggle {
  margin-left: 8px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
}

.howto-toggle.open { border-color: var(--accent); color: var(--accent); }

.howto {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.howto img {
  display: block;
  width: 100%;
  max-width: 320px;
  border-radius: 8px;
}

.howto p { margin: 8px 0; color: var(--muted); font-size: 13px; line-height: 1.45; }

.howto a { font-size: 13px; color: var(--accent); }

/* Заблокированная отметка должна выглядеть заблокированной: день закрыт,
   и кнопка, неотличимая от рабочей, обещает то, чего не будет. */
.life-mark:disabled { opacity: 0.4; cursor: default; }
.life-mark:disabled:hover { border-color: var(--line); color: var(--ink); }

/* ── программа целиком ───────────────────────────────────────────────── */

.program { display: grid; gap: 14px; }

.sphere-title {
  margin: 8px 0 -4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.derived-note { margin: 0; font-size: 13px; }

.ladder {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.ladder header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ladder h3 { margin: 0; font-size: 15px; }
.ladder header span { font-size: 12px; }

/* Полоска пути: по одной засечке на ступень. Пройденное залито, текущее
   выделено цветом, впереди — пустое. Весь путь виден одним взглядом, до того
   как раскрыта хоть одна ступень. */
.ladder-track { display: flex; gap: 4px; margin: 10px 0; }

.pip {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}

.pip.passed { background: var(--ok); }
.pip.current { background: var(--accent); }

.ladder-goal {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.steps { display: grid; gap: 4px; }

.step { border-radius: 9px; }
.step summary {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  list-style: none;
}
.step summary::-webkit-details-marker { display: none; }

.step-no { color: var(--muted); font-variant-numeric: tabular-nums; }
.step-span { font-size: 12px; }
.step-state { grid-column: 3; font-size: 12px; color: var(--accent); }

.step.passed summary { color: var(--muted); }
.step.passed .step-no { color: var(--ok); }
.step.current summary { background: rgba(47, 127, 212, 0.09); font-weight: 600; }
.step.ahead summary { opacity: 0.75; }

.step summary .step-state:empty { display: none; }

.step-body {
  display: grid;
  gap: 8px;
  padding: 8px 8px 10px 28px;
  font-size: 13px;
  color: var(--muted);
}

.step-body img { width: 100%; max-width: 260px; border-radius: 8px; }
.step-body p { margin: 0; }
.step-body a { color: var(--accent); font-size: 13px; }

/* ── сферы и печати на экране развития ───────────────────────────────── */

/* Вкладка сферы несёт два числа: среднее развитие и сколько ветвей ещё не
   отмечено сегодня. Второе — маленьким кружком справа, как непрочитанные. */
.switch.spheres { margin: 10px 0; flex-wrap: wrap; }

.switch.spheres button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 64px;
}

.switch.spheres button b { font-variant-numeric: tabular-nums; font-size: 12px; }

.switch.spheres button .pending {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-style: normal;
}

.seal-box {
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.seal-box summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}
.seal-box summary::-webkit-details-marker { display: none; }

.seal-purse {
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.seal-shop { display: grid; gap: 4px; margin-top: 8px; }

/* ── превью в списке недели ──────────────────────────────────────────── */

.day li { margin-bottom: 4px; }
.day li .howto { margin-left: -18px; }
