:root {
  --bg: #fbf4ec;
  --card: #ffffff;
  --ink: #3b2f2a;
  --muted: #8a776c;
  --line: #eadbcd;
  --peach: #f2a07b;
  --peach-dark: #d9774f;
  --peach-soft: #fde6d8;
  --green: #6fae8a;
  --green-soft: #e3f2e8;
  --yellow: #e9b949;
  --yellow-soft: #fbf0d3;
  --red: #d9675f;
  --red-soft: #f9e0dd;
  --grey-soft: #f1ebe5;
  --shadow: 0 6px 24px rgba(120, 80, 50, 0.08);
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); }
h1 { font-size: 26px; line-height: 1.2; margin: 8px 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 19px; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 0 0 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin: 14px 0;
  box-shadow: var(--shadow);
}
.card.soft { background: var(--peach-soft); box-shadow: none; }
.card.green { background: var(--green-soft); box-shadow: none; }
.card.warn { background: var(--red-soft); box-shadow: none; }

.hero {
  background: linear-gradient(160deg, #fde3cf 0%, #fbeee2 55%, #e6f2e9 100%);
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 8px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.hero .tree { width: 92px; height: 92px; flex: none; }
.hero p { margin: 0; }

button, .btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 13px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--peach);
  color: #fff;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: transform 0.08s ease, background 0.2s;
}
button:active, .btn:active { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: default; }
button.secondary, .btn.secondary { background: var(--grey-soft); color: var(--ink); }
button.ghost { background: transparent; color: var(--peach-dark); padding: 8px 10px; }
button.block, .btn.block { display: block; width: 100%; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1 1 auto; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #fffdfb;
  color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--peach); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--peach-dark); }
.error { color: var(--red); font-weight: 600; margin-top: 10px; min-height: 1em; }

