:root {
  --bg: #0e0f13;
  --bg-2: #15171d;
  --card: #1b1e26;
  --line: #2a2e39;
  --text: #f2f3f5;
  --muted: #9aa0ad;
  --accent: #ff6b5b;
  --accent-2: #ff8f6b;
  --her: #252935;
  --me: #ff6b5b;
  --good: #3ecf8e;
  --ok: #7aa7ff;
  --risky: #f5b84a;
  --bad: #ff5d6c;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
img { max-width: 100%; }
.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }
main { flex: 1; }

/* header / footer */
.top { position: sticky; top: 0; z-index: 10; background: rgba(14, 15, 19, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -.02em; }
.logo span { color: var(--accent); }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--muted); padding: 8px 10px; border-radius: 10px; font-size: 15px; }
.nav a:hover, .nav a.on { color: var(--text); background: var(--card); }
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; padding: 28px 0 40px; margin-top: 64px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.foot a { color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; text-decoration: none;
  font: 600 16px/1 var(--font); padding: 15px 22px; border-radius: 14px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); transition: transform .12s, opacity .12s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--card); border: 1px solid var(--line); }
.btn.block { width: 100%; }

/* common blocks */
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: clamp(32px, 6vw, 56px); }
h2 { font-size: clamp(24px, 4vw, 34px); }
.muted { color: var(--muted); }
.section { padding-top: 56px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: var(--bg-2); border: 1px solid var(--line); color: var(--muted); }
.pill.free { color: var(--good); border-color: rgba(62, 207, 142, .35); }
.pill.lock { color: var(--risky); border-color: rgba(245, 184, 74, .35); }

/* hero */
.hero { padding: 64px 0 8px; display: grid; gap: 40px; grid-template-columns: 1.1fr .9fr; align-items: center; }
.hero p.lead { font-size: 19px; color: var(--muted); max-width: 520px; margin: 0 0 28px; }
.hero .cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero .note { font-size: 14px; color: var(--muted); }
.phone { background: var(--bg-2); border: 1px solid var(--line); border-radius: 28px; padding: 18px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
@media (max-width: 820px) { .hero { grid-template-columns: 1fr; padding-top: 36px; } }

.steps { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); }
.steps .num { font-size: 13px; color: var(--accent); font-weight: 700; margin-bottom: 6px; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }

