/* psy-funnel-bot Mini App — calm, warm, editorial */
:root {
  --bg: #f6f1ea;
  --card: #fffdf9;
  --ink: #24303a;
  --ink-soft: #5c6b76;
  --line: #e7dfd4;
  --accent: #c4633e;        /* терракота */
  --accent-soft: #f3d9cd;
  --sage: #7fa398;          /* шалфей — притязания */
  --sage-soft: #ddeae5;
  --gold: #b98a3c;          /* возможности √ */
  --radius: 22px;
  --shadow: 0 10px 30px rgba(36, 48, 58, .08), 0 2px 6px rgba(36, 48, 58, .05);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 500px at 85% -10%, #efe4d4 0%, transparent 60%),
    radial-gradient(900px 400px at -10% 110%, #e3ece8 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: "SF Pro Text", -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

.screen { display: none; max-width: 480px; margin: 0 auto; padding: 20px 16px 40px; }
.screen.active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* --- герой --- */
.hero { text-align: center; padding: 28px 0 18px; }
.hero.small { padding: 18px 0 6px; }
.hero-mark {
  font-size: 30px; color: var(--accent);
  margin-bottom: 10px; animation: breathe 4s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { opacity: .65; } 50% { opacity: 1; } }
.hero h1 {
  margin: 0; font-family: Georgia, "Times New Roman", serif;
  font-size: 30px; font-weight: 500; letter-spacing: .5px;
}
.subtitle { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; letter-spacing: 2px; text-transform: uppercase; }

/* --- карточка --- */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); border: 1px solid rgba(231, 223, 212, .6);
  padding: 24px 20px; margin-top: 8px;
}
.lead { font-size: 16px; line-height: 1.55; color: var(--ink); margin: 0 0 14px; }
.hints { list-style: none; margin: 0 0 20px; padding: 0; color: var(--ink-soft); font-size: 14px; }
.hints li { padding: 7px 0 7px 26px; position: relative; }
.hints li::before { content: "—"; position: absolute; left: 4px; color: var(--accent); }
.disclaimer { color: var(--ink-soft); font-size: 12.5px; text-align: center; margin: 16px 0 0; }

/* --- кнопки --- */
.btn-primary, .btn-ghost {
  width: 100%; padding: 16px; border-radius: 16px; font-size: 16px; font-weight: 600;
  border: none; cursor: pointer; transition: transform .12s ease, opacity .2s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 18px rgba(196, 99, 62, .35); }
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .35; box-shadow: none; cursor: default; }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.nav-row { display: flex; gap: 12px; margin-top: 16px; }
.nav-row .btn-ghost { width: auto; padding: 16px 22px; }

/* --- прогресс --- */
.progress-head {
  display: flex; justify-content: space-between; align-items: baseline;
  color: var(--ink-soft); font-size: 14px; margin: 10px 2px 8px;
  font-variant-numeric: tabular-nums;
}
.progress-track { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--sage), var(--accent)); border-radius: 3px; transition: width .3s ease; }

/* --- шкала --- */
.scale-card h2 {
  margin: 2px 0 4px; font-family: Georgia, serif; font-weight: 500; font-size: 24px;
}
.scale-note { color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; margin: 14px 0 0; }

.rails { display: flex; justify-content: space-around; gap: 6px; margin-top: 18px; }
.rail-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rail {
  position: relative; width: 44px; height: 300px; border-radius: 22px;
  background: linear-gradient(180deg, var(--sage-soft), #f7f0e6 55%, var(--accent-soft));
  box-shadow: inset 0 2px 8px rgba(36,48,58,.12);
  touch-action: none; cursor: pointer;
}
.rail::before { /* середина — точка отсчёта (Яньшин) */
  content: ""; position: absolute; left: 8px; right: 8px; top: 50%;
  border-top: 1.5px dashed rgba(36,48,58,.3);
}
.rail-top, .rail-bottom { font-size: 10.5px; color: var(--ink-soft); text-align: center; line-height: 1.25; max-width: 90px; }
/* подпись отметки («я сейчас» / «мечта» / «могу объективно») — над полюсами,
   цветом своей отметки; раньше висела под шкалой и читалась как нижний полюс.
   Фиксированная высота 2 строки: подписи разной длины НЕ должны сдвигать
   шкалы на разные уровни (фидбек Риты 25.08: «три шкалы должны быть ровно») */
.rail-caption {
  font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  text-align: center; line-height: 1.3; max-width: 90px;
  height: 30px; display: flex; align-items: flex-end; justify-content: center;
}
.cap-actual { color: var(--accent); }
.cap-ideal { color: var(--sage); }
.cap-possible { color: var(--gold); }
.handle {
  position: absolute; left: 50%; transform: translate(-50%, 50%);
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 4px 10px rgba(36,48,58,.35);
  user-select: none; transition: box-shadow .15s;
}
.handle.dragging { box-shadow: 0 0 0 5px rgba(255,255,255,.7), 0 6px 14px rgba(36,48,58,.4); }
.h-actual { background: var(--accent); }
.h-ideal { background: var(--sage); }
.h-possible { background: var(--gold); }
/* .rail-value (число под шкалой) убрано: число теперь в самом ползунке */

/* --- результат --- */
.legend { display: flex; justify-content: center; gap: 18px; margin-top: 12px; }
.lg { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--ink-soft); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-so { background: var(--accent); }
.dot-up { background: var(--sage); }
#radar { max-width: 320px; margin: 4px auto 0; display: block; }

@media (max-height: 700px) { .rail { height: 240px; } }