.options { display: grid; gap: 8px; margin-top: 8px; }
.option {
  text-align: left;
  background: #fffdfb;
  color: var(--ink);
  border: 1.5px solid var(--line);
  font-weight: 500;
}
.option.selected { border-color: var(--peach-dark); background: var(--peach-soft); }
.scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin-top: 10px; }
.scale button { padding: 11px 0; background: var(--grey-soft); color: var(--ink); border-radius: 10px; font-weight: 600; }
.scale button.selected { background: var(--peach-dark); color: #fff; }
.scale-labels { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 4px; }

.progress { height: 6px; background: var(--grey-soft); border-radius: 6px; overflow: hidden; margin: 10px 0 4px; }
.progress > div { height: 100%; background: var(--peach); border-radius: 6px; transition: width 0.3s; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--grey-soft); color: var(--muted); }
.badge.deep { background: #3b2f2a; color: #fde6d8; }
.badge.ok { background: var(--green-soft); color: #2f6b4a; }
.badge.wait { background: var(--yellow-soft); color: #8a6512; }

.card-question { font-size: 21px; line-height: 1.35; font-weight: 650; margin: 12px 0 6px; }

.session-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.session-item:first-of-type { border-top: 0; }
.session-item .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--peach-soft); font-weight: 700; flex: none; }
.session-item.locked { opacity: 0.45; pointer-events: none; }
.session-item .grow { flex: 1; }

.map { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.sphere { border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.sphere b { display: block; font-size: 14px; margin-bottom: 2px; }
.sphere.green { background: var(--green-soft); }
.sphere.yellow { background: var(--yellow-soft); }
.sphere.red { background: var(--red-soft); }
.sphere.grey { background: var(--grey-soft); }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); margin-top: 10px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

.pair-answers { display: grid; gap: 12px; }
.answer-block { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.answer-block .q { font-weight: 650; margin-bottom: 8px; }
.answer-block .who { font-size: 13px; color: var(--muted); font-weight: 600; }
.answer-block .a { margin: 2px 0 8px; white-space: pre-wrap; }
.answer-block.match { border-color: var(--green); }

.timer { font-size: 56px; font-weight: 750; text-align: center; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; margin: 6px 0; }
.overlay {
  position: fixed; inset: 0; background: rgba(251, 244, 236, 0.97); z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center;
}
.breath { width: 140px; height: 140px; border-radius: 50%; background: var(--green-soft); margin: 18px auto; animation: breath 8s ease-in-out infinite; }
@keyframes breath { 0%, 100% { transform: scale(0.7); } 50% { transform: scale(1.05); } }

.ach { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ach div { text-align: center; font-size: 12px; padding: 10px 4px; border-radius: 14px; background: var(--grey-soft); }
.ach div span { display: block; font-size: 26px; filter: grayscale(1); opacity: 0.45; }
.ach div.got { background: var(--peach-soft); }
.ach div.got span { filter: none; opacity: 1; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips button { background: var(--grey-soft); color: var(--ink); padding: 8px 12px; font-weight: 500; border-radius: 99px; }
.chips button.selected { background: var(--peach-dark); color: #fff; }

.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 8px 0; border-top: 1px solid var(--line); }
.list-plain li:first-child { border-top: 0; }
ol.prompts { padding-left: 20px; margin: 6px 0 0; }
ol.prompts li { margin-bottom: 6px; }

.nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.nav a { background: var(--card); border-radius: 14px; padding: 12px 6px; text-align: center; text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600; box-shadow: var(--shadow); }
.back { display: inline-block; color: var(--peach-dark); text-decoration: none; font-weight: 600; margin: 4px 0 8px; }
.code { font-size: 40px; font-weight: 800; letter-spacing: 0.12em; text-align: center; margin: 10px 0; }

#toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(120px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; transition: transform 0.25s, opacity 0.25s; z-index: 30; max-width: 90%;
  opacity: 0; pointer-events: none;
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

svg text { font-family: inherit; }

/* Книга пары */
.book-cover { text-align: center; padding: 28px 16px 20px; margin: 14px 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.book-cover svg { max-width: 160px; height: auto; }
.book-cover h1 { font-size: 32px; }
.book-names { font-size: 22px; font-weight: 700; color: var(--peach-dark); margin: 4px 0; }
.book-section { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin: 14px 0; }
.book-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .book-two { grid-template-columns: 1fr; } }
.book-person { background: var(--grey-soft); border-radius: 14px; padding: 12px 14px; }
.book-person h3 { margin: 0 0 6px; font-size: 17px; }
.book-item { border-top: 1px solid var(--line); padding: 12px 0; break-inside: avoid; }
.book-item:first-of-type { border-top: 0; }
.book-item p { margin: 6px 0; }
.book-qa { margin-top: 10px; padding-left: 10px; border-left: 3px solid var(--peach-soft); break-inside: avoid; }
.book-sphere { margin: 16px 0 4px; font-size: 18px; }
.book-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.book-table th, .book-table td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); }
.book-table th:not(:first-child), .book-table td:not(:first-child) { text-align: center; width: 22%; }

@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { background: #fff; font-size: 12pt; }
  #app { max-width: none; padding: 0; }
  .no-print, #toast, .overlay { display: none !important; }
  .book-cover, .book-section { box-shadow: none; border-radius: 0; padding: 0; margin: 0 0 10mm; background: #fff; }
  .book-cover { min-height: 240mm; display: flex; flex-direction: column; justify-content: center; page-break-after: always; }
  .book-section { margin-bottom: 8mm; }
  .book-section.pb { page-break-before: always; }
  .book-table, .book-person { break-inside: avoid; }
  .book-section h2 { break-after: avoid; }
  .book-person { background: #fff; border: 1px solid var(--line); }
  .book-two { grid-template-columns: 1fr 1fr; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Программа 60 дней */
.progress > i { display: block; height: 100%; background: var(--peach); border-radius: 6px; }
details.plan { margin-top: 12px; }
details.plan summary { cursor: pointer; color: var(--peach-dark); font-weight: 600; }
details.plan li.now { background: var(--peach-soft); border-radius: 10px; padding-left: 8px; }
