/* «Выдох». Стиль по референсу: сплошные пастельные экраны (розовый, мятный, белый),
   крупный чёрный гротеск (Onest), огромные цифры, тонкая линия с номером и мелким текстом,
   жёлтый круг и неоновые рисунки линией. */
@font-face { font-family: "Onest"; font-weight: 100 900; font-display: swap; src: url(../fonts/onest-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 100 900; font-display: swap; src: url(../fonts/onest-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --pink: #F6C6FE; --aqua: #C8FFF3; --white: #FFFFFF; --yellow: #F3D23C; --neon: #1FE21F; --black: #141414;
  /* фон и цвет текста для каждого тона; ночью — тёмные версии */
  --pink-bg: var(--pink); --pink-ink: var(--black);
  --aqua-bg: var(--aqua); --aqua-ink: var(--black);
  --white-bg: var(--white); --white-ink: var(--black);
  --f: "Onest", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --pad: 24px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --pink-bg: #26172B; --pink-ink: #F6C6FE;
    --aqua-bg: #0F2723; --aqua-ink: #C8FFF3;
    --white-bg: #161616; --white-ink: #F1F1F1;
    --yellow: #E2C232; --neon: #2CF02C;
    color-scheme: dark;
  }
}
.pink, body[data-tone="pink"] { --bg: var(--pink-bg); --ink: var(--pink-ink); }
.aqua, body[data-tone="aqua"] { --bg: var(--aqua-bg); --ink: var(--aqua-ink); }
.white, body[data-tone="white"] { --bg: var(--white-bg); --ink: var(--white-ink); }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font: 400 17px/1.4 var(--f); letter-spacing: -.005em;
  transition: background-color .45s var(--ease);
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; font-weight: inherit; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--ink); color: var(--bg); }
.mute { opacity: .62; }

#app { max-width: 520px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--ink); transition: background-color .45s var(--ease); }

/* На компьютере приложение стоит «телефоном» на тёмном фоне — как на референсе */
@media (min-width: 760px) {
  html, body { background: #121212 !important; }
  body { padding: 48px 0; }
  #app { max-width: 420px; min-height: 860px; border-radius: 52px; overflow: clip; box-shadow: 0 0 0 9px #050505, 0 0 0 11px #3B3F3D, 0 30px 80px rgba(0,0,0,.5); }
  .screen { min-height: 860px !important; }
}

/* ——— Экран ——— */
.screen {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  padding: calc(14px + var(--safe-t)) var(--pad) 0;
  animation: rise .5s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.body { flex: 1; padding-bottom: 32px; }
.foot {
  position: sticky; bottom: 0; z-index: 2;
  padding: 16px 0 calc(18px + var(--safe-b));
  display: flex; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(to top, var(--bg) 72%, transparent);
}
.foot .btn { flex: 1 1 auto; }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-bottom: 26px; }
.back {
  width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--ink); background: none; color: var(--ink); text-decoration: none;
}
.back svg { width: 20px; height: 20px; }
.count { font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums; }

/* Типографика */
.cap { font-size: 13px; font-weight: 500; letter-spacing: .005em; margin-bottom: 12px; }
.h { font-weight: 500; font-size: clamp(32px, 9vw, 40px); line-height: 1.02; letter-spacing: -.03em; text-wrap: balance; }
.h.s { font-size: clamp(26px, 7vw, 30px); }
.num { font-weight: 500; font-size: clamp(96px, 30vw, 150px); line-height: .8; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.num sup, .num small { font-size: 24px; letter-spacing: 0; vertical-align: baseline; margin-left: 6px; font-weight: 500; }
.lead { font-size: 19px; line-height: 1.4; margin-top: 16px; text-wrap: pretty; }
.gap { height: 28px; }
.gap-s { height: 14px; }

/* Линия с номером и мелким текстом — главный приём референса */
.rule { display: grid; grid-template-columns: 34% 1fr; gap: 0 12px; border-top: 1px solid var(--ink); padding-top: 12px; margin-top: 22px; font-size: 14px; line-height: 1.35; }
.rule > b { font-weight: 600; font-size: 12px; padding-top: 1px; font-variant-numeric: tabular-nums; }
.rule > div { text-wrap: pretty; }
.rule > div p { margin-top: 8px; }
.rule > div p:first-child { margin-top: 0; }
.rows + .rule { border-top: 0; margin-top: 0; }
.rule a { font-weight: 600; }
.rule.wide { grid-template-columns: 1fr; }

/* ——— Кнопки и строки ——— */
.btn {
  min-height: 58px; padding: 0 26px; border-radius: 999px; border: 1px solid var(--ink);
  font-weight: 500; font-size: 18px; letter-spacing: -.01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  text-decoration: none; background: none; color: var(--ink); transition: transform .15s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .3; pointer-events: none; }
.btn svg { width: 20px; height: 20px; }

.rows { margin-top: 26px; border-bottom: 1px solid var(--ink); }
.row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  min-height: 62px; padding: 14px 0; border: 0; border-top: 1px solid var(--ink); width: 100%;
  background: none; text-align: left; text-decoration: none; font-size: 19px; font-weight: 500; letter-spacing: -.015em;
}
.row svg { width: 22px; height: 22px; }
.row small { display: block; font-size: 14px; font-weight: 400; opacity: .65; margin-top: 3px; letter-spacing: 0; }

