@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

    :root {
      --bg:           #f0f4ff;
      --surface:      #ffffff;
      --primary:      #8bb8f8;
      --primary-dark: #5a91e8;
      --secondary:    #b8e0d2;
      --accent:       #ffd6e0;
      --text:         #2d3436;
      --text-muted:   #7f8c8d;
      --border:       #e0e6f0;
      --success:      #c8f7c5;
      --danger:       #ffb3ba;
      --radius:       14px;
      --shadow:       0 2px 16px rgba(120,160,220,0.12);
      --font:         'DM Sans', sans-serif;
      --mono:         'DM Mono', monospace;
    }

    body {
      font-family: var(--font);
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      font-size: 15px;
      line-height: 1.5;
    }

    /* ── TOP BAR ── */
    .top-bar {
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      padding: 0 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      height: 56px;
      position: sticky;
      top: 0;
      z-index: 100;
      box-shadow: 0 1px 8px rgba(120,160,220,0.08);
    }
    .top-bar .logo {
      font-weight: 600;
      font-size: 16px;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .top-bar-right {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .lang-selector {
      display: flex;
      align-items: center;
      gap: 4px;
    }
    .lang-btn {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 5px 10px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 500;
      color: var(--text-muted);
      text-decoration: none;
      border: 1px solid transparent;
      transition: background 0.15s, color 0.15s;
    }
    .lang-btn:hover { background: var(--bg); color: var(--text); }
    .lang-btn.active {
      background: var(--primary);
      color: #fff;
      border-color: var(--primary-dark);
    }
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      padding: 8px 16px;
      border: none;
      border-radius: 10px;
      font-weight: 600;
      font-size: 13px;
      cursor: pointer;
      text-decoration: none;
      font-family: var(--font);
      transition: background 0.15s;
    }
    .btn-secondary { background: var(--secondary); color: #1a3a2a; }
    .btn-secondary:hover { background: #8fcfbc; }

    /* ── LAYOUT ── */
    .guide-wrap {
      max-width: 820px;
      margin: 0 auto;
      padding: 32px 20px 80px;
    }

    /* ── HERO ── */
    .hero {
      text-align: center;
      padding: 44px 0 36px;
      border-bottom: 1px solid var(--border);
      margin-bottom: 40px;
    }
    .hero h1 {
      font-size: 30px;
      font-weight: 700;
      letter-spacing: -0.02em;
      margin-bottom: 12px;
      line-height: 1.3;
    }
    .hero p {
      color: var(--text-muted);
      font-size: 15px;
      max-width: 480px;
      margin: 0 auto 22px;
      line-height: 1.7;
    }
    .pills {
      display: flex;
      gap: 10px;
      justify-content: center;
      flex-wrap: wrap;
    }
    .pill {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 20px;
      padding: 7px 18px;
      font-size: 13px;
      font-weight: 500;
      color: var(--text);
      box-shadow: var(--shadow);
    }

    /* ── TOC ── */
    .toc {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 20px 24px;
      margin-bottom: 40px;
      box-shadow: var(--shadow);
    }
    .toc h3 {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      margin-bottom: 14px;
    }
    .toc ol {
      padding-left: 18px;
    }
    @media (min-width: 768px) {
      .toc ol {
        column-count: 2;
        column-gap: 24px;
      }
    }
    .toc li { margin-bottom: 6px; font-size: 13px; }
    .toc a { color: var(--primary-dark); text-decoration: none; }
    .toc a:hover { text-decoration: underline; }

    /* ── SECTIONS ── */
    .section { margin-bottom: 56px; }

    .section-title {
      font-size: 22px;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 6px;
      padding-bottom: 12px;
      border-bottom: 2px solid var(--border);
    }
    .section-sub {
      font-size: 14px;
      color: var(--text-muted);
      margin: 6px 0 20px;
      line-height: 1.65;
    }

    .subsection { margin-top: 28px; }
    .sub-label {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      margin-bottom: 10px;
    }
    .platform-label {
      font-size: 13px;
      font-weight: 700;
      color: var(--text);
      margin: 22px 0 10px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .platform-label:first-child { margin-top: 0; }

    /* ── TWO COLUMN ── */
    .two-col {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 28px;
      align-items: start;
    }

    /* ── FEATURE CARD ── */
    .feature-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 18px 22px;
      margin-bottom: 24px;
      display: flex;
      gap: 16px;
      align-items: flex-start;
      box-shadow: var(--shadow);
    }
    .feature-card .fc-icon { font-size: 28px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
    .feature-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
    .feature-card p { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin: 0; }

    /* ── TIP BOX ── */
    .tip-box {
      background: #eef5ff;
      border-left: 3px solid var(--primary);
      border-radius: 0 8px 8px 0;
      padding: 11px 16px;
      font-size: 13px;
      color: var(--text);
      line-height: 1.65;
      margin: 14px 0;
    }
    .tip-box strong { color: var(--primary-dark); }

    /* ── TABLES ── */
    .data-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 13px;
      margin-bottom: 14px;
      background: var(--surface);
      border-radius: var(--radius);
      overflow: hidden;
      box-shadow: var(--shadow);
      border: 1px solid var(--border);
    }
    .data-table th {
      text-align: left;
      padding: 9px 14px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--text-muted);
      background: var(--bg);
      border-bottom: 1px solid var(--border);
    }
    .data-table td {
      padding: 9px 14px;
      border-bottom: 1px solid var(--border);
      vertical-align: top;
      line-height: 1.5;
    }
    .data-table tr:last-child td { border-bottom: none; }
    .data-table code {
      background: #eef5ff;
      color: var(--primary-dark);
      padding: .1em .35em;
      border-radius: 4px;
      font-family: var(--mono);
      font-size: .84em;
    }

    /* ── ACTION BADGES ── */
    .badge {
      display: inline-block;
      padding: 2px 9px;
      border-radius: 20px;
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .b-expense  { background: #ffe0e4; color: #c0392b; }
    .b-income   { background: #d5f5e3; color: #1e8449; }
    .b-transfer { background: #d6eaff; color: #1a5276; }
    .b-invest   { background: #fdebd0; color: #935116; }
    .b-withdraw { background: #e8daef; color: #6c3483; }
    .b-adjust   { background: #fef9e7; color: #7d6608; }

    /* ── TELEGRAM CHAT ── */
    .tg-chat {
      border-radius: var(--radius);
      overflow: hidden;
      box-shadow: var(--shadow);
      margin: 4px 0 14px;
      border: 1px solid var(--border);
      max-width: 420px;
    }
    .tg-header {
      background: #527da3;
      padding: 10px 14px;
      display: flex;
      align-items: center;
      gap: 10px;
      color: white;
    }
    .tg-header .av {
      width: 32px; height: 32px;
      border-radius: 50%;
      background: #8bb8f8;
      display: flex; align-items: center; justify-content: center;
      font-size: 15px;
      flex-shrink: 0;
    }
    .tg-header .bn { font-weight: 600; font-size: 14px; line-height: 1.2; }
    .tg-header .bs { font-size: 11px; opacity: 0.72; }
    .tg-body {
      background: #dce8f2;
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .tg-msg {
      max-width: 88%;
      padding: 8px 12px;
      border-radius: 14px;
      font-size: 13px;
      line-height: 1.55;
      position: relative;
    }
    .tg-msg pre {
      font-family: var(--mono);
      font-size: 12px;
      white-space: pre-wrap;
      word-break: break-word;
      margin: 0;
      line-height: 1.6;
      background: transparent;
      border: none;
      padding: 0;
    }
    .tg-msg.bot {
      background: var(--surface);
      color: var(--text);
      border-radius: 4px 14px 14px 14px;
      align-self: flex-start;
      box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    }
    .tg-msg.user {
      background: #5a91e8;
      color: white;
      border-radius: 14px 4px 14px 14px;
      align-self: flex-end;
      box-shadow: 0 1px 2px rgba(0,0,0,0.10);
    }
    .tg-msg .ts {
      font-size: 10px;
      opacity: 0.55;
      margin-top: 4px;
      text-align: right;
    }
    .tg-photo-thumb {
      background: #4a7fc4;
      border-radius: 8px;
      padding: 9px 12px;
      font-size: 12px;
      color: rgba(255,255,255,0.9);
      margin-bottom: 4px;
    }
    .tg-photo-thumb span { font-size: 11px; opacity: 0.75; display: block; margin-top: 2px; }

    /* ── STEPS ── */
    .steps { list-style: none; padding: 0; margin: 10px 0; }
    .steps li {
      position: relative;
      padding-left: 33px;
      margin-bottom: 9px;
      font-size: 14px;
      line-height: 1.6;
      min-height: 24px;
    }
    .steps li .n {
      background: var(--primary-dark);
      color: white;
      width: 22px; height: 22px;
      border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 11px; font-weight: 700;
      position: absolute;
      left: 0;
      top: 1px;
    }

    /* ── UI FRAME (mockup) ── */
    .ui-frame {
      border-radius: var(--radius);
      overflow: hidden;
      box-shadow: var(--shadow);
      border: 1px solid var(--border);
      margin: 4px 0 14px;
      background: var(--surface);
      max-width: 420px;
    }
    .ui-frame-bar {
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      padding: 9px 14px;
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
    }
    .dots { display: flex; gap: 5px; }
    .dot { width: 10px; height: 10px; border-radius: 50%; }
    .dot.r { background: #ffb3ba; }
    .dot.y { background: #ffd6a0; }
    .dot.g { background: #c8f7c5; }
    .ui-frame-body { padding: 18px; background: var(--bg); }

    /* ── MOCK APP TOP BAR ── */
    .mock-app-bar {
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      padding: 0 12px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      height: 44px;
      margin: -18px -18px 14px;
    }
    .mock-app-logo { font-weight: 600; font-size: 13px; }
    .mock-app-nav { display: flex; gap: 2px; }
    .mock-app-nav button {
      background: none;
      border: none;
      padding: 5px 8px;
      border-radius: 6px;
      font-size: 11px;
      font-weight: 500;
      color: var(--text-muted);
      cursor: default;
      font-family: var(--font);
    }
    .mock-app-nav button.on {
      background: var(--primary);
      color: #1a2a4a;
      font-weight: 600;
    }

    /* ── MOCK MODE BAR ── */
    .mock-mode-bar {
      display: flex;
      gap: 5px;
      margin: 0 0 14px;
      flex-wrap: wrap;
    }
    .mock-mode-btn {
      padding: 6px 11px;
      border-radius: 8px;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-muted);
      background: var(--surface);
      border: 1px solid var(--border);
      cursor: default;
    }
    .mock-mode-btn.on {
      background: var(--primary);
      color: #1a2a4a;
      font-weight: 600;
      border-color: var(--primary);
    }

    /* mock form widgets */
    .mf { margin-bottom: 10px; }
    .ml {
      display: block; font-size: 11px; font-weight: 700;
      text-transform: uppercase; letter-spacing: 0.06em;
      color: var(--text-muted); margin-bottom: 4px;
    }
    .mi {
      width: 100%; padding: 9px 12px;
      border: 1.5px solid var(--border); border-radius: 10px;
      background: var(--surface); color: var(--text);
      font-size: 14px; font-family: var(--font);
    }
    .mi.on { border-color: var(--primary); background: #fff; }
    .ms {
      width: 100%; padding: 9px 12px;
      border: 1.5px solid var(--primary); border-radius: 10px;
      background: #fff; color: var(--text);
      font-size: 14px; font-family: var(--font);
    }
    .mb {
      width: 100%; padding: 11px;
      border: none; border-radius: 10px;
      font-size: 14px; font-weight: 600;
      font-family: var(--font); cursor: default; margin-top: 6px;
    }
    .mb.p { background: var(--primary-dark); color: #fff; }
    .mb.s { background: var(--primary); color: #1a2a4a; }
    .mock-drop {
      border: 2px dashed var(--primary);
      border-radius: var(--radius);
      padding: 22px 16px;
      text-align: center;
      background: #eef5ff;
      margin-bottom: 12px;
    }
    .mock-drop .di { font-size: 26px; display: block; margin-bottom: 7px; }
    .mock-drop .dl { font-size: 13px; color: var(--text-muted); }
    .mock-drop .df { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
    .mock-check {
      display: flex; align-items: center; gap: 8px;
      font-size: 13px; margin-bottom: 6px;
    }
    .mock-check .box {
      width: 16px; height: 16px; border-radius: 4px;
      border: 1.5px solid var(--border);
      background: var(--surface); flex-shrink: 0;
    }
    .mock-check .box.on {
      background: var(--primary-dark);
      border-color: var(--primary-dark);
    }

    /* ── BESPOKE ICONS (mirror web app sprite) ── */
    .icon {
      width: 1.05em;
      height: 1.05em;
      display: inline-block;
      vertical-align: -0.16em;
      flex-shrink: 0;
    }
    .mock-mode-btn .icon { width: 1.15em; height: 1.15em; vertical-align: -0.22em; margin-right: 3px; }
    .mock-app-nav button .icon { margin-right: 2px; }
    .data-table td .icon { vertical-align: -0.18em; }

    /* ── INLINE CODE ── */
    code {
      background: #eef5ff;
      color: var(--primary-dark);
      padding: .15em .4em;
      border-radius: 5px;
      font-family: var(--mono);
      font-size: .87em;
    }
    pre {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 14px 16px;
      overflow-x: auto;
      margin: 8px 0 14px;
      font-size: 13px;
      line-height: 1.55;
    }
    pre code { background: none; padding: 0; color: var(--text); }

    /* ── TYPOGRAPHY ── */
    p { margin: 0 0 10px; line-height: 1.7; }
    ul, ol { padding-left: 22px; margin-bottom: 10px; }
    li { margin-bottom: 4px; line-height: 1.65; font-size: 14px; }
    strong { font-weight: 600; }
    hr { border: none; border-top: 1px solid var(--border); margin: 44px 0; }

    /* ── RESPONSIVE ── */
    @media (max-width: 767px) {
      .top-bar { padding: 0 14px; }
      .guide-wrap { padding: 20px 14px 60px; }
      .hero h1 { font-size: 24px; }
      .two-col { grid-template-columns: 1fr; }
      .tg-chat, .ui-frame { max-width: 100%; }
      .mock-app-nav button { font-size: 10px; padding: 4px 6px; }
    }
/* Telegram-like media caption: attachment preview first, caption text below */
.tg-caption {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
  color: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── FOOTER ── */
.site-footer {
  text-align: center;
  padding: 24px 16px 32px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 48px;
}
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ── AI FLOW DIAGRAM ── */
.ai-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 24px 0;
}
.ai-flow-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: center;
}
.ai-node {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  min-width: 180px;
  max-width: 260px;
  text-align: center;
  box-shadow: var(--shadow);
  flex: 1;
}
.ai-node.highlight {
  border-color: var(--primary);
  background: #eef5ff;
}
.ai-node .node-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.ai-node .node-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}
.ai-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  color: var(--text-muted);
  font-size: 11px;
  gap: 2px;
}
.ai-arrow .arrow-line {
  width: 2px;
  height: 20px;
  background: var(--border);
  border-radius: 2px;
}
.ai-arrow .arrow-head {
  font-size: 14px;
  line-height: 1;
  color: var(--primary-dark);
}
.ai-arrow .arrow-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.not-stored-badge {
  display: inline-block;
  background: #d5f5e3;
  color: #1e8449;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 10px;
  margin-top: 4px;
}