/* scenario cards */
.sc { display: flex; flex-direction: column; gap: 10px; text-decoration: none; transition: border-color .15s, transform .15s; }
.sc:hover { border-color: #3a3f4d; transform: translateY(-2px); }
.sc .who { display: flex; align-items: center; gap: 10px; }
.sc h3 { font-size: 19px; margin: 0; }
.sc p { margin: 0; color: var(--muted); font-size: 15px; }
.sc .row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.sc.locked { opacity: .85; }
.ava { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(135deg, #3b2f4a, #5a3a4f); color: #ffd9d2; }

/* pricing */
.prices { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); max-width: 640px; }
.price .sum { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.price.best { border-color: rgba(255, 107, 91, .55); }
@media (max-width: 560px) { .prices { grid-template-columns: 1fr; } }

details { border-bottom: 1px solid var(--line); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { color: var(--muted); margin: 10px 0 0; }

/* ---------- chat ---------- */
.chat-page { max-width: 560px; margin: 0 auto; padding: 0 0 24px; display: flex; flex-direction: column; min-height: calc(100vh - 60px); }
.chat-top { position: sticky; top: 60px; background: var(--bg); z-index: 5; border-bottom: 1px solid var(--line); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.chat-head .who-txt { min-width: 0; }
.chat-head .status { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .name { font-weight: 700; }
.chat-head .status { font-size: 13px; color: var(--muted); }
.chat-head .restart { margin-left: auto; background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 7px 10px; cursor: pointer; font: inherit; font-size: 13px; }
.chat { flex: 1; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: 16px; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; animation: pop .22s ease-out; }
.msg.her { background: var(--her); align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.me { background: var(--me); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.msg + .msg.me, .msg.me + .msg.her { margin-top: 8px; }
.sys { align-self: center; font-size: 13px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); padding: 5px 12px; border-radius: 99px; margin: 10px 0; text-align: center; animation: pop .22s; }
.typing { align-self: flex-start; background: var(--her); border-radius: 18px; border-bottom-left-radius: 6px; padding: 13px 16px; display: flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.dock { position: sticky; bottom: 0; padding: 12px 16px 16px; background: linear-gradient(to top, var(--bg) 75%, transparent); }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice { text-align: left; background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; font: 15px/1.4 var(--font); cursor: pointer; transition: border-color .12s, background .12s; animation: pop .22s; }
.choice:hover { border-color: var(--accent); background: #20232c; }
.hint { font-size: 13px; color: var(--muted); margin: 0 0 8px 2px; }

.verdict { border-radius: 16px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--muted); animation: pop .22s; }
.verdict .label { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.verdict p { margin: 0 0 12px; color: #d6d9e0; font-size: 15px; }
.verdict.good { border-left-color: var(--good); } .verdict.good .label { color: var(--good); }
.verdict.ok { border-left-color: var(--ok); } .verdict.ok .label { color: var(--ok); }
.verdict.risky { border-left-color: var(--risky); } .verdict.risky .label { color: var(--risky); }
.verdict.bad { border-left-color: var(--bad); } .verdict.bad .label { color: var(--bad); }

.intro { margin: 20px 16px; }
.intro p { color: #d6d9e0; }

/* ending */
.ending { margin: 18px 16px 0; display: flex; flex-direction: column; gap: 14px; animation: pop .3s; }
.ending .tone { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.ending .tone.good { color: var(--good); } .ending .tone.mid { color: var(--risky); } .ending .tone.bad { color: var(--bad); }
.bars { display: grid; gap: 10px; }
.bar .lbl { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.bar .track { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.bar .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .8s ease-out; }
.lessons { margin: 0; padding-left: 20px; color: #d6d9e0; }
.lessons li { margin-bottom: 6px; }
.hook { border: 1px solid rgba(255, 107, 91, .5); background: linear-gradient(160deg, #2a1c1f, var(--card) 60%); }
.hook .next { font-size: 13px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.hook .cliff { font-size: 17px; margin: 0 0 16px; }
.actions { display: flex; flex-direction: column; gap: 10px; }

/* forms */
.form { display: grid; gap: 14px; max-width: 520px; }
.input { width: 100%; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; color: var(--text); padding: 14px; font: 16px var(--font); letter-spacing: .05em; }
.input:focus { outline: none; border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.check input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.plan { display: flex; gap: 12px; align-items: center; cursor: pointer; }
.plan input { accent-color: var(--accent); width: 18px; height: 18px; }
.plan .sum { margin-left: auto; font-weight: 800; font-size: 20px; white-space: nowrap; }
.keybox { font: 700 20px/1.3 ui-monospace, Consolas, monospace; letter-spacing: .06em; text-align: center; padding: 16px; background: var(--bg-2); border: 1px dashed var(--accent); border-radius: 12px; word-break: break-all; user-select: all; }
.alert { padding: 12px 14px; border-radius: 12px; background: #2b2215; border: 1px solid #5a4520; color: #f5d9a8; font-size: 14px; }
.err { color: var(--bad); font-size: 14px; min-height: 1em; }
.legal { max-width: 760px; }
.legal h2 { font-size: 22px; margin-top: 28px; }
.legal p, .legal li { color: #d6d9e0; }
.hidden { display: none !important; }
.play .foot { display: none; }
.nav a { white-space: nowrap; }

/* формы аккаунта */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 24px; }
.seg button { border: 0; background: none; color: var(--muted); font: 600 15px var(--font); padding: 11px; border-radius: 10px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--text); }
.link { background: none; border: 0; color: var(--muted); font: 15px var(--font); text-decoration: underline; cursor: pointer; padding: 10px; }
.hint-small { font-size: 13px; color: var(--muted); margin: -6px 0 0; }
.center { text-align: center; }
p.hint-small.center { margin-top: 12px; }
.btn.danger { background: #3a1820; color: #ff9aa5; border: 1px solid #5c2430; }
.btn.disabled { opacity: .45; pointer-events: none; }
.who.big { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.who.big h1 { margin: 0; font-size: 30px; word-break: break-all; }
.who.big .ava { width: 52px; height: 52px; font-size: 22px; }
.card .pill { margin-bottom: 10px; }
.chat-head .back { display: none; text-decoration: none; font-size: 34px; line-height: 40px; color: var(--text); min-width: 36px; height: 44px; margin: 0 -4px 0 -6px; text-align: center; -webkit-tap-highlight-color: transparent; }

/* нижнее меню — только на телефоне */
.tabbar { display: none; }

@media (hover: none) {
  .btn:hover, .sc:hover { transform: none; }
  .choice:hover { border-color: var(--line); background: var(--card); }
  .choice:active { border-color: var(--accent); background: #20232c; }
}

@media (max-width: 767px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .top .wrap { height: 52px; justify-content: center; }
  .nav { display: none; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: rgba(18, 19, 24, .94); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 0; min-height: 50px;
    text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; -webkit-tap-highlight-color: transparent; }
  .tabbar svg { width: 24px; height: 24px; fill: currentColor; }
  .tabbar a.on { color: var(--accent); }

  .foot { margin-top: 40px; padding-bottom: 20px; }
  .foot .wrap { flex-direction: column; gap: 8px; }

  h1 { font-size: 30px; }
  h2 { font-size: 24px; }
  .section { padding-top: 40px; }
  .hero { padding-top: 24px; gap: 28px; }
  .hero p.lead { font-size: 17px; margin-bottom: 20px; }
  .hero .cta { flex-direction: column; align-items: stretch; text-align: center; }
  .phone { border-radius: 22px; padding: 12px; }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .btn { min-height: 50px; }
  .plan .sum { font-size: 18px; }
  .keybox { font-size: 17px; }

  /* чат на весь экран, как в мессенджере */
  .play { padding-bottom: 0; }
  .play .top, .play .tabbar { display: none; }
  .chat-page { min-height: 100vh; min-height: 100dvh; }
  .chat-top { top: 0; padding-top: env(safe-area-inset-top); }
  .chat-head { padding: 10px 12px; }
  .types { padding: 0 12px 8px; }
  .goalbar { padding: 0 12px 10px; }
  .chat-head .back { display: block; }
  .chat { padding: 14px 12px 8px; }
  .msg { max-width: 86%; font-size: 15.5px; }
  .dock { padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); }
  .choice { padding: 14px; font-size: 15px; min-height: 48px; }
  .intro, .ending { margin-left: 12px; margin-right: 12px; }
}
/* ---------- сценарии v2: типажи, цель, разбор, приглашение ---------- */
.types { display: flex; gap: 6px; padding: 0 16px 10px; overflow-x: auto; scrollbar-width: none; }
.types::-webkit-scrollbar { display: none; }
.types button { flex: none; border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font: 600 14px var(--font);
  padding: 0 14px; min-height: 36px; border-radius: 99px; cursor: pointer; white-space: nowrap; }
.types button.on { color: var(--text); border-color: var(--accent); background: #2a1c1f; }
.types button .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--good); margin-left: 6px; vertical-align: middle; }

.goalbar { padding: 0 16px 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.goalbar .goal { grid-column: 1 / -1; font-size: 13px; color: #d6d9e0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goalbar .goal b { color: var(--accent); font-weight: 700; }
.meter .lbl { display: flex; justify-content: space-between; margin-bottom: 3px; }
.meter .track { height: 6px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.meter .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .6s ease-out; }
.meter .d { font-weight: 700; margin-left: 4px; }
.meter .d.up { color: var(--good); } .meter .d.down { color: var(--bad); }

.profile { margin: 0 16px 6px; }
.profile .photos { display: grid; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.profile .photos li { background: var(--bg-2); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; font-size: 14px; color: #d6d9e0; }
.profile .photos li::before { content: '📷 '; }
.profile .bio { font-size: 15px; color: #d6d9e0; margin: 6px 0 0; white-space: pre-wrap; }

.picker { margin: 20px 16px; display: grid; gap: 10px; }
.picker .tcard { text-align: left; font: inherit; color: var(--text); cursor: pointer; display: grid; gap: 4px; }
.picker .tcard b { font-size: 17px; }
.picker .tcard span { color: var(--muted); font-size: 14px; }
.picker .tcard:hover { border-color: var(--accent); }

.verdict { max-height: 62vh; overflow-y: auto; }
.verdict .why { color: #d6d9e0; font-size: 15px; margin: 0 0 10px; }
.verdict .outs { margin: 0 0 10px; padding-left: 18px; color: var(--muted); font-size: 14px; }
.verdict .outs li { margin-bottom: 4px; }
.verdict .concept, .note .concept { display: inline-block; font-size: 13px; color: var(--accent); margin: 0 0 12px; }
.verdict .deltas { display: flex; gap: 12px; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.verdict .deltas .up { color: var(--good); } .verdict .deltas .down { color: var(--bad); }

.note { align-self: stretch; margin: 6px 0; border: 0; padding: 0; font-size: 14px; }
.note summary { list-style: none; font-weight: 600; font-size: 13px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line);
  border-left: 3px solid var(--muted); border-radius: 10px; padding: 7px 10px; }
.note summary::-webkit-details-marker { display: none; }
.note.good summary { border-left-color: var(--good); } .note.ok summary { border-left-color: var(--ok); }
.note.risky summary { border-left-color: var(--risky); } .note.bad summary { border-left-color: var(--bad); }
.note .body { padding: 10px 12px 2px; color: #d6d9e0; }
.note .body p { margin: 0 0 8px; color: #d6d9e0; }
.note .body ul { margin: 0 0 8px; padding-left: 18px; color: var(--muted); }

.ask { width: 100%; margin-top: 10px; min-height: 48px; border-radius: 14px; border: 1px dashed var(--accent); background: transparent;
  color: var(--accent); font: 600 15px var(--font); cursor: pointer; }
.ask:hover { background: #2a1c1f; }
.age-gate { margin: 20px 16px; }
.kseg { grid-template-columns: repeat(4, 1fr); margin: 20px 0; }
.kseg button { padding: 11px 4px; font-size: 14px; }
.klist { display: grid; gap: 12px; }
.kitem h3 { margin: 6px 0 8px; font-size: 19px; }
.kitem p { margin: 0 0 10px; color: #d6d9e0; }
.kitem .use { color: var(--muted); margin: 0; }
.kitem:target { border-color: var(--accent); }
.kitem { scroll-margin-top: 76px; }

/* тренажёр ответов */
.tr-topics { padding: 0; margin: 14px 0 6px; }
.tr-stats { font-size: 13px; color: var(--muted); margin: 6px 0 14px; }
.tr-card h3 { margin: 4px 0 6px; font-size: 19px; }
.tr-context { color: #d6d9e0; margin: 0 0 12px; font-size: 15px; }
.tr-chat { display: flex; flex-direction: column; gap: 6px; }
.tr-me { margin: 14px 0 12px auto; width: fit-content; }
.tr-verdict { margin-bottom: 12px; max-height: none; }
.tr-tip { color: #d6d9e0; font-size: 15px; margin: 4px 0 14px; }
.tr-input { margin: 14px 0 8px; resize: vertical; min-height: 84px; letter-spacing: 0; font: 16px/1.4 var(--font); }
.tr-ex { margin: 0 0 12px; }
.tr-checks { display: grid; gap: 12px; }
.tr-checks .check { font-size: 15px; color: #d6d9e0; }
#root > .btn { margin-top: 4px; }
#root .hint-small { margin: 0 0 12px; }

.narrow { max-width: 640px; }
.narrower { max-width: 560px; }
.phone .chat { padding: 4px; }
.form.wide { max-width: none; }
.section.tight { padding-top: 32px; }
.mt { margin-top: 20px; }
.small { font-size: 13px; }
