/* Codebrain support — light/dark, mobile first */
:root {
  --bg: #f6f7fb;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --line: #e4e7ef;
  --text: #141a26;
  --text-2: #4a5466;
  --muted: #6b7486;
  --brand: #5b5bf6;
  --brand-2: #2a9dff;
  --brand-ink: #ffffff;
  --brand-soft: rgba(91, 91, 246, .1);
  --ok: #12a46b;
  --warn: #e08a00;
  --danger: #e5484d;
  --violet: #7c5cff; --teal: #10a5a0; --amber: #e8920c;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 64px rgba(16, 24, 40, .18);
  --header: 64px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0e14; --bg-2: #10141c; --surface: #131823; --surface-2: #1a2030; --line: #252c3b;
    --text: #e8ecf3; --text-2: #b6bfce; --muted: #8b95a7; --brand-soft: rgba(124, 124, 255, .16);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0e14; --bg-2: #10141c; --surface: #131823; --surface-2: #1a2030; --line: #252c3b;
  --text: #e8ecf3; --text-2: #b6bfce; --muted: #8b95a7; --brand-soft: rgba(124, 124, 255, .16);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25); --shadow-lg: 0 24px 64px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: .86em; }
.center { justify-content: center; text-align: center; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.ico { flex: none; }
.ico.flip { transform: scaleX(-1); }
.grad { background: linear-gradient(120deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: 14.5px; cursor: pointer; transition: transform .15s, box-shadow .2s, background .2s, border-color .2s; white-space: nowrap; text-decoration: none !important; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), #6f5cff 55%, var(--brand-2)); color: var(--brand-ink); box-shadow: 0 6px 18px rgba(91, 91, 246, .32); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(91, 91, 246, .42); }
.btn-primary[disabled] { opacity: .65; cursor: progress; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: rgba(91, 91, 246, .18); }
.btn-lg { height: 50px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; height: 46px; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--text-2); transition: color .2s, border-color .2s; }
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); cursor: pointer; font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Header ── */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--header); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.topbar-inner { max-width: 1200px; height: 100%; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 20px; }
@media (min-width: 640px) { .topbar-inner { padding: 0 24px; } }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; letter-spacing: -.01em; text-decoration: none !important; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 6px 16px rgba(91, 91, 246, .35); }
.brand-mark .ico { width: 20px; height: 20px; }
.brand-sub { font-weight: 500; color: var(--muted); }
.topnav { display: none; gap: 4px; margin-left: 8px; }
.topnav a { padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14.5px; text-decoration: none; }
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a.active { background: var(--brand-soft); color: var(--brand); }
@media (min-width: 960px) { .topnav { display: flex; } }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
#theme-toggle .ico:last-child { display: none; }
:root[data-theme="dark"] #theme-toggle .ico:first-child { display: none; }
:root[data-theme="dark"] #theme-toggle .ico:last-child { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #theme-toggle .ico:first-child { display: none; } :root:not([data-theme="light"]) #theme-toggle .ico:last-child { display: block; } }
@media (max-width: 520px) { .topbar-actions .btn-primary span, .brand-sub { display: none; } .topbar-actions .btn-primary { width: 40px; padding: 0; } }

