/* AI Chat Widget handbook. Self-contained: no CDN, no web fonts, works from a folder on disk. */
:root {
  --primary: #0054a6;
  --secondary: #1c86e8;
  --accent: #0891b2;
  --deep: #071c44;
  --text: #1e293b;
  --muted: #64748b;
  --bg: #ffffff;
  --bg-soft: #f4f7fb;
  --card: #ffffff;
  --line: #e2e8f0;
  --code-bg: #f1f5f9;
  --shadow: 0 4px 14px rgba(15, 40, 80, .10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #5aa9ff;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --bg: #0b1220;
    --bg-soft: #0f1a2e;
    --card: #111c33;
    --line: #22314d;
    --code-bg: #0b1730;
    --shadow: 0 4px 14px rgba(0, 0, 0, .45);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--primary); }
img { max-width: 100%; height: auto; }
code { font: .88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--code-bg); padding: .1em .38em; border-radius: 4px; word-break: break-word; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.i { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; flex: none; }

/* ---- top bar ---- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 1px 6px rgba(15, 40, 80, .06); }
.bar { display: flex; align-items: center; gap: 18px; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; text-decoration: none; background: linear-gradient(135deg, var(--primary), var(--secondary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand img { flex: none; }
.topnav { display: flex; gap: 2px; margin-left: auto; flex-wrap: wrap; }
.nav-link { padding: 8px 12px; color: var(--muted); text-decoration: none; border-radius: 6px; font-size: .94rem; }
.nav-link:hover { color: var(--primary); background: var(--bg-soft); }
.switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-btn { padding: 5px 11px; font-size: .82rem; font-weight: 700; text-decoration: none; color: var(--muted); }
.lang-btn.active { background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--text); cursor: pointer; }
.menu-btn .i { width: 1.4em; height: 1.4em; }

/* ---- hero ---- */
.hero { background: linear-gradient(135deg, #071c44 0%, #0054a6 55%, #1c86e8 100%); color: #fff; padding: 56px 0; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; }
.hero h1 { margin: 0 0 16px; font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.12; font-weight: 800; }
.hero-lead { font-size: 1.12rem; opacity: .93; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art img { border-radius: 16px; box-shadow: 0 18px 40px rgba(2, 20, 51, .45); width: 100%; height: auto; display: block; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 10px; font-weight: 700; text-decoration: none; border: 2px solid transparent; }
.btn-light { background: #fff; color: #0a3c7a; }
.btn-light:hover { background: #e8f1fc; }
.btn-outline { border-color: rgba(255, 255, 255, .8); color: #fff; }
.btn-outline:hover { background: rgba(255, 255, 255, .14); }
.btn-buy { background: #f59e0b; color: #1a1a2e; }
.btn-buy:hover { background: #fbbf24; color: #1a1a2e; }

/* ---- layout ---- */
.layout { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 40px; padding-top: 36px; padding-bottom: 56px; }
.sidebar .sticky { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; padding-right: 6px; }
.sidebar h5 { margin: 0 0 10px; font-size: 1.02rem; font-weight: 800; }
.search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin-bottom: 12px; background: var(--bg-soft); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font: inherit; font-size: .92rem; outline: none; }
.toc-group { margin: 14px 0 4px; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.toc-link { display: block; padding: 4px 0 4px 14px; border-left: 3px solid transparent; color: var(--muted); text-decoration: none; font-size: .94rem; }
.toc-link:hover { color: var(--primary); border-left-color: var(--primary); }
.toc-link.active { color: var(--primary); border-left-color: var(--primary); background: rgba(0, 84, 166, .08); font-weight: 700; }
.toc-link[hidden] { display: none; }

/* ---- content ---- */
.group { margin-bottom: 52px; }
.group > h2 { font-size: 1.85rem; font-weight: 800; margin: 0 0 22px; padding-bottom: 10px; border-bottom: 3px solid var(--primary); display: flex; align-items: center; gap: 10px; }
.subsection { margin-bottom: 44px; padding-top: 4px; }
.subsection > h3 { font-size: 1.45rem; font-weight: 800; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.hi { color: var(--primary); width: 1.25em; height: 1.25em; }
.lead { font-size: 1.12rem; color: var(--text); }
.sub { margin: 26px 0 10px; font-size: 1.1rem; font-weight: 800; color: var(--primary); }
p { margin: 0 0 14px; }
ul, ol { padding-left: 22px; margin: 0 0 16px; }
li { margin-bottom: 6px; }

.steps { list-style: none; padding: 0; counter-reset: s; }
.steps li { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.step-number { flex: none; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #1e3a8a); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .95rem; }

.fields { margin: 0 0 18px; }
.form-field { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.form-field strong { color: var(--primary); display: block; margin-bottom: 2px; }
.form-field span { color: var(--text); }

.callout { display: flex; gap: 12px; padding: 13px 16px; border-radius: 8px; border-left: 4px solid var(--primary); background: rgba(0, 84, 166, .08); margin: 0 0 18px; }
.callout .ci { margin-top: 3px; color: var(--primary); }
.callout-tip { border-left-color: #0d9488; background: rgba(13, 148, 136, .10); }
.callout-tip .ci { color: #0d9488; }
.callout-warn { border-left-color: #d97706; background: rgba(217, 119, 6, .12); }
.callout-warn .ci { color: #d97706; }

.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--card); }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--bg-soft); font-weight: 800; white-space: nowrap; }
tbody th { font-weight: 700; width: 28%; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }

.code-block { background: #0f1b33; color: #e6edf7; padding: 14px 16px; border-radius: 10px; overflow: auto; font-size: .88rem; line-height: 1.55; margin: 0 0 18px; position: relative; }
.code-block code { background: none; padding: 0; color: inherit; word-break: normal; }
.copy-btn { position: absolute; top: 8px; right: 8px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; border-radius: 6px; font-size: .75rem; padding: 3px 9px; cursor: pointer; }

.shot { margin: 8px 0 24px; }
.shot img { display: block; width: 100%; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); background: var(--card); }
.shot figcaption { margin-top: 8px; font-size: .88rem; color: var(--muted); text-align: center; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-bottom: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); transition: transform .2s; }
.card:hover { transform: translateY(-3px); }
.card h5 { margin: 12px 0 6px; font-size: 1.05rem; font-weight: 800; }
.card p { margin: 0; color: var(--muted); font-size: .94rem; }
.feature-icon { width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.feature-icon .i { width: 1em; height: 1em; }

.contact-section { background: linear-gradient(135deg, #0054a6, #1c86e8); color: #fff; border-radius: 16px; padding: 32px; }
.contact-section h2 { border: 0; margin: 0 0 8px; padding: 0; }
.contact-section .hi, .contact-section a { color: #fff; }
.contact-card { margin-top: 10px; }
.contact-name { font-size: 1.2rem; font-weight: 800; }

/* ---- footer ---- */
.footer { background: #0b1220; color: #cbd5e1; padding: 26px 0; }
.footer a { color: #fff; }
.foot { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: .92rem; }
.footer .muted { color: #94a3b8; }

/* ---- small screens ---- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; gap: 12px; }
  .sidebar .sticky { position: static; max-height: none; }
  .sidebar { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
  .menu-btn { display: inline-flex; }
  .topnav { display: none; position: absolute; left: 0; right: 0; top: 58px; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; padding: 8px 20px; margin: 0; }
  .topnav.open { display: flex; }
  .switch { margin-left: 0; }
  .bar { position: relative; }
}
@media print {
  .topbar, .sidebar, .menu-btn, .hero-actions, .copy-btn { display: none !important; }
  .layout { display: block; }
  .hero { background: none; color: #000; padding: 0 0 12px; }
  .hero-art { display: none; }
  .subsection, .shot, .callout { break-inside: avoid; }
  .contact-section { background: none; color: #000; }
  .contact-section a, .contact-section .hi { color: #000; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card { transition: none; } }