/* ——— Поля ——— */
.field {
  width: 100%; display: block; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0;
  background: transparent; padding: 10px 0 12px; outline: none;
  font-size: 22px; line-height: 1.3; font-weight: 400; letter-spacing: -.015em; resize: none;
  min-height: 112px;
}
.field.one { min-height: 0; }
.field:focus { border-bottom-width: 2px; padding-bottom: 11px; }
.field::placeholder { color: var(--ink); opacity: .35; }
input[type="datetime-local"].field { font-size: 19px; min-height: 52px; }
label.lbl { display: block; font-weight: 600; font-size: 12px; margin: 26px 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  border: 1px solid var(--ink); border-radius: 999px; padding: 9px 15px; background: none;
  font-weight: 500; font-size: 15px; transition: background .2s, color .2s, transform .15s var(--ease);
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--ink); color: var(--bg); }

/* Выбор строками с номерами */
.opts { margin-top: 24px; border-bottom: 1px solid var(--ink); }
.opt {
  display: grid; grid-template-columns: 34px 1fr; gap: 4px 10px; width: 100%; text-align: left;
  border: 0; border-top: 1px solid var(--ink); background: none; padding: 16px 0; transition: background .2s, color .2s, padding .25s var(--ease);
}
.opt i { font-style: normal; font-weight: 600; font-size: 12px; padding-top: 5px; grid-row: span 2; }
.opt b { font-size: 20px; font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.opt span { font-size: 14px; opacity: .7; line-height: 1.35; }
.opt.on { background: var(--ink); color: var(--bg); padding-left: 12px; padding-right: 12px; }

/* ——— Шкала ——— */
.level { margin-top: 30px; }
.level-num { display: flex; align-items: flex-end; gap: 4px; }
.level-num b { font-weight: 500; font-size: clamp(110px, 34vw, 160px); line-height: .78; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.level-num small { font-size: 26px; font-weight: 500; padding-bottom: 2px; }
.level-num span { margin-left: auto; font-size: 15px; font-weight: 500; padding-bottom: 6px; text-align: right; }
.level input { width: 100%; margin: 28px 0 4px; }
.level-ends { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; }
input[type="range"] { -webkit-appearance: none; appearance: none; height: 44px; background: transparent; touch-action: pan-y; --p: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: linear-gradient(90deg, var(--ink) var(--p), color-mix(in srgb, var(--ink) 22%, transparent) var(--p)); }
input[type="range"]::-moz-range-track { height: 3px; background: color-mix(in srgb, var(--ink) 22%, transparent); }
input[type="range"]::-moz-range-progress { height: 3px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; margin-top: -15.5px; border-radius: 50%; background: var(--ink); border: 0; }
input[type="range"]::-moz-range-thumb { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); border: 0; }

/* ——— Главная: страницы-развороты ——— */
.home { padding: 0; animation: none; }
.pg { display: block; position: relative; padding: calc(18px + var(--safe-t)) var(--pad) 26px; text-decoration: none; background: var(--bg); color: var(--ink); }
.pg + .pg { padding-top: 30px; }
.pg-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 500; }
.pg-top .logo { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.pg-sos { min-height: min(100svh, 760px); display: flex; flex-direction: column; }
.pg-sos .orb-wrap { width: min(100%, 360px); aspect-ratio: 1; margin: 30px auto 0; position: relative; }
.pg-sos .bottom { margin-top: auto; padding-top: 30px; }
.pg-sos .h { font-size: clamp(38px, 11vw, 46px); }
.pg-tool { display: grid; grid-template-columns: 1fr 42%; gap: 0 10px; min-height: 340px; }
.pg-tool .n { grid-column: 1; font-weight: 500; font-size: 92px; line-height: .8; letter-spacing: -.06em; }
.pg-tool .h { grid-column: 1 / -1; margin-top: 18px; max-width: 11ch; }
.pg-tool .art { grid-column: 2; grid-row: 1; justify-self: end; width: 100%; max-width: 150px; margin-top: -6px; }
.pg-tool .rule { grid-column: 1 / -1; margin-top: 30px; align-self: end; }
.pg-stat .h { max-width: 12ch; }
.pg-stat .num { margin-top: 34px; }
.pg-list { padding-bottom: calc(30px + var(--safe-b)); }
.pg:active .h { opacity: .7; }

.rem-list { padding: 4px var(--pad) 18px; background: var(--white-bg); color: var(--white-ink); }
.rem-list .rows { margin-top: 0; }

/* ——— Круг дыхания ——— */
.orb { position: absolute; inset: 0; border-radius: 50%; background: var(--yellow); transform: scale(.5); transition: transform var(--dur, 1s) cubic-bezier(.45, 0, .55, 1); }
.orb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.orb .face { fill: none; stroke: #141414; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.pg-sos .orb { animation: breathe 10s cubic-bezier(.45, 0, .55, 1) infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.74); } 40% { transform: scale(1); } }
.breath { position: relative; width: min(64vw, 280px); aspect-ratio: 1; margin: 40px auto 0; }
.breath .ring { position: absolute; inset: -14px; width: calc(100% + 28px); height: calc(100% + 28px); transform: rotate(-90deg); overflow: visible; }
.ring circle { fill: none; }
.ring .ring-bg { stroke: var(--ink); stroke-width: 1; opacity: .3; }
.ring .ring-fg { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.breath-say { display: flex; align-items: flex-end; gap: 14px; margin-top: 40px; }
.breath-say b { font-weight: 500; font-size: 96px; line-height: .78; letter-spacing: -.06em; font-variant-numeric: tabular-nums; min-width: .62em; }
.breath-say span { font-size: 26px; font-weight: 500; letter-spacing: -.02em; line-height: 1.05; padding-bottom: 4px; }
.breath-left { font-size: 13px; font-weight: 500; margin-top: 14px; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 62px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); margin-top: 26px; font-size: 19px; font-weight: 500; }
.toggle input { width: 52px; height: 32px; appearance: none; -webkit-appearance: none; border-radius: 99px; border: 1px solid var(--ink); position: relative; flex: none; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); transition: transform .25s var(--ease); }
.toggle input:checked { background: var(--ink); }
.toggle input:checked::after { transform: translateX(20px); background: var(--bg); }

/* ——— Пять-четыре-три ——— */
.taps { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.tap { width: 58px; height: 58px; border-radius: 50%; border: 1px solid var(--ink); background: none; display: grid; place-items: center; transition: background .25s, transform .2s var(--ease); }
.tap svg { width: 24px; height: 24px; opacity: 0; transition: opacity .2s; }
.tap.on { background: var(--yellow); border-color: var(--yellow); color: #141414; transform: scale(1.06); }
.tap.on svg { opacity: 1; }

/* ——— Было → стало ——— */
.compare { display: flex; align-items: flex-end; gap: 10px; margin-top: 10px; }
.compare div { display: grid; gap: 10px; }
.compare b { font-weight: 500; font-size: clamp(88px, 27vw, 128px); line-height: .78; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.compare small { font-size: 12px; font-weight: 600; }
.compare .arrow { font-size: 40px; padding-bottom: 6px; }

/* ——— Неоновые рисунки ——— */
.art { display: block; overflow: visible; }
.art.side { width: 118px; margin: 20px 0 -8px auto; }
.art g { fill: none; stroke: var(--neon); stroke-width: 5.5; stroke-linecap: round; stroke-linejoin: round; }

/* ——— Отвлечься ——— */
.list-pages { margin: 26px calc(-1 * var(--pad)) 0; }
.list-pages .pg { padding-top: 26px; padding-bottom: 22px; }
.list-pages .pg .n { font-weight: 500; font-size: 64px; line-height: .8; letter-spacing: -.05em; }
.list-pages .pg .h { margin-top: 14px; font-size: 30px; max-width: 14ch; }
.list-pages .pg .read { position: absolute; top: 28px; right: var(--pad); font-size: 12px; font-weight: 600; border: 1px solid var(--ink); border-radius: 99px; padding: 3px 10px; }
.list-pages .pg .art { position: absolute; top: 18px; right: var(--pad); width: 92px; }
.sect { font-weight: 500; font-size: 13px; margin: 36px 0 0; }

.story .h { font-size: clamp(34px, 10vw, 44px); }
.story .text p { font-size: 20px; line-height: 1.5; margin-top: 18px; letter-spacing: -.01em; text-wrap: pretty; }
.story .text p:first-child { margin-top: 26px; }
.story .rule { font-size: 16px; }

/* Игры */
.answer { display: flex; gap: 10px; margin-top: 24px; align-items: flex-end; }
.answer .field { flex: 1; min-height: 0; font-size: 34px; }
.answer .btn { flex: none; }
.minus-hist { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 18px; font-size: 16px; font-weight: 500; opacity: .6; font-variant-numeric: tabular-nums; }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.words { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.words span { padding: 8px 14px; border-radius: 99px; background: var(--ink); color: var(--bg); font-weight: 500; }

/* ——— Не гуглить ——— */
.wave { width: 100%; height: auto; margin-top: 26px; overflow: visible; }
.wave .w-line { fill: none; stroke: var(--ink); stroke-width: 1; opacity: .35; }
.wave .w-done { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.wave .w-dot { fill: var(--yellow); stroke: var(--ink); stroke-width: 1.5; }

/* ——— Врач ——— */
.progress { height: 3px; background: color-mix(in srgb, var(--ink) 20%, transparent); margin-top: 26px; }
.progress i { display: block; height: 100%; background: var(--ink); transition: width .4s var(--ease); }
.checks { margin-top: 18px; border-bottom: 1px solid var(--ink); }
.check { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; padding: 15px 0; border-top: 1px solid var(--ink); cursor: pointer; font-size: 17px; line-height: 1.3; }
.check input { appearance: none; -webkit-appearance: none; width: 26px; height: 26px; margin: 0; border-radius: 50%; border: 1px solid var(--ink); display: grid; place-items: center; transition: background .2s; }
.check input:checked { background: var(--ink); }
.check input:checked::after { content: ""; width: 11px; height: 6px; border: solid var(--bg); border-width: 0 0 2px 2px; transform: translateY(-2px) rotate(-45deg); }
.check.done span { text-decoration: line-through; text-decoration-thickness: 1px; opacity: .55; }
.addrow { display: flex; gap: 10px; margin-top: 8px; align-items: flex-end; }
.addrow .field { flex: 1; font-size: 19px; }
.addrow .btn { flex: none; width: 52px; min-height: 52px; padding: 0; }
.say { font-size: 26px; line-height: 1.25; font-weight: 500; letter-spacing: -.02em; margin-top: 18px; text-wrap: pretty; }
.cheat .rule { font-size: 18px; line-height: 1.35; }
.cheat .rule ul { margin: 0; padding-left: 1.05em; }
.cheat .rule li + li { margin-top: 6px; }

/* ——— Архив ——— */
.bars { display: flex; height: 10px; margin-top: 26px; gap: 3px; }
.bars i { display: block; height: 100%; border-radius: 99px; box-shadow: inset 0 0 0 1px var(--ink); }
.legend { display: grid; gap: 4px; margin-top: 10px; font-size: 13px; font-weight: 500; }
.legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 8px; border: 1px solid var(--ink); }
.minis { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; margin-top: 10px; }
.mini { border-top: 1px solid var(--ink); padding: 12px 0 18px; }
.mini b { display: block; font-weight: 500; font-size: 44px; line-height: .9; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.mini span { display: block; margin-top: 8px; font-size: 13px; line-height: 1.3; }
.entry-tag { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; border: 1px solid var(--ink); background: var(--c, transparent); color: #141414; }
.entry-tag.empty { color: inherit; }
.detail .rule { margin-top: 18px; font-size: 16px; }

/* ——— Почему так бывает ——— */
.cycle { margin-top: 30px; position: relative; }
.cycle .step { display: grid; grid-template-columns: 34% 1fr; gap: 0 12px; border-top: 1px solid var(--ink); padding: 12px 0 20px; }
.cycle .step b { font-weight: 600; font-size: 12px; }
.cycle .step h3 { font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; }
.cycle .step p { font-size: 14px; margin-top: 6px; line-height: 1.35; }
.cycle .step a { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 99px; background: var(--ink); color: var(--bg); text-decoration: none; }
.cycle .back-arrow { border-top: 1px solid var(--ink); padding-top: 12px; font-size: 14px; font-weight: 500; display: flex; gap: 8px; align-items: center; }

/* ——— Срочно ——— */
.urgent { margin: 26px 0 0; padding: 0; list-style: none; counter-reset: u; border-bottom: 1px solid var(--ink); }
.urgent li { counter-increment: u; display: grid; grid-template-columns: 34px 1fr; gap: 10px; border-top: 1px solid var(--ink); padding: 14px 0; font-size: 17px; line-height: 1.35; }
.urgent li::before { content: counter(u, decimal-leading-zero); font-weight: 600; font-size: 12px; padding-top: 4px; }
.calls { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 30px; }
.calls a { text-decoration: none; display: grid; gap: 10px; }
.calls b { font-weight: 500; font-size: clamp(64px, 20vw, 92px); line-height: .8; letter-spacing: -.06em; }
.calls span { font-size: 13px; font-weight: 500; border-top: 1px solid var(--ink); padding-top: 8px; }

.toast { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 99px; font-weight: 500; z-index: 9; animation: rise .3s var(--ease); max-width: calc(100% - 40px); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  /* Шар дыхания движется медленно и задаёт ритм — его оставляем */
  .breath .orb { transition-duration: var(--dur, 1s) !important; }
}