/* ── Hero ── */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; }
@media (min-width: 768px) { .hero { padding: 108px 0 84px; } }
.hero-glow { position: absolute; inset: -40% -10% auto; height: 620px; background: radial-gradient(40% 50% at 30% 40%, rgba(91, 91, 246, .22), transparent 70%), radial-gradient(35% 45% at 72% 30%, rgba(42, 157, 255, .2), transparent 70%); filter: blur(10px); pointer-events: none; }
.hero-inner { position: relative; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 13px; }
.eyebrow .ico { width: 16px; height: 16px; }
.hero h1 { margin: 18px auto 14px; max-width: 820px; font-size: clamp(34px, 6vw, 60px); line-height: 1.06; letter-spacing: -.035em; font-weight: 800; }
.lead { margin: 0 auto; max-width: 640px; font-size: clamp(16px, 2.2vw, 19px); color: var(--text-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 30px; }

/* ── Module cards ── */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin: 8px 0 22px; }
.section-head h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.section-head p { margin: 0; }
.cards { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { --accent: var(--violet); position: relative; display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; transition: transform .2s, box-shadow .25s, border-color .25s; overflow: hidden; }
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, var(--accent), transparent); opacity: .9; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.accent-violet { --accent: var(--violet); } .accent-teal { --accent: var(--teal); } .accent-amber { --accent: var(--amber); }
.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.card-icon .ico { width: 24px; height: 24px; }
.card-icon.sm { width: 38px; height: 38px; border-radius: 12px; }
.card h3 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.015em; }
.card-text { margin: 0; color: var(--text-2); font-size: 15px; }
.card-features { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); }
.card-features li { display: flex; gap: 8px; align-items: flex-start; }
.card-features .ico { width: 16px; height: 16px; margin-top: 3px; color: var(--ok); }
.card-features.center { justify-items: center; margin: 18px 0 22px; }
.card-foot { margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); }
.card-link .ico { width: 18px; height: 18px; transition: transform .2s; }
.card:hover .card-link .ico { transform: translateX(3px); }
.badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.badge-ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.badge-soon { background: var(--surface-2); color: var(--muted); }

.perks { display: grid; gap: 16px; margin-top: 56px; margin-bottom: 72px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .perks { grid-template-columns: repeat(3, 1fr); } }
.perk { display: flex; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--surface-2); }
.perk h3 { margin: 0 0 4px; font-size: 16px; }
.perk p { margin: 0; font-size: 14px; }
.perk-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }

/* ── Docs layout ── */
.doc-layout { display: grid; grid-template-columns: 1fr; gap: 40px; padding-top: 28px; padding-bottom: 80px; }
@media (min-width: 1024px) { .doc-layout { grid-template-columns: 270px minmax(0, 1fr); } }
.doc-side { display: none; }
@media (min-width: 1024px) {
  .doc-side { display: block; }
  .doc-side-inner { position: sticky; top: calc(var(--header) + 20px); max-height: calc(100vh - var(--header) - 40px); overflow: auto; padding-right: 6px; scrollbar-width: thin; }
}
.side-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.side-back .ico { width: 16px; height: 16px; }
.side-module { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; }
.side-name { font-weight: 700; line-height: 1.25; }
.toc-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); margin-bottom: 10px; }
.toc-search .ico { width: 16px; height: 16px; }
.toc-search input { border: 0; outline: 0; background: transparent; width: 100%; font: inherit; font-size: 14px; color: var(--text); }
.toc { display: grid; gap: 1px; font-size: 14px; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 5px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-2); text-decoration: none; line-height: 1.35; }
.toc a:hover { color: var(--text); }
.toc a.toc-l3 { padding-left: 24px; font-size: 13.5px; color: var(--muted); }
.toc a.active { color: var(--brand); border-left-color: var(--brand); font-weight: 600; }
.toc a.hidden { display: none; }
.side-support { width: 100%; margin-top: 18px; }
.doc { min-width: 0; }
.doc-head .eyebrow { margin-bottom: 10px; }
.doc-head h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.12; letter-spacing: -.03em; margin: 12px 0; }
@media (max-width: 1023px) {
  .doc-side.open { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(8, 12, 20, .45); backdrop-filter: blur(3px); }
  .doc-side.open .doc-side-inner { position: absolute; inset: 0 auto 0 0; width: min(86vw, 340px); background: var(--bg); padding: 20px 16px; overflow: auto; box-shadow: var(--shadow-lg); animation: slide-in .25s ease; }
}
@keyframes slide-in { from { transform: translateX(-100%); } }
.toc-fab { position: fixed; left: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-lg); font-weight: 600; cursor: pointer; }
@media (min-width: 1024px) { .toc-fab { display: none; } }
.to-top { position: fixed; right: 16px; bottom: 84px; z-index: 30; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .2s; }
.to-top.show { opacity: 1; pointer-events: auto; }

