:root {
  --bg: #0d0f14;
  --bg-elev: #14171f;
  --bg-card: #1a1e28;
  --border: #262a36;
  --text: #e6e8ee;
  --text-dim: #8b90a0;
  --accent: #7c5cff;
  --accent-2: #a48cff;
  --accent-soft: #7c5cff20;
  --code-bg: #10131a;
  --link: #a48cff;
  --link-hover: #c9b7ff;
  --success: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, "Segoe UI", Inter, Roboto, sans-serif; line-height: 1.6; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
.layout { display: flex; min-height: 100vh; }
aside {
  width: 280px; background: var(--bg-elev); border-right: 1px solid var(--border);
  padding: 24px 20px; position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.brand-logo, .brand-logo-img { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: grid; place-items: center; font-size: 22px; font-weight: 700; object-fit: cover; }
.brand-name { font-size: 18px; font-weight: 700; }
.brand-sub { font-size: 12px; color: var(--text-dim); }
nav ul { list-style: none; padding: 0; margin: 0; }
nav li { margin: 2px 0; }
nav a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text-dim); font-size: 14px; }
nav a:hover { background: var(--accent-soft); color: var(--text); text-decoration: none; }
nav a.active { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
nav .section-title { padding: 12px 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); }
main { flex: 1; padding: 40px 60px; max-width: 900px; }
h1 { font-size: 34px; margin: 0 0 8px; letter-spacing: -0.5px; }
h2 { font-size: 24px; margin: 40px 0 12px; padding-top: 8px; border-top: 1px solid var(--border); }
h3 { font-size: 18px; margin: 24px 0 8px; color: var(--accent-2); }
p { color: #cfd2dc; }
code { background: var(--code-bg); padding: 2px 6px; border-radius: 4px; font-size: 13px; color: #ffd580; font-family: "JetBrains Mono", Consolas, monospace; }
pre { background: var(--code-bg); padding: 14px 16px; border-radius: 10px; overflow-x: auto; border: 1px solid var(--border); }
pre code { background: transparent; padding: 0; color: var(--text); }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 20px 22px; margin: 16px 0; }
.card-accent { border-left: 3px solid var(--accent); }
.warn { border-left: 3px solid var(--warn); background: #fbbf2410; }
.danger { border-left: 3px solid var(--danger); background: #f8717110; }
.success { border-left: 3px solid var(--success); background: #4ade8010; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: var(--accent-soft); color: var(--accent-2); margin-right: 4px; }
.toc { background: var(--bg-card); border-radius: 12px; padding: 16px 22px; margin: 20px 0 30px; border: 1px solid var(--border); }
.toc h3 { margin-top: 0; color: var(--text); }
.toc ol { padding-left: 22px; margin: 8px 0 0; }
.toc a { color: var(--link); }
.cmd-list { display: grid; grid-template-columns: 1fr; gap: 8px; }
.cmd { display: flex; align-items: flex-start; gap: 14px; padding: 10px 14px; background: var(--bg-card); border-radius: 8px; border: 1px solid var(--border); }
.cmd code { min-width: 180px; flex-shrink: 0; }
.cmd .desc { color: #cfd2dc; font-size: 14px; }
.hero { padding: 30px 0 10px; }
.hero .lead { font-size: 18px; color: var(--text-dim); }
.hero-flex { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.hero-logo { width: 140px; height: 140px; border-radius: 24px; box-shadow: 0 8px 30px rgba(124,92,255,.3); object-fit: cover; flex-shrink: 0; }
@media (max-width: 600px) {
  .hero-logo { width: 96px; height: 96px; border-radius: 18px; }
}
.btn { display: inline-block; padding: 10px 22px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; margin-top: 12px; }
.btn:hover { background: var(--accent-2); text-decoration: none; color: #fff; }
footer { margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 13px; }
/* ── Telegram chat mockup ─────────────────────────────────────── */
.tg-chat {
  background: linear-gradient(135deg, #4a5fc8 0%, #6b4fc4 100%);
  border-radius: 18px;
  padding: 18px 14px;
  margin: 20px 0;
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
.tg-msg { display: flex; margin: 8px 0; gap: 8px; align-items: flex-end; }
.tg-msg.out { justify-content: flex-end; }
.tg-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #7c5cff, #a48cff);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  flex-shrink: 0; object-fit: cover;
}
img.tg-avatar { padding: 0; }
.tg-bubble {
  background: #fff; color: #000; padding: 8px 12px 6px; border-radius: 14px;
  max-width: 75%; font-size: 14px; line-height: 1.4; position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.tg-msg.out .tg-bubble { background: #d6f5c8; color: #000; }
.tg-bubble .tg-name { color: #d9407f; font-weight: 600; font-size: 13px; display: block; margin-bottom: 2px; }
.tg-bubble .tg-time { color: #7d8590; font-size: 11px; float: right; margin: 4px 0 0 8px; }
.tg-bubble .tg-check { color: #4a9eff; margin-left: 2px; }
.tg-bubble b { color: #2d7dd2; }
.tg-bubble .ok { color: #2e9e3e; }
.tg-bubble a { color: #2d7dd2; }
/* ── Mobile top bar (hidden desktop) ─────────────────────── */
.topbar { display: none; }
.scrim { display: none; }

@media (max-width: 900px) {
  .topbar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 50;
    background: var(--bg-elev); border-bottom: 1px solid var(--border);
    padding: 10px 14px;
  }
  .hamburger {
    background: transparent; border: 1px solid var(--border); color: var(--text);
    font-size: 20px; line-height: 1; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  }
  .topbar-logo { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; }
  .topbar-title { font-weight: 700; font-size: 16px; }

  .layout { flex-direction: column; }
  aside {
    position: fixed; top: 0; left: 0; height: 100vh; width: 280px;
    transform: translateX(-100%); transition: transform .25s ease;
    z-index: 100; box-shadow: 4px 0 20px rgba(0,0,0,.5);
  }
  body.nav-open aside { transform: translateX(0); }
  body.nav-open .scrim {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 90;
  }

  main { padding: 20px 16px; max-width: 100%; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; margin-top: 28px; }
  h3 { font-size: 16px; }
  p, li { font-size: 15px; }
  pre { font-size: 12px; padding: 10px 12px; }
  .cmd { flex-direction: column; gap: 4px; padding: 10px 12px; }
  .cmd code { min-width: 0; }
  .tg-chat { padding: 12px 8px; border-radius: 14px; }
  .tg-bubble { max-width: 85%; font-size: 13px; }
  .toc { padding: 12px 18px; }
}
