/* ============ Токены ============ */
:root {
  --bg: #f4efe7;
  --bg-2: #ece5d9;
  --surface: #fffcf6;
  --surface-2: #f6f0e6;
  --ink: #1c1820;
  --ink-2: #3a3440;
  --muted: #766d7a;
  --line: rgba(28, 24, 32, 0.1);
  --line-strong: rgba(28, 24, 32, 0.18);
  --paper: #fbf6ec;
  --accent: #c8473b;
  --accent-soft: rgba(200, 71, 59, 0.1);
  --on-accent: #fff8f2;
  --shadow-sm: 0 1px 2px rgba(28, 24, 32, 0.06), 0 4px 14px -6px rgba(28, 24, 32, 0.14);
  --shadow: 0 1px 2px rgba(28, 24, 32, 0.06), 0 18px 40px -18px rgba(28, 24, 32, 0.35);
  --backdrop: rgba(20, 16, 22, 0.42);

  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --r-lg: 24px;
  --r: 18px;
  --r-sm: 12px;
  --gutter: 16px;
  --safe-top: calc(var(--tg-content-safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --a1: #5b4bc4;
  --a2: #a387f0;
}

[data-theme='dark'] {
  --bg: #141117;
  --bg-2: #1a161e;
  --surface: #1f1a24;
  --surface-2: #28222f;
  --ink: #f3ece2;
  --ink-2: #ddd4ca;
  --muted: #a69ca9;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --paper: #f1e9da;
  --accent: #e3624f;
  --accent-soft: rgba(227, 98, 79, 0.14);
  --on-accent: #fff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 18px -8px rgba(0, 0, 0, 0.6);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 48px -20px rgba(0, 0, 0, 0.85);
  --backdrop: rgba(0, 0, 0, 0.6);
}

/* ============ База ============ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  transition: background-color 0.3s;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

#app { position: relative; min-height: 100vh; min-height: 100dvh; }
.screen {
  display: none;
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: calc(var(--safe-top) + 14px) var(--gutter) calc(var(--safe-bottom) + 28px);
}
.screen.active { display: block; animation: screen-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.icon { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 18px; height: 18px; }

.eyebrow {
  font: 700 11.5px/1.2 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.serif { font-family: var(--serif); }

/* ============ Кнопки ============ */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 999px;
  font: 700 16.5px/1 var(--sans);
  letter-spacing: -0.005em;
  transition: transform 0.15s, background-color 0.2s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-sm); }
.btn.accent { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 24px -12px var(--accent); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.btn.quiet { background: transparent; color: var(--muted); min-height: 48px; font-weight: 600; font-size: 15px; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

.icon-btn {
  position: relative;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform 0.15s;
}
.icon-btn:active { transform: scale(0.94); }
.badge {
  position: absolute; top: -3px; right: -3px;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px;
  background: var(--accent); color: var(--on-accent);
  font: 800 11px/20px var(--sans);
  text-align: center;
}

.link-btn { color: var(--accent); font-weight: 700; }

/* ============ Топбар ============ */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; }
.me { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  width: 44px; height: 44px; flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  color: #fff;
  display: grid; place-items: center;
  font: 700 17px/1 var(--sans);
  overflow: hidden;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line-strong);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.me-text { min-width: 0; }
.me-hello { font-weight: 800; font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-sub { color: var(--muted); font-size: 13.5px; line-height: 1.3; }

.back-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 6px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 15px; }
.in-tg .back-btn { display: none; }

/* ============ Главная ============ */
.invite {
  display: flex; gap: 12px; align-items: center;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 14.5px; line-height: 1.4;
  animation: screen-in 0.5s 0.15s both;
}
.invite .icon { color: var(--accent); }
.invite b { font-weight: 800; }

.hero { position: relative; text-align: center; padding: 8px 0 0; }
.hero-stage { position: relative; margin: 8px auto 22px; width: min(78%, 300px); }
.hero-glow {
  position: absolute; inset: 12% 8% -4%;
  background: radial-gradient(closest-side, rgba(200, 71, 59, 0.28), transparent), radial-gradient(closest-side at 30% 70%, rgba(91, 75, 196, 0.22), transparent);
  filter: blur(26px);
  z-index: 0;
}
.hero-card { position: relative; z-index: 1; animation: float 7s ease-in-out infinite; }
.hero-card.back { position: absolute; inset: 0; z-index: 0; animation: none; transform: rotate(-9deg) translate(-22px, 10px) scale(0.92); opacity: 0.9; }
.hero-card.back .paper { filter: saturate(0.9); }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(1.4deg); } 50% { transform: translateY(-8px) rotate(-0.6deg); } }