/* ── Prose ── */
.prose { font-size: 16.5px; line-height: 1.72; color: var(--text); max-width: 820px; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: clamp(30px, 4vw, 42px); line-height: 1.12; letter-spacing: -.03em; margin: 8px 0 16px; }
.prose h2 { font-size: 26px; line-height: 1.25; letter-spacing: -.02em; margin: 56px 0 14px; padding-top: 12px; border-top: 1px solid var(--line); position: relative; }
.prose h3 { font-size: 19px; line-height: 1.35; margin: 32px 0 10px; position: relative; }
.prose .anchor { position: absolute; left: -22px; color: var(--muted); opacity: 0; text-decoration: none; font-weight: 400; transition: opacity .15s; }
.prose h2 .anchor { top: 12px; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
@media (max-width: 860px) { .prose .anchor { display: none; } }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--brand); }
.prose strong { font-weight: 650; }
.prose code { font-family: var(--mono); font-size: .86em; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); word-break: break-word; }
.prose pre { margin: 0 0 18px; padding: 16px 18px; border-radius: 14px; background: #0f1422; color: #dbe3f4; overflow: auto; font-size: 14px; line-height: 1.6; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.prose blockquote { margin: 0 0 18px; padding: 14px 18px; border-radius: 14px; background: var(--surface-2); border-left: 4px solid var(--line); color: var(--text-2); }
.prose blockquote p:last-child { margin-bottom: 0; }
.callout-title { display: block; margin-bottom: 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.callout-tip { border-left-color: var(--ok) !important; background: color-mix(in srgb, var(--ok) 8%, var(--surface)) !important; }
.callout-tip .callout-title { color: var(--ok); }
.callout-warn { border-left-color: var(--warn) !important; background: color-mix(in srgb, var(--warn) 9%, var(--surface)) !important; }
.callout-warn .callout-title { color: var(--warn); }
.callout-note { border-left-color: var(--brand) !important; background: var(--brand-soft) !important; }
.callout-note .callout-title { color: var(--brand); }
.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.prose table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.5; }
.prose th, .prose td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); font-weight: 650; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.shot { margin: 6px 0 24px; text-align: center; }
/* natural size, never upscaled: small frames stay sharp */
.shot-zoom { display: inline-block; max-width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); cursor: zoom-in; box-shadow: var(--shadow); vertical-align: top; }
.shot-zoom img { display: block; max-width: 100%; height: auto; }
.shot figcaption { margin-top: 8px; font-size: 13.5px; color: var(--muted); text-align: center; }

/* ── Empty state / 404 ── */
.empty-state { text-align: center; padding: 48px 20px; border-radius: 20px; background: var(--surface); border: 1px dashed var(--line); margin-top: 24px; }
.empty-state .card-icon { margin: 0 auto 12px; }
.empty-state h2 { margin: 0 0 8px; }
.page-404 { margin: 72px auto; border: 0; background: none; }
.big-code { font-size: clamp(80px, 14vw, 150px); font-weight: 800; letter-spacing: -.05em; line-height: 1; }

