/* ───────────── Date Assist — мягкая, тёплая, без острых углов ───────────── */

:root {
  --bg: #fff6f2;
  --bg-2: #fdece7;
  --card: #ffffff;
  --card-2: #fff9f7;
  --ink: #3b2d3a;
  --ink-2: #7d6b7b;
  --ink-3: #ad9cab;
  --line: #f3e2de;
  --rose: #ff7d94;
  --peach: #ffa77d;
  --lilac: #b39cf5;
  --mint: #6fcfae;
  --sun: #ffc861;
  --danger: #f2738a;
  --grad: linear-gradient(135deg, #ff8aa1 0%, #ffa57f 100%);
  --grad-soft: linear-gradient(135deg, #ffe3e8 0%, #ffeadf 100%);
  --grad-lilac: linear-gradient(135deg, #e9e1ff 0%, #ffe3ef 100%);
  --shadow: 0 12px 32px -12px rgba(255, 110, 140, 0.28);
  --shadow-sm: 0 6px 18px -10px rgba(120, 60, 90, 0.22);
  --blob-1: #ffc1cf;
  --blob-2: #ffd6bd;
  --blob-3: #dcd0ff;
  --r-xl: 32px;
  --r-lg: 26px;
  --r-md: 20px;
  --r-sm: 14px;
  --pill: 999px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

:root[data-theme='dark'] {
  --bg: #1b1420;
  --bg-2: #241a2a;
  --card: #2a1f30;
  --card-2: #30243a;
  --ink: #f8edf5;
  --ink-2: #bfaebd;
  --ink-3: #8a7a8c;
  --line: #3b2e42;
  --grad-soft: linear-gradient(135deg, #3a2533 0%, #3b2a2a 100%);
  --grad-lilac: linear-gradient(135deg, #2f2745 0%, #3a2436 100%);
  --shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 8px 20px -12px rgba(0, 0, 0, 0.55);
  --blob-1: #5a2840;
  --blob-2: #573326;
  --blob-3: #352a63;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

/* ───────── Фон с мягкими пятнами ───────── */
.blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.75;
  animation: float 18s ease-in-out infinite;
}
.b1 { width: 340px; height: 340px; background: var(--blob-1); top: -120px; left: -110px; }
.b2 { width: 300px; height: 300px; background: var(--blob-2); top: 30%; right: -150px; animation-delay: -6s; }
.b3 { width: 320px; height: 320px; background: var(--blob-3); bottom: -140px; left: 10%; animation-delay: -11s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, 20px) scale(1.06); }
  66% { transform: translate(-20px, 30px) scale(0.96); }
}

.app {
  position: relative; z-index: 1;
  max-width: 520px; margin: 0 auto;
  padding: 16px 16px calc(28px + var(--safe-b));
  min-height: 100vh;
}

/* ───────── Анимации экранов ───────── */
.screen { animation: rise 0.42s cubic-bezier(.2, .8, .2, 1) both; }
.screen.leaving { animation: sink 0.22s ease-in both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes sink { to { opacity: 0; transform: translateY(-10px) scale(0.99); } }
.stagger > * { animation: rise 0.5s cubic-bezier(.2, .8, .2, 1) both; }
.stagger > *:nth-child(2) { animation-delay: 0.05s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.15s; }
.stagger > *:nth-child(5) { animation-delay: 0.2s; }
.stagger > *:nth-child(6) { animation-delay: 0.25s; }
.stagger > *:nth-child(n+7) { animation-delay: 0.3s; }

/* ───────── Загрузка ───────── */
.loader { min-height: 70vh; display: grid; place-items: center; }
.loader-heart { font-size: 48px; animation: beat 1.1s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }

/* ───────── Шапка ───────── */
.topbar { display: flex; align-items: center; gap: 12px; margin: 4px 0 18px; min-height: 44px; }
.logo {
  width: 44px; height: 44px; border-radius: 16px; background: var(--grad);
  display: grid; place-items: center; box-shadow: var(--shadow); flex: none;
}
.logo svg { width: 24px; height: 24px; }
.topbar h1 { font-size: 20px; font-weight: 900; margin: 0; letter-spacing: -0.01em; }
.topbar .sub { font-size: 14px; color: var(--ink-2); margin: 0; }
.back {
  width: 44px; height: 44px; border-radius: 50%; background: var(--card);
  display: grid; place-items: center; box-shadow: var(--shadow-sm); flex: none; font-size: 20px;
}

/* ───────── Карточки ───────── */
.card {
  background: var(--card); border-radius: var(--r-lg); padding: 20px;
  box-shadow: var(--shadow-sm); margin-bottom: 14px;
}
.card.soft { background: var(--grad-soft); box-shadow: none; }
.card.lilac { background: var(--grad-lilac); box-shadow: none; }
.hero {
  background: var(--grad); color: #fff; border-radius: var(--r-xl); padding: 26px 22px 22px;
  box-shadow: var(--shadow); position: relative; overflow: hidden; margin-bottom: 16px;
}
.hero::after {
  content: ''; position: absolute; width: 220px; height: 220px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.16); right: -70px; top: -80px;
}
.hero::before {
  content: ''; position: absolute; width: 140px; height: 140px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.1); left: -50px; bottom: -60px;
}
.hero > * { position: relative; z-index: 1; }
.hero h2 { font-size: 26px; line-height: 1.15; font-weight: 900; margin: 0 0 8px; letter-spacing: -0.01em; }
.hero p { margin: 0 0 18px; opacity: 0.95; }
.hero .btn { background: #fff; color: #e8577a; box-shadow: 0 10px 24px -10px rgba(120, 30, 60, 0.45); }

h3.section {
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ink-3); margin: 24px 6px 10px;
}
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.center { text-align: center; }

/* ───────── Кнопки ───────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 56px; padding: 14px 22px; border-radius: var(--pill);
  background: var(--grad); color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: var(--shadow); transition: transform 0.15s ease, opacity 0.2s, filter 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn.quiet { background: transparent; color: var(--ink-2); box-shadow: none; min-height: 46px; font-weight: 700; font-size: 15px; }
.btn + .btn { margin-top: 10px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.row .btn + .btn { margin-top: 0; }

.sticky-bottom {
  position: sticky; bottom: calc(10px + var(--safe-b)); margin-top: 18px; z-index: 5;
}

/* ───────── Поля ввода ───────── */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 800; margin: 0 4px 8px; }
.field .hint { font-size: 13px; color: var(--ink-2); margin: -4px 4px 8px; }
.input, .textarea {
  width: 100%; border: 2px solid var(--line); background: var(--card); border-radius: var(--r-md);
  padding: 15px 18px; font-size: 16px; outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea { min-height: 120px; resize: none; line-height: 1.5; }
.input:focus, .textarea:focus { border-color: var(--rose); box-shadow: 0 0 0 5px rgba(255, 125, 148, 0.14); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }

/* ───────── Чипы ───────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px;
  border-radius: var(--pill); background: var(--card); border: 2px solid var(--line);
  font-weight: 700; font-size: 15px; transition: all 0.18s ease; user-select: none;
}
.chip:active { transform: scale(0.95); }
.chip.on { background: var(--grad-soft); border-color: var(--rose); color: var(--ink); }
.chip.on::after { content: '✓'; font-weight: 900; color: var(--rose); margin-left: 2px; }
.chip.static { cursor: default; }
.chip.static.on::after { content: none; }
.chip.tiny { padding: 6px 12px; font-size: 13px; border-width: 0; background: var(--bg-2); }

/* ───────── Список приглашений ───────── */
.invite {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--card); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 10px;
  box-shadow: var(--shadow-sm); transition: transform 0.15s;
}
.invite:active { transform: scale(0.98); }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 900; font-size: 20px; color: #fff; background: var(--grad);
}
.avatar.l { background: linear-gradient(135deg, #b39cf5, #ff9fc1); }
.avatar.m { background: linear-gradient(135deg, #6fcfae, #8fb8ff); }
.invite .grow { flex: 1; min-width: 0; }
.invite .name { font-weight: 800; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  padding: 4px 10px; border-radius: var(--pill); background: var(--bg-2); color: var(--ink-2); margin-top: 3px;
}
.status.done { background: rgba(111, 207, 174, 0.18); color: #2f9e79; }
.status.progress { background: rgba(255, 200, 97, 0.2); color: #c98a12; }
:root[data-theme='dark'] .status.done { color: #8fe3c6; }
:root[data-theme='dark'] .status.progress { color: #ffd889; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--rose); box-shadow: 0 0 0 4px rgba(255, 125, 148, 0.18); flex: none; }
.chev { color: var(--ink-3); font-size: 22px; }

.steps { display: grid; gap: 10px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-num {
  width: 36px; height: 36px; border-radius: 50%; background: var(--grad-soft); flex: none;
  display: grid; place-items: center; font-weight: 900; color: var(--rose);
}
.step b { display: block; }

/* ───────── Шаринг ───────── */
.big-emoji { font-size: 76px; line-height: 1; display: block; margin: 8px auto 12px; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-8px) rotate(3deg); } }
.linkbox {
  display: flex; align-items: center; gap: 10px; background: var(--bg-2); border-radius: var(--r-md);
  padding: 12px 14px; font-size: 14px; color: var(--ink-2); word-break: break-all; margin: 14px 0;
}
.linkbox span { flex: 1; }
.quote {
  background: var(--grad-soft); border-radius: var(--r-md) var(--r-md) var(--r-md) 6px;
  padding: 14px 18px; font-style: italic; margin: 16px 0; position: relative;
}
.quote.from { border-radius: var(--r-md) var(--r-md) 6px var(--r-md); }

/* ───────── Анкета ───────── */
.meter { display: flex; align-items: center; gap: 12px; margin: 4px 2px 18px; }
.meter-heart { font-size: 26px; animation: beat 2.4s ease-in-out infinite; }
.meter-body { flex: 1; }
.meter-label { font-size: 13px; font-weight: 800; color: var(--ink-2); margin-bottom: 6px; display: flex; justify-content: space-between; }
.track { height: 12px; border-radius: var(--pill); background: var(--bg-2); overflow: hidden; }
.track > i { display: block; height: 100%; border-radius: var(--pill); background: var(--grad); transition: width 0.7s cubic-bezier(.2, .8, .2, 1); }

.qcard {
  background: var(--card); border-radius: var(--r-xl); padding: 24px 20px; box-shadow: var(--shadow-sm); margin-bottom: 14px;
}
.qtext { font-size: 23px; font-weight: 900; line-height: 1.22; margin: 0; letter-spacing: -0.01em; }
.qhint { color: var(--ink-2); margin: 8px 0 0; font-size: 15px; }
.qtag { display: inline-block; font-size: 12px; font-weight: 800; color: var(--rose); background: var(--grad-soft); padding: 4px 10px; border-radius: var(--pill); margin-bottom: 10px; letter-spacing: 0.04em; text-transform: uppercase; }

.options { display: grid; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--card); border-radius: var(--r-lg); padding: 16px 18px; min-height: 76px;
  box-shadow: var(--shadow-sm); border: 2.5px solid transparent;
  transition: transform 0.16s ease, border-color 0.2s, background 0.2s;
  font-weight: 700; font-size: 16.5px; line-height: 1.3;
}
.opt:active { transform: scale(0.975); }
.opt .em {
  width: 52px; height: 52px; border-radius: 50%; background: var(--bg-2); flex: none;
  display: grid; place-items: center; font-size: 28px;
}
.opt.picked { border-color: var(--rose); background: var(--grad-soft); transform: scale(0.985); }
.opt.picked .em { background: var(--card); animation: pop 0.35s ease; }
.options.dim .opt:not(.picked) { opacity: 0.45; }
@keyframes pop { 50% { transform: scale(1.18); } }

.duel .opt { min-height: 104px; flex-direction: column; justify-content: center; text-align: center; padding: 18px; gap: 10px; }
.duel .opt .em { width: 62px; height: 62px; font-size: 34px; }
.duel-or { text-align: center; font-weight: 900; color: var(--ink-3); font-size: 13px; margin: -4px 0; letter-spacing: 0.1em; }
.alt { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.alt button {
  padding: 10px 16px; border-radius: var(--pill); background: var(--card); font-weight: 700; font-size: 14px;
  color: var(--ink-2); box-shadow: var(--shadow-sm);
}
.alt button:active { transform: scale(0.95); }

.likert { display: flex; justify-content: space-between; align-items: center; padding: 8px 4px 0; }
.lk {
  border-radius: 50%; display: grid; place-items: center; transition: transform 0.15s, box-shadow 0.2s;
  border: 3px solid transparent; font-size: 22px;
}
.lk:active { transform: scale(0.9); }
.lk[data-v='-2'] { width: 60px; height: 60px; background: #e8e0ff; }
.lk[data-v='-1'] { width: 50px; height: 50px; background: #efe9ff; }
.lk[data-v='0'] { width: 42px; height: 42px; background: var(--bg-2); }
.lk[data-v='1'] { width: 50px; height: 50px; background: #ffe6eb; }
.lk[data-v='2'] { width: 60px; height: 60px; background: #ffd5de; }
:root[data-theme='dark'] .lk[data-v='-2'] { background: #3b3160; }
:root[data-theme='dark'] .lk[data-v='-1'] { background: #332a50; }
:root[data-theme='dark'] .lk[data-v='1'] { background: #4a2a3a; }
:root[data-theme='dark'] .lk[data-v='2'] { background: #5a2d42; }
.lk.picked { border-color: var(--rose); transform: scale(1.08); }
.likert-labels { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-top: 12px; padding: 0 2px; }

.guess { text-align: center; background: var(--grad-lilac); }
.guess .ball { font-size: 64px; display: block; margin: 0 auto 10px; animation: bob 3s ease-in-out infinite; }
.guess .qtext { font-size: 21px; }
.guess .ask { font-weight: 800; color: var(--ink-2); margin-top: 12px; }

.cgroup { margin-bottom: 18px; }
.cgroup h4 { margin: 0 4px 10px; font-size: 15px; font-weight: 800; }

/* ───────── Финал респондента ───────── */
.portrait {
  text-align: center; background: var(--grad-lilac); border-radius: var(--r-xl); padding: 26px 20px; margin: 16px 0;
}
.portrait .em { font-size: 64px; display: block; margin-bottom: 8px; }
.portrait h2 { margin: 0 0 6px; font-size: 26px; font-weight: 900; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.confetti span { position: absolute; top: -40px; font-size: 22px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); opacity: 0.6; } }

/* ───────── Сводка ───────── */
.tabs {
  display: flex; gap: 4px; background: var(--card); padding: 5px; border-radius: var(--pill);
  box-shadow: var(--shadow-sm); position: sticky; top: 10px; z-index: 6; margin-bottom: 16px;
}
.tab { flex: 1; padding: 11px 6px; border-radius: var(--pill); font-weight: 800; font-size: 14.5px; color: var(--ink-2); transition: all 0.2s; white-space: nowrap; }
.tab.on { background: var(--grad); color: #fff; box-shadow: var(--shadow); }

.arch-emoji { font-size: 58px; display: block; margin-bottom: 6px; }
.hero .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.hero .tags span { background: rgba(255, 255, 255, 0.24); padding: 6px 12px; border-radius: var(--pill); font-size: 13px; font-weight: 800; }
.hero .desc { font-size: 15.5px; opacity: 0.96; margin: 10px 0 0; }

.timeline { position: relative; padding-left: 4px; }
.tl { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.tl:not(:last-child)::before {
  content: ''; position: absolute; left: 23px; top: 50px; bottom: 2px; width: 3px; border-radius: 3px; background: var(--line);
}
.tl .em { width: 48px; height: 48px; border-radius: 50%; background: var(--grad-soft); display: grid; place-items: center; font-size: 24px; flex: none; }
.tl b { display: block; font-size: 16px; margin: 3px 0 2px; }
.tl p { margin: 0; color: var(--ink-2); font-size: 15px; }

.idea { display: flex; gap: 14px; align-items: flex-start; }
.idea + .idea { margin-top: 18px; padding-top: 18px; border-top: 2px dashed var(--line); }
.idea .em { width: 56px; height: 56px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; font-size: 28px; flex: none; }
.idea .grow { flex: 1; min-width: 0; }
.idea h4 { margin: 2px 0 4px; font-size: 17px; font-weight: 800; }
.idea p { margin: 0 0 8px; color: var(--ink-2); font-size: 14.5px; }
.ring { --p: 0; width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--rose) calc(var(--p) * 1%), var(--bg-2) 0); }
.ring span { width: 40px; height: 40px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 13px; font-weight: 900; }
.note { font-size: 13px; color: #c46a2b; background: rgba(255, 167, 125, 0.16); padding: 6px 12px; border-radius: var(--pill); display: inline-block; margin: 4px 4px 0 0; font-weight: 700; }
:root[data-theme='dark'] .note { color: #ffc29c; }

.list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15.5px; }
.badge { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 900; font-size: 14px; }
.badge.yes { background: rgba(111, 207, 174, 0.2); color: #2f9e79; }
.badge.no { background: rgba(242, 115, 138, 0.16); color: var(--danger); }
:root[data-theme='dark'] .badge.yes { color: #8fe3c6; }

.warn { background: linear-gradient(135deg, rgba(255, 200, 97, 0.2), rgba(255, 167, 125, 0.18)); }

.ll { margin-bottom: 12px; }
.ll-head { display: flex; justify-content: space-between; font-weight: 800; margin-bottom: 6px; font-size: 15px; }
.ll .track { height: 14px; }
.ll.top .track > i { background: var(--grad); }
.ll:not(.top) .track > i { background: linear-gradient(90deg, #d8ccff, #ffc9d6); }
:root[data-theme='dark'] .ll:not(.top) .track > i { background: linear-gradient(90deg, #5b4b8f, #7a3e5a); }

.axis { margin-bottom: 16px; }
.axis-poles { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); font-weight: 700; margin-bottom: 7px; gap: 12px; }
.axis-poles span:last-child { text-align: right; }
.axis-poles .strong { color: var(--ink); font-weight: 900; }
.axis-track { position: relative; height: 12px; border-radius: var(--pill); background: linear-gradient(90deg, #e3daff, var(--bg-2) 50%, #ffd9e1); }
:root[data-theme='dark'] .axis-track { background: linear-gradient(90deg, #3a3060, var(--bg-2) 50%, #57283c); }
.axis-dot {
  position: absolute; top: 50%; width: 24px; height: 24px; border-radius: 50%; background: var(--grad);
  border: 4px solid var(--card); transform: translate(-50%, -50%); box-shadow: var(--shadow-sm);
}
.axis-label { font-weight: 800; font-size: 14px; margin-bottom: 6px; }

.insight { display: flex; gap: 14px; }
.insight + .insight { margin-top: 16px; }
.insight .em { width: 44px; height: 44px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; font-size: 22px; flex: none; }
.insight b { display: block; margin-bottom: 2px; }
.insight p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

.qa + .qa { margin-top: 18px; }
.qa .qtag { margin-bottom: 8px; }
.qa .quote { margin: 0; font-style: normal; font-size: 16px; }

.empty { text-align: center; padding: 28px 10px; color: var(--ink-2); }
.empty .big-emoji { font-size: 56px; }

/* ───────── Тост ───────── */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 30px);
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: var(--pill);
  font-weight: 800; font-size: 15px; opacity: 0; transition: all 0.3s ease; z-index: 50; pointer-events: none;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
