/* Стиль "месенджер": білий фон, синій акцент, знайома поведінка чату. */
:root {
  --bg: #ffffff;
  --page: #eef0f3;
  --soft: #f0f2f5;
  --tint: #f3f7ff;
  --tint-line: #e0e9ff;
  --ink: #0f1419;
  --muted: #65707b;
  --line: #e9ecef;
  --accent: #2563ff;
  --accent-dark: #1d4fd8;
  --ok: #0b7a55;
  --ok-soft: #e4f6ee;
  --warn-bg: #fff4ed;
  --warn-line: #f5b98f;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 Onest, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0 0 10px; line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; }
h1 { font-size: clamp(36px, 6vw, 60px); font-weight: 800; }
h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0 0 12px; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }

button, .button { font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 20px; border: 0; border-radius: 99px; background: var(--soft); color: var(--ink); cursor: pointer; text-decoration: none; }
button.primary, .button.primary { background: var(--accent); color: #fff; }
button.primary:hover, .button.primary:hover { background: var(--accent-dark); }
button.link { background: none; color: var(--accent); min-height: 36px; padding: 4px 6px; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.full { width: 100%; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row > * { flex: 1 1 140px; }

label { display: block; font-weight: 600; font-size: 14px; }
input, textarea, select { display: block; width: 100%; margin-top: 6px; padding: 12px 16px; border: 1px solid #dde1e6; border-radius: 18px; background: var(--bg); color: var(--ink); font: 400 16px/1.45 Onest, system-ui, sans-serif; }
textarea { resize: vertical; min-height: 76px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.fields .wide { grid-column: 1 / -1; }
summary { cursor: pointer; }

.avatar { flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--c, var(--accent)); color: #fff; font-weight: 700; font-size: 20px; }
.small-avatar { width: 40px; height: 40px; font-size: 16px; }
.who { display: flex; align-items: center; gap: 12px; }
.who .avatar { width: 44px; height: 44px; font-size: 17px; }
.who-text { min-width: 0; flex: 1; line-height: 1.3; }
.who-text b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-text span { display: block; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.bubble { width: fit-content; max-width: 82%; padding: 11px 15px; border-radius: 20px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.42; animation: rise .22s ease-out; }
.bubble.hr { background: var(--soft); border-bottom-left-radius: 5px; }
.bubble.user { background: var(--accent); color: #fff; margin-left: auto; border-bottom-right-radius: 5px; }
.bubble.typing { color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; scroll-behavior: auto !important; } }

.chip { display: inline-block; font-size: 13px; font-weight: 600; border-radius: 99px; padding: 5px 12px; background: var(--soft); color: var(--muted); }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: 24px; padding: 20px; }
.featured { border-color: var(--accent); border-width: 2px; }
.checks { list-style: none; padding: 0; margin: 0 0 14px; }
.checks li { padding: 5px 0 5px 28px; position: relative; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 800; }
.checks li.no { color: var(--muted); }
.checks li.no::before { content: "–"; color: var(--muted); }

.ring { --value: 0; width: 140px; height: 140px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--value) * 1%), var(--soft) 0); }
.ring > div { width: 118px; height: 118px; border-radius: 50%; background: var(--bg); display: grid; place-content: center; text-align: center; }
.ring b { font-size: 44px; line-height: 1; font-weight: 800; letter-spacing: -.04em; }

/* Слабка фраза людини та краща замість неї, як повідомлення в чаті. */
.fix { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.fix .bubble { margin-left: auto; background: var(--soft); color: var(--muted); border-radius: 20px 20px 5px 20px; }
.fix .why { font-size: 14px; color: var(--muted); margin: 0; }
.fix .better { background: var(--tint); border: 1px solid var(--tint-line); border-radius: 20px 20px 20px 5px; padding: 11px 15px; margin: 0; }
.fix .better::before { content: "Краще сказати"; display: block; font-size: 12px; font-weight: 700; color: var(--accent); }
.rubric { display: flex; flex-wrap: wrap; gap: 8px; }
.rubric .chip.ok { background: var(--ok-soft); color: var(--ok); }

.banner { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 16px; padding: 12px 14px; font-size: 14px; margin: 10px 14px; }

/* ---------- Апка ---------- */
body.app { background: var(--page); }
.shell { position: relative; display: flex; flex-direction: column; width: min(480px, 100%); height: 100vh; height: 100dvh; margin-inline: auto; background: var(--bg); overflow: hidden; }
@media (min-width: 560px) { .shell { height: calc(100dvh - 32px); margin-top: 16px; border-radius: 28px; box-shadow: 0 24px 60px -28px rgb(15 20 25 / 35%); } }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.head { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 18px 12px; border-bottom: 1px solid var(--line); min-height: 69px; }
.head h1 { flex: 1; margin: 0; font-size: 28px; }
.head h2 { margin: 0; font-size: 20px; }
.back { background: none; color: var(--accent); font-size: 32px; font-weight: 400; line-height: 1; min-height: 40px; padding: 0 6px 4px 0; }
.body { flex: 1; min-height: 0; overflow-y: auto; }
.pad { padding: 16px 18px; }
.note { padding: 18px; margin: 0; font-size: 13px; color: var(--muted); text-align: center; }

.row-item, .own > summary { display: flex; width: 100%; align-items: center; gap: 14px; padding: 13px 18px; text-align: left; background: none; border-radius: 0; font-weight: 400; }
.row-item:hover, .own > summary:hover { background: #f7f8fa; }
.row-text { flex: 1; min-width: 0; }
.row-text b { display: block; font-weight: 700; }
.row-text span { display: block; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item time { align-self: flex-start; font-size: 12px; color: var(--muted); padding-top: 3px; }
.own > summary { list-style: none; }
.own > summary::-webkit-details-marker { display: none; }
.own > .fields, .own > p { padding-inline: 18px; }

.tabs { display: flex; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { flex: 1; background: none; border-radius: 0; min-height: 60px; font-size: 14px; color: var(--muted); }
.tabs button[aria-current="page"] { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }

.pin { display: flex; justify-content: space-between; gap: 12px; padding: 10px 18px; background: var(--tint); border-bottom: 1px solid var(--tint-line); font-size: 14px; font-weight: 600; }
.pin .muted { font-weight: 400; margin-left: auto; }
#log { display: flex; flex-direction: column; gap: 6px; padding: 16px; }
#log .bubble { flex: none; }
.composer { display: flex; align-items: flex-end; gap: 8px; margin: 8px 12px calc(14px + env(safe-area-inset-bottom)); padding: 5px 5px 5px 18px; border: 1px solid #dde1e6; border-radius: 26px; }
.composer:focus-within { border-color: var(--accent); }
.composer textarea { flex: 1; margin: 0; padding: 8px 0; min-height: 40px; max-height: 130px; border: 0; outline: 0; resize: none; field-sizing: content; }
.send { flex: none; width: 40px; height: 40px; min-height: 40px; padding: 0; border-radius: 50%; background: var(--accent); color: #fff; font-size: 20px; }

.verdict { text-align: center; }
.verdict h2 { font-size: 24px; }

#status { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 9px 16px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 14px; text-align: center; z-index: 5; pointer-events: none; }
#status:empty { display: none; }
#help { position: absolute; left: 0; right: 0; top: 76px; z-index: 6; }

@media (max-width: 360px) { .head { gap: 8px; padding-inline: 12px; } .small-avatar { display: none; } }

/* ---------- Лендинг ---------- */
.wrap { width: min(1080px, 100% - 36px); margin-inline: auto; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 800; font-size: 21px; letter-spacing: -.02em; text-decoration: none; }
.brand svg { width: 34px; height: 34px; }
.hero { display: grid; gap: 36px; padding: 24px 0 64px; align-items: center; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr 440px; padding-top: 56px; gap: 56px; } }
.lead { font-size: 19px; color: var(--muted); max-width: 44ch; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--tint); border-radius: 99px; padding: 4px 12px; margin-bottom: 14px; }
#try { box-shadow: 0 30px 70px -34px rgb(15 20 25 / 40%); border-radius: 30px; }
#try .who { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
#try details summary { color: var(--accent); font-weight: 600; font-size: 14px; }
.section { padding: 44px 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.section .grid > .card, .steps > li { background: #f7f8fa; border-color: transparent; }
.section .grid > .featured { background: var(--bg); border-color: var(--accent); }
.section .grid > .card[aria-label] { background: var(--bg); border-color: var(--line); }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; margin-bottom: 14px; }
.price { font-size: 36px; font-weight: 800; margin: 0 0 8px; }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { font-weight: 600; }
.faq details p { margin: 10px 0 0; color: var(--muted); }
footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0 40px; }