.paper {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r);
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid; place-items: center;
}
.paper::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(60, 40, 20, 0.08), inset 0 0 40px rgba(120, 90, 50, 0.08);
  pointer-events: none;
}
.paper img { width: 88%; height: 88%; object-fit: contain; mix-blend-mode: multiply; }

.hero h1 {
  font: 600 clamp(38px, 10.5vw, 50px)/1.02 var(--serif);
  letter-spacing: -0.02em;
  margin-top: 10px;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero .lead { margin: 12px auto 0; max-width: 34ch; color: var(--ink-2); font-size: 16.5px; line-height: 1.55; }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; padding: 0; margin: 16px 0 0; }
.chips li {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
}
.chips .icon { width: 16px; height: 16px; color: var(--muted); }

.actions { display: grid; gap: 10px; margin-top: 22px; }

.last {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  margin-top: 22px;
  padding: 14px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 0.15s;
}
.last:active { transform: scale(0.99); }
.last-dot { width: 46px; height: 46px; flex: none; border-radius: 14px; background: linear-gradient(135deg, var(--c1), var(--c2)); display: grid; place-items: center; color: #fff; }
.last-body { flex: 1; min-width: 0; }
.last-title { display: block; font: 600 18px/1.2 var(--serif); }
.last-sub { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.last .chev { color: var(--muted); }

.faq { margin-top: 30px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 2px;
  font-weight: 700; font-size: 15.5px;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--muted); transition: transform 0.25s; }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq p { padding: 0 2px 16px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.faq p + p { margin-top: -6px; }

.foot { margin-top: 26px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.foot .btn { margin-bottom: 14px; }

/* ============ Инструкция ============ */
.intro-head { margin-top: 18px; }
.intro-head h1 { font: 600 34px/1.1 var(--serif); letter-spacing: -0.015em; margin-top: 10px; }
.intro-head p { color: var(--ink-2); margin-top: 10px; font-size: 16px; }
.steps { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; }
.steps li {
  display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start;
  padding: 16px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  animation: screen-in 0.5s both;
}
.steps li:nth-child(2) { animation-delay: 0.07s; }
.steps li:nth-child(3) { animation-delay: 0.14s; }
.steps li:nth-child(4) { animation-delay: 0.21s; }
.step-num { width: 44px; height: 44px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; font: 600 20px/1 var(--serif); color: var(--accent); }
.steps b { display: block; font-size: 16px; margin-bottom: 3px; }
.steps span { color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.privacy { display: flex; gap: 10px; align-items: flex-start; margin: 18px 4px 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.privacy .icon { width: 18px; height: 18px; margin-top: 1px; }

.sticky-cta {
  position: sticky; bottom: 0;
  margin: 24px calc(var(--gutter) * -1) 0;
  padding: 14px var(--gutter) calc(var(--safe-bottom) + 12px);
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

/* ============ Тест ============ */
#screen-test { padding-bottom: calc(var(--safe-bottom) + 20px); }
.test-top {
  position: sticky; top: 0; z-index: 5;
  margin: calc((var(--safe-top) + 14px) * -1) calc(var(--gutter) * -1) 0;
  padding: calc(var(--safe-top) + 10px) var(--gutter) 10px;
  background: linear-gradient(to bottom, var(--bg) 75%, transparent);
  display: flex; align-items: center; gap: 12px;
}
.progress { flex: 1; display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.progress i { height: 4px; border-radius: 2px; background: var(--line-strong); transition: background-color 0.3s; }
.progress i.done { background: var(--ink); }
.progress i.now { background: var(--accent); }
.counter { font: 600 15px/1 var(--serif); color: var(--muted); min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; }

.plate-wrap { position: relative; margin-top: 6px; }
.plate { touch-action: manipulation; }
.plate img { transition: transform 0.45s cubic-bezier(0.3, 0.9, 0.3, 1); }
.plate.enter { animation: ink-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.plate.leave { animation: ink-out 0.28s ease-in both; }
@keyframes ink-in { from { opacity: 0; transform: scale(0.94) translateY(8px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes ink-out { to { opacity: 0; transform: scale(1.03); filter: blur(4px); } }
.plate-num { position: absolute; left: 14px; top: 10px; font: italic 600 18px/1 var(--serif); color: rgba(40, 30, 30, 0.45); z-index: 1; }
.rotate-btn {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.86);
  color: #2a2430;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.2s;
}
.rotate-btn:active { transform: rotate(-30deg) scale(0.94); }
.rotate-tip {
  position: absolute; right: 60px; bottom: 18px; z-index: 2;
  padding: 6px 10px; border-radius: 10px;
  background: rgba(28, 24, 32, 0.82); color: #fff;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
  animation: tip 5s 0.8s both;
  pointer-events: none;
}
@keyframes tip { 0% { opacity: 0; transform: translateX(6px); } 8%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

.question { margin: 20px 2px 4px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.question h2 { font: 600 25px/1.15 var(--serif); letter-spacing: -0.01em; }
.question-hint { color: var(--muted); font-size: 14px; margin: 0 2px 14px; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.opt {
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  min-height: 82px;
  padding: 13px 14px 14px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1.5px solid var(--line);
  text-align: left;
  transition: transform 0.15s, border-color 0.2s, background-color 0.2s;
  animation: screen-in 0.4s both;
}
.opt:nth-child(2) { animation-delay: 0.03s; }
.opt:nth-child(3) { animation-delay: 0.06s; }
.opt:nth-child(4) { animation-delay: 0.09s; }
.opt:nth-child(5) { animation-delay: 0.12s; }
.opt:nth-child(6) { animation-delay: 0.15s; }
.opt:active { transform: scale(0.97); }
.opt-t { font-weight: 700; font-size: 15px; line-height: 1.25; letter-spacing: -0.005em; }
.opt-h { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); }
.opt.selected::after {
  content: '';
  position: absolute; top: 10px; right: 10px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.opt.custom {
  grid-column: 1 / -1;
  min-height: 0;
  flex-direction: row; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-style: dashed;
  border-color: var(--line-strong);
  background: transparent;
}
.opt.custom .icon { color: var(--accent); }
.opt.custom .opt-h { margin-left: auto; text-align: right; }
.options.locked { pointer-events: none; }

/* ============ Нижний лист ============ */
.sheet { position: fixed; inset: 0; z-index: 50; visibility: hidden; }
.sheet.open { visibility: visible; }
.sheet-backdrop { position: absolute; inset: 0; background: var(--backdrop); opacity: 0; transition: opacity 0.3s; }
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 540px; margin: 0 auto;
  max-height: 92vh; max-height: 92dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  padding: 8px var(--gutter) calc(var(--safe-bottom) + 18px);
  transform: translateY(105%);
  transition: transform 0.38s cubic-bezier(0.2, 0.9, 0.25, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
}
.sheet.open .sheet-panel { transform: none; }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 14px; }
.sheet-title { font: 600 24px/1.2 var(--serif); letter-spacing: -0.01em; }
.sheet-sub { color: var(--muted); font-size: 14.5px; margin-top: 6px; line-height: 1.45; }

.link-box {
  display: flex; align-items: center; gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 13.5px; color: var(--ink-2);
}
.link-box span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; }
.link-box .icon { color: var(--muted); }

.share-list { display: grid; gap: 8px; margin-top: 14px; }
.share-item {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  transition: transform 0.15s;
}
.share-item:active { transform: scale(0.985); }
.share-ico { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.share-ico.tg { background: linear-gradient(160deg, #37aee2, #1e96c8); }
.share-ico.chat { background: linear-gradient(160deg, #7c6cf0, #5a49d6); }
.share-ico.story { background: linear-gradient(160deg, #f2a541, #c2397a); }
.share-ico.copy { background: var(--ink); color: var(--bg); }
.share-ico.more { background: var(--surface-2); color: var(--ink); }
.share-item b { display: block; font-size: 15.5px; }
.share-item small { display: block; color: var(--muted); font-size: 13px; margin-top: 1px; line-height: 1.35; }

.field-label { display: block; font-weight: 700; font-size: 14px; margin: 18px 2px 8px; }
.field {
  width: 100%;
  min-height: 84px;
  padding: 14px;
  border-radius: var(--r);
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: 500 16px/1.45 var(--sans);
  resize: none;
  transition: border-color 0.2s;
}
.field:focus { outline: none; border-color: var(--accent); }
.field::placeholder { color: var(--muted); opacity: 0.8; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-size: 14px; font-weight: 600;
  transition: all 0.15s;
}
.pill[aria-pressed='true'] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.sheet-actions { display: grid; gap: 6px; margin-top: 22px; }

/* ============ Подсчёт ============ */
#screen-calc.active { display: flex; flex-direction: column; justify-content: center; }
.calc { text-align: center; padding: 20px 0; }
.calc-stage { position: relative; width: min(82vw, 320px); aspect-ratio: 4 / 3; margin: 0 auto; }
.calc-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 0.6s; }
.calc h2 { font: 600 28px/1.2 var(--serif); margin-top: 26px; }
.calc-steps { list-style: none; padding: 0; margin: 18px auto 0; max-width: 320px; text-align: left; display: grid; gap: 10px; }
.calc-steps li { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14.5px; opacity: 0.35; transition: opacity 0.4s, color 0.4s; }
.calc-steps li.on { opacity: 1; color: var(--ink); }
.calc-steps li .tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; transition: all 0.3s; }
.calc-steps li.done .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.calc-steps .tick .icon { width: 12px; height: 12px; stroke-width: 3; opacity: 0; }
.calc-steps li.done .tick .icon { opacity: 1; }
.fact { margin: 28px auto 0; max-width: 360px; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-align: left; }
.fact .eyebrow { color: var(--accent); }
.fact p { margin-top: 6px; font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }

/* ============ Результат ============ */
.res-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.res-hero { text-align: center; padding-top: 6px; }
.res-for { display: inline-flex; align-items: center; gap: 10px; margin-top: 4px; color: var(--muted); font-size: 14.5px; font-weight: 600; }
.res-for .avatar { width: 30px; height: 30px; font-size: 13px; box-shadow: none; }
.res-blot { margin: 18px auto 0; width: min(100%, 420px); }
.res-blot .paper { aspect-ratio: 3 / 2; }
.res-blot canvas { width: 92%; height: 90%; }
.res-hero h1 {
  margin-top: 22px;
  font: 600 clamp(36px, 10.5vw, 48px)/1.04 var(--serif);
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--a1), var(--a2));
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  padding-bottom: 4px;
}
.res-hero .tagline { margin: 8px auto 0; max-width: 30ch; font: italic 500 18.5px/1.4 var(--serif); color: var(--ink-2); }

.sec { margin-top: 34px; }
.sec > .eyebrow { margin: 0 2px 10px; display: block; }
.sec h2 { font: 600 24px/1.2 var(--serif); letter-spacing: -0.01em; margin: 0 2px 12px; }
.prose p { font-size: 16.5px; line-height: 1.65; color: var(--ink-2); }
.prose p + p { margin-top: 14px; }
.dropcap > p:first-of-type::first-letter { font: 600 3.1em/0.8 var(--serif); float: left; margin: 0.06em 0.08em 0 0; color: var(--a1); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }

.eb-label { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--ink-2); }
.eb-title { font: 600 21px/1.25 var(--serif); margin-top: 12px; }
.eb-text { margin-top: 8px; font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.eb-bar { position: relative; margin-top: 18px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--a1), var(--line-strong) 50%, var(--accent)); opacity: 0.9; }
.eb-mark { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--surface); border: 3px solid var(--ink); box-shadow: var(--shadow-sm); transition: left 1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s; }
.eb-ends { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }

.scales { display: grid; gap: 16px; }
.scale-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.scale-name { font-weight: 700; font-size: 15px; }
.scale-word { font-size: 13px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.scale-word.hi { color: var(--a1); }
.scale-desc { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.scale-track { margin-top: 8px; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.scale-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--a1), var(--a2)); transition: width 1.1s cubic-bezier(0.2, 0.8, 0.2, 1); }

.duo { display: grid; gap: 12px; }
.duo .card h3 { display: flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 800; margin-bottom: 10px; }
.duo .card h3 .icon { color: var(--a1); }
.duo ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.duo li { position: relative; padding-left: 18px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.duo li::before { content: ''; position: absolute; left: 2px; top: 0.6em; width: 7px; height: 7px; border-radius: 50%; background: var(--a2); }
.duo .card.soft li::before { background: var(--line-strong); }

.insights { display: grid; gap: 10px; }
.insight { display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: start; }
.insight-ico { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--a1); }
.insight b { display: block; font-size: 15.5px; margin-bottom: 3px; }
.insight p { font-size: 14.5px; color: var(--ink-2); line-height: 1.55; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { padding: 14px 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-align: center; }
.stat b { display: block; font: 600 26px/1.1 var(--serif); }
.stat span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.3; }

.answers {
  display: flex; gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 14px;
  scrollbar-width: none;
}
.answers::-webkit-scrollbar { display: none; }
.ans { flex: 0 0 74%; max-width: 280px; scroll-snap-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 10px 16px; }
.ans .paper { aspect-ratio: 4 / 3; box-shadow: none; border-radius: 14px; }
.ans .paper img { width: 84%; height: 84%; }
.ans-meta { display: flex; justify-content: space-between; align-items: center; margin: 12px 6px 0; }
.ans-num { font: italic 600 17px/1 var(--serif); color: var(--muted); }
.tag { font-size: 11.5px; font-weight: 800; padding: 4px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag.p { background: rgba(79, 107, 58, 0.14); color: #5c7a43; }
.tag.o { background: var(--accent-soft); color: var(--accent); }
.ans-you { margin: 8px 6px 0; font-weight: 700; font-size: 15px; line-height: 1.3; }
.ans-pop { margin: 6px 6px 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.ans-note { margin: 10px 6px 0; padding-top: 10px; border-top: 1px dashed var(--line-strong); font-size: 13px; color: var(--ink-2); line-height: 1.45; }

.compare { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; text-align: center; }
.compare .who { font-size: 13px; color: var(--muted); font-weight: 600; }
.compare .what { font: 600 18px/1.2 var(--serif); margin-top: 6px; }
.compare .vs { font: italic 600 18px/1 var(--serif); color: var(--muted); }
.compare-note { margin-top: 14px; font-size: 14.5px; color: var(--ink-2); text-align: center; line-height: 1.5; }

.advice { position: relative; padding: 22px 20px 20px 22px; border-radius: var(--r-lg); background: linear-gradient(135deg, var(--a1), var(--a2)); color: #fff; overflow: hidden; }
.advice::before { content: '“'; position: absolute; right: 14px; top: -18px; font: 600 120px/1 var(--serif); opacity: 0.22; }
.advice .eyebrow { color: rgba(255, 255, 255, 0.8); }
.advice p { margin-top: 8px; font: 500 19px/1.45 var(--serif); }

.disclaimer { display: flex; gap: 12px; margin-top: 26px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); font-size: 13px; color: var(--muted); line-height: 1.5; }
.disclaimer .icon { width: 18px; height: 18px; margin-top: 1px; }

.res-actions { display: grid; gap: 10px; margin-top: 26px; }

/* ============ История ============ */
.page-head { margin-top: 8px; }
.page-head h1 { font: 600 32px/1.15 var(--serif); margin-top: 8px; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 14.5px; }
.hist { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.hist li { animation: screen-in 0.4s both; }
.hist .last { margin-top: 0; }
.empty { margin-top: 40px; text-align: center; color: var(--muted); }
.empty .paper { width: 200px; margin: 0 auto 20px; opacity: 0.85; }
.empty p { max-width: 28ch; margin: 0 auto; }

/* ============ Тост ============ */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 24px); z-index: 80;
  transform: translate(-50%, 20px);
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-weight: 700; font-size: 14.5px;
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: all 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ Адаптив ============ */
@media (max-width: 359px) {
  :root { --gutter: 14px; }
  .options { gap: 8px; }
  .opt { padding: 11px 12px 12px; min-height: 76px; }
  .opt-t { font-size: 14px; }
  .question h2 { font-size: 22px; }
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (min-height: 860px) { .hero { padding-top: 22px; } .hero-stage { width: min(84%, 340px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
