:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --text: #1c1d21;
  --muted: #5d6170;
  --line: #e4e2da;
  --accent: #2b5fd9;
  --accent-soft: #e8eefc;
  --ok: #1b7f3b;
  --radius: 14px;
  --max: 1040px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111317;
    --surface: #1a1d23;
    --text: #eceef2;
    --muted: #a3a8b5;
    --line: #2a2e37;
    --accent: #7aa2ff;
    --accent-soft: #1d2740;
    --ok: #57c67a;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

header.top {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  position: sticky; top: 0; backdrop-filter: blur(8px); z-index: 10;
}
header.top .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 18px; font-weight: 700;
}
nav.links { margin-left: auto; display: flex; gap: 18px; font-size: 15px; }
nav.links a { color: var(--muted); text-decoration: none; }
nav.links a:hover { color: var(--text); }

.hero { padding: 72px 0 40px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.1; margin: 0 0 18px; letter-spacing: -0.02em; max-width: 16ch; }
.hero p.lead { font-size: 20px; color: var(--muted); max-width: 60ch; margin: 0 0 28px; }
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 10px; background: var(--accent); color: #fff;
  text-decoration: none; font-weight: 600;
}
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); margin-left: 8px; }

.chat {
  margin-top: 40px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; max-width: 640px; display: grid; gap: 12px;
}
.msg { padding: 10px 14px; border-radius: 12px; max-width: 85%; font-size: 15.5px; }
.msg.me { background: var(--accent); color: #fff; justify-self: end; border-bottom-right-radius: 4px; }
.msg.bot { background: var(--accent-soft); border-bottom-left-radius: 4px; }

section { padding: 48px 0; }
section h2 { font-size: 30px; margin: 0 0 8px; letter-spacing: -0.01em; }
section p.sub { color: var(--muted); margin: 0 0 28px; max-width: 62ch; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.card .ico { font-size: 22px; margin-bottom: 8px; }

.steps { counter-reset: s; display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 16px 58px; position: relative; }
.steps li::before {
  content: counter(s); position: absolute; left: 16px; top: 15px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 15px;
}

.note { border-left: 3px solid var(--ok); padding: 4px 0 4px 16px; color: var(--muted); }

footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 14.5px; margin-top: 40px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; }
footer a { color: var(--muted); }

/* документы: политика, условия */
article.doc { max-width: 760px; padding: 48px 0 24px; }
article.doc h1 { font-size: clamp(26px, 7vw, 36px); line-height: 1.15; margin: 0 0 6px; hyphens: auto; overflow-wrap: anywhere; }
article.doc { overflow-wrap: anywhere; }
main { overflow-x: hidden; }
article.doc .meta { color: var(--muted); margin: 0 0 28px; font-size: 15px; }
article.doc h2 { font-size: 22px; margin: 34px 0 8px; }
article.doc h3 { font-size: 18px; margin: 22px 0 6px; }
article.doc table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 10px 0; display: block; overflow-x: auto; }
article.doc th, article.doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
article.doc th { background: var(--surface); }
article.doc code { background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; font-size: 14px; word-break: break-all; }
.lang { display: inline-flex; gap: 8px; font-size: 14px; margin-bottom: 18px; }
.lang a { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 56px 0 0; }

@media (max-width: 640px) {
  nav.links { gap: 12px; font-size: 14px; }
  nav.links a.hide-sm { display: none; }
  .hero { padding: 44px 0 24px; }
  .btn.ghost { margin: 10px 0 0; }
}