/* ── Footer ── */
.footer { border-top: 1px solid var(--line); background: var(--bg-2); }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 36px 16px 20px; display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .footer-inner { grid-template-columns: 2fr 1fr 1fr; padding: 40px 24px 20px; } }
.footer-brand { margin-bottom: 8px; }
.footer-inner p { margin: 0; font-size: 14px; max-width: 360px; }
.footer-links { display: grid; gap: 8px; align-content: start; font-size: 14.5px; }
.footer-links a { color: var(--text-2); }
.footer-links .link-btn { justify-content: flex-start; }
.footer-bottom { max-width: 1200px; margin: 0 auto; padding: 14px 16px 28px; font-size: 13px; }
@media (min-width: 760px) { .footer-bottom { padding: 14px 24px 28px; } }
.fab { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 30; width: 56px; height: 56px; border-radius: 18px; border: 0; color: #fff; cursor: pointer; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 12px 30px rgba(91, 91, 246, .45); transition: transform .2s; }
.fab:hover { transform: translateY(-2px) scale(1.03); }
.fab .ico { width: 26px; height: 26px; }

/* ── Modal ── */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 12, 20, .5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .2s ease; }
.modal-card { position: relative; width: 100%; max-width: 460px; max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 24px; animation: pop .25s cubic-bezier(.2, .9, .3, 1.2); }
@media (max-width: 520px) {
  .modal { place-items: end stretch; padding: 0; }
  .modal-card { max-width: none; border-radius: 24px 24px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); animation: sheet .3s ease; max-height: 92dvh; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes sheet { from { transform: translateY(100%); } }
.modal-close { position: absolute; top: 14px; right: 14px; border: 0; background: transparent; }
.modal-head { display: flex; align-items: center; gap: 12px; margin: 0 40px 20px 0; }
.modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -.015em; }
.modal-head p { margin: 2px 0 0; }
.modal-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; flex: none; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: var(--surface-2); margin-bottom: 18px; }
.tab { position: relative; z-index: 1; height: 38px; border: 0; background: none; border-radius: 10px; font-weight: 600; color: var(--muted); cursor: pointer; transition: color .2s; }
.tab.active { color: var(--text); }
.tab-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow); transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.tabs.second .tab-pill { transform: translateX(100%); }
.form { display: grid; gap: 14px; }
.form[hidden] { display: none; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; font-size: 16px; transition: border-color .2s, box-shadow .2s; }
.field textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238b95a7' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field.invalid input, .field.invalid select, .field.invalid textarea, .pin.invalid input { border-color: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 14%, transparent); }
.form-error { margin: -4px 0 0; color: var(--danger); font-size: 14px; min-height: 0; }
.form-error:empty { display: none; }
.form-note { margin: 0; text-align: center; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.form-row.center { justify-content: center; margin-top: 18px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.info-box { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--brand-soft); color: var(--text-2); font-size: 14.5px; margin-bottom: 18px; }
.info-box p { margin: 0; }
.info-box .ico { color: var(--brand); margin-top: 2px; }
.info-box.ok { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.info-box.ok .ico { color: var(--ok); }
.pin { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.pin input { width: 100%; aspect-ratio: 1 / 1.15; max-height: 62px; text-align: center; font: 700 24px var(--mono); border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); transition: border-color .2s, box-shadow .2s; }
.pin input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.user-line { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--surface-2); margin-bottom: 16px; }
.avatar { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none; color: #fff; font-weight: 700; background: linear-gradient(135deg, var(--violet), var(--brand-2)); }
.user-meta { display: grid; min-width: 0; line-height: 1.3; }
.user-meta > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-line .link-btn { margin-left: auto; }
.user-line .link-btn .ico { width: 16px; height: 16px; }
.step.done { text-align: center; padding: 8px 0 4px; }
.done-icon { width: 72px; height: 72px; margin: 6px auto 14px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--ok), #3bd18f); box-shadow: 0 12px 30px color-mix(in srgb, var(--ok) 40%, transparent); animation: pop .35s cubic-bezier(.2, .9, .3, 1.4); }
.done-icon .ico { width: 36px; height: 36px; stroke-width: 2.4; }
.step.done h3 { margin: 0 0 6px; font-size: 20px; }
.step.done p { margin: 0; color: var(--text-2); }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* ── Lightbox ── */
.lightbox { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(6, 9, 15, .86); backdrop-filter: blur(4px); cursor: zoom-out; animation: fade .2s; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: var(--shadow-lg); }
.lightbox-close { position: absolute; top: 16px; right: 16px; background: rgba(255, 255, 255, .1); border-color: transparent; color: #fff; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.nowrap { white-space: nowrap; }
.doc-head .lead { margin: 0 0 8px; }
@media (max-width: 640px) { .prose table { min-width: 560px; } .prose th, .prose td { padding: 9px 12px; } }

.topnav-link { margin-left: 8px; padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14.5px; }
.topnav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
@media (max-width: 520px) { .topnav-link { display: none; } }

/* ── Services: install / customise / develop to order ── */
#services { margin-top: 64px; scroll-margin-top: calc(var(--header) + 16px); }
.services { position: relative; overflow: hidden; display: grid; gap: 32px; grid-template-columns: 1fr; padding: 28px 20px; border-radius: 28px; color: #e9edff;
  background: radial-gradient(120% 90% at 0% 0%, #2b2f8f 0%, transparent 55%), radial-gradient(90% 80% at 100% 100%, #0d5ea8 0%, transparent 55%), #0e1230;
  box-shadow: 0 30px 80px rgba(20, 24, 80, .35); }
@media (min-width: 720px) { .services { padding: 40px; } }
@media (min-width: 1040px) { .services { grid-template-columns: 1.08fr .92fr; gap: 48px; padding: 52px; align-items: start; } }
.services-glow { position: absolute; width: 520px; height: 520px; right: -160px; top: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(124, 92, 255, .45), transparent 65%); filter: blur(20px); pointer-events: none; }
.services-pitch { position: relative; }
.eyebrow-light { background: rgba(255, 255, 255, .1); color: #c9d2ff; }
.services h2 { margin: 16px 0 14px; font-size: clamp(28px, 4.2vw, 44px); line-height: 1.08; letter-spacing: -.03em; color: #fff; }
.grad-light { background: linear-gradient(120deg, #a99bff, #6ec3ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.services-lead { margin: 0 0 26px; font-size: 17px; line-height: 1.6; color: #c3cbef; max-width: 560px; }
.service-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.service-list li { display: flex; gap: 14px; padding: 16px; border-radius: 18px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); transition: background .2s, transform .2s; }
.service-list li:hover { background: rgba(255, 255, 255, .09); transform: translateX(3px); }
.service-list h3 { margin: 0 0 4px; font-size: 16.5px; color: #fff; }
.service-list p { margin: 0; font-size: 14.5px; line-height: 1.55; color: #b9c2e8; }
.service-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #fff; background: linear-gradient(135deg, #7c5cff, #2a9dff); box-shadow: 0 8px 20px rgba(91, 91, 246, .45); }
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.services > .steps { position: relative; grid-column: 1 / -1; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li { counter-increment: step; position: relative; padding: 12px 12px 12px 44px; border-radius: 14px; background: rgba(255, 255, 255, .05); font-size: 13px; line-height: 1.35; color: #aab4de; }
.steps li::before { content: counter(step); position: absolute; left: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #0e1230; background: #a99bff; }
.steps b { display: block; color: #fff; font-size: 14px; margin-bottom: 2px; }
.lead-card { position: relative; padding: 24px 20px; border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
@media (min-width: 720px) { .lead-card { padding: 28px; } }
.lead-head h3 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.015em; }
.lead-head p { margin: 0 0 4px; }
.field-row { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .field-row { grid-template-columns: 1fr 1fr; } }
.lead-card .btn-lg .ico { transition: transform .2s; }
.lead-card .btn-lg:hover .ico { transform: translateX(3px); }
.lead-done { text-align: center; padding: 28px 8px; }
.lead-done h3 { margin: 0 0 6px; font-size: 21px; }
.lead-done p { margin: 0 0 18px; }
.hero-more { margin: 18px 0 0; font-size: 15px; }
.hero-more a { font-weight: 600; }

/* ── Legal pages and consent checkboxes ── */
.legal { max-width: 860px; padding-top: 28px; padding-bottom: 80px; }
.legal .prose h2 { font-size: 21px; margin-top: 40px; }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.footer-bottom a { color: var(--muted); }
.footer-bottom a:hover { color: var(--text); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.5; color: var(--text-2); cursor: pointer; }
.consent input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--brand); cursor: pointer; }
.consent a { font-weight: 500; }
.consent.invalid { color: var(--danger); }
.consent.invalid input { outline: 2px solid var(--danger); outline-offset: 1px; border-radius: 4px; }

/* ── Cookie notice ── */
.cookie-note { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 70; max-width: 520px; margin-right: 88px; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.cookie-note[hidden] { display: none; }
.cookie-note p { margin: 0; }
.cookie-note .btn { flex: none; height: 36px; }
@media (max-width: 520px) { .cookie-note { flex-direction: column; align-items: stretch; margin-right: 80px; } }
