:root {
  --bg: #ffffff; --bg2: #f6f8fb; --panel: #ffffff; --line: #e4e8ef; --fg: #121826; --mut: #5b6476;
  --acc: #2563eb; --acc2: #1d4ed8; --acc-soft: #e8effd; --ok: #16a34a; --code-bg: #0f1115; --code-fg: #e6e8ee;
  --get: #1a7f37; --post: #9a6700; --put: #8250df;
  --radius: 14px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 12px 32px -16px rgba(16, 24, 40, .18);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1016; --bg2: #11151d; --panel: #151a23; --line: #232a36; --fg: #e8ebf1; --mut: #98a2b3;
    --acc: #5b9cff; --acc2: #7cb0ff; --acc-soft: #18243a; --ok: #3fb950; --code-bg: #0a0c10;
    --get: #3fb950; --post: #d29922; --put: #a371f7;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -20px rgba(0, 0, 0, .7);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 var(--sans); }
img { max-width: 100%; height: auto; }
a { color: var(--acc); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--acc2); }
code { font-family: var(--mono); font-size: .9em; background: var(--bg2); border: 1px solid var(--line); padding: .05em .35em; border-radius: 5px; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.1rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.3vw, 2rem); }
h3, .h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 800px; }
.center { text-align: center; }
.muted { color: var(--mut); }
.small { font-size: .9rem; }
.lead { font-size: 1.15rem; color: var(--mut); max-width: 62ch; }
.center .lead { margin-left: auto; margin-right: auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 600; color: var(--acc); margin-bottom: .8em; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 10; background: var(--panel); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--acc); color: #fff;
  border: 1px solid var(--acc); border-radius: 10px; padding: 10px 18px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background .15s, transform .15s; }
.btn:hover { background: var(--acc2); border-color: var(--acc2); color: #fff; }
@media (prefers-color-scheme: dark) { .btn, .btn:hover { color: #0b1220; } }
.btn:active { transform: translateY(1px); }
.btn-lg { padding: 13px 22px; font-size: 1.05rem; }
.btn-sm { padding: 6px 12px; font-size: .9rem; border-radius: 8px; }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg2); color: var(--fg); border-color: var(--mut); }
@media (prefers-color-scheme: dark) { .btn-ghost, .btn-ghost:hover { color: var(--fg); } }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 1.6em 0 .8em; }
.cta-row.center { justify-content: center; }

/* шапка й підвал */
.nav { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--fg); text-decoration: none; font-size: 1.05rem; white-space: nowrap; }
.brand:hover { color: var(--fg); }
.brand img { border-radius: 7px; }
.brand-sm { font-size: .95rem; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links > a:not(.btn) { color: var(--fg); text-decoration: none; font-weight: 500; }
.nav-links > a:not(.btn):hover { color: var(--acc); }
.lang { font-size: .85rem; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
.foot { border-top: 1px solid var(--line); background: var(--bg2); padding: 36px 0; margin-top: 0; }
.foot-in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot p { color: var(--mut); font-size: .9rem; max-width: 520px; margin: .6em 0 0; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.foot-links a { color: var(--mut); text-decoration: none; }
.foot-links a:hover { color: var(--acc); }

/* hero */
.hero { padding: 64px 0 56px; background:
  radial-gradient(900px 400px at 85% -10%, var(--acc-soft), transparent 70%), var(--bg); }
.hero-in { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: .45em; }

/* демонстрація інтерфейсу */
.demo { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; font-size: 13px; }
.demo-bar { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.demo-bar > span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.demo-bar code { margin-left: 8px; background: none; border: 0; color: var(--mut); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-body { display: grid; grid-template-columns: 1fr 1.15fr; min-height: 230px; }
.demo-list { border-right: 1px solid var(--line); }
.demo-row { display: grid; grid-template-columns: 46px 1fr auto; gap: 6px; padding: 9px 10px; border-bottom: 1px solid var(--line); align-items: center; font-family: var(--mono); font-size: 12px; }
.demo-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo-row i { font-style: normal; color: var(--mut); font-size: 11px; }
.demo-row.on { background: var(--acc-soft); }
.demo-row.on:first-child { animation: arrive 2.4s ease-out 1; }
@keyframes arrive { 0% { background: color-mix(in srgb, var(--ok) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) { .demo-row.on:first-child { animation: none; } }
.m { font-family: var(--mono); font-weight: 700; font-style: normal; }
.m.get { color: var(--get); } .m.post { color: var(--post); } .m.put { color: var(--put); }
.demo-detail { padding: 10px 12px; min-width: 0; }
.demo-h { text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; color: var(--mut); margin: 4px 0 6px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px; font-family: var(--mono); font-size: 11.5px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.kv span:first-child { color: var(--acc); }
.kv span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.demo pre { margin: 6px 0 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 11.5px; overflow: hidden; }

/* секції */
.section { padding: 64px 0; }
.section.alt { background: var(--bg2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section h2 { margin-bottom: .7em; }
.section > .wrap > .muted { margin-top: -.4em; margin-bottom: 1.6em; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.steps li { counter-increment: s; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--acc-soft); color: var(--acc); font-weight: 700; margin-bottom: 12px; }
.steps p { color: var(--mut); margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card p { color: var(--mut); margin: 0; }
.card-link { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--fg); transition: border-color .15s, transform .15s, box-shadow .15s; }
.card-link:hover { color: var(--fg); border-color: var(--acc); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-link h2, .card-link h3 { margin: 4px 0 2px; }
.card-link .more { color: var(--acc); font-weight: 600; font-size: .92rem; margin-top: auto; padding-top: 8px; }
.tag { align-self: flex-start; font-size: .75rem; font-weight: 600; color: var(--acc); background: var(--acc-soft); border-radius: 999px; padding: 2px 10px; }
.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: center; }
pre.code, .prose pre { background: var(--code-bg); color: var(--code-fg); border-radius: 12px; padding: 18px 20px; overflow-x: auto;
  font: 13.5px/1.6 var(--mono); margin: 0; border: 1px solid var(--line); }
pre.code code, .prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
pre.code .c { color: #8b949e; }
.limits { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.limits th, .limits td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.limits th { font-weight: 500; color: var(--mut); width: 50%; }
.limits tr:last-child th, .limits tr:last-child td { border-bottom: 0; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.faq summary { cursor: pointer; list-style: none; padding: 16px 48px 16px 18px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--acc); }
.faq details[open] summary::after { content: "−"; }
.faq summary h3 { display: inline; font-size: 1.02rem; margin: 0; }
.faq details p { padding: 0 18px 16px; margin: 0; color: var(--mut); }
.final { background: radial-gradient(700px 300px at 50% 120%, var(--acc-soft), transparent 70%), var(--bg); }

/* сторінки гайдів */
.page-head { padding: 48px 0 28px; border-bottom: 1px solid var(--line); background: var(--bg2); }
.crumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: .9rem; color: var(--mut); margin-bottom: 16px; }
.crumbs a { color: var(--mut); text-decoration: none; }
.crumbs a:hover { color: var(--acc); }
.article-in { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; padding-top: 40px; padding-bottom: 56px; }
.toc { position: sticky; top: 86px; align-self: start; font-size: .92rem; }
.toc-h { font-weight: 600; margin-bottom: .5em; }
.toc ol { list-style: none; padding: 0; margin: 0 0 18px; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 4px 0 4px 14px; color: var(--mut); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.toc li a:hover { color: var(--acc); border-left-color: var(--acc); }
.prose { max-width: 760px; min-width: 0; font-size: 1.04rem; }
.prose h2 { margin-top: 1.9em; padding-top: .2em; scroll-margin-top: 80px; }
.prose h3 { margin-top: 1.5em; scroll-margin-top: 80px; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .3em 0; }
.prose pre { margin: 0 0 1.3em; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.3em; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg2); }
.prose blockquote { margin: 0 0 1.2em; padding: 10px 16px; border-left: 3px solid var(--acc); background: var(--acc-soft); border-radius: 0 8px 8px 0; }
.prose blockquote p:last-child { margin: 0; }
.try { margin-top: 2.5em; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg2); }
.try h2 { margin-top: 0 !important; font-size: 1.3rem; }

/* адаптивність */
@media (max-width: 900px) {
  .hero-in, .split { grid-template-columns: 1fr; gap: 32px; }
  .steps { grid-template-columns: 1fr; }
  .article-in { grid-template-columns: 1fr; gap: 20px; padding-top: 28px; }
  .toc { position: static; }
  .toc-cta { display: none; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .wrap { padding: 0 16px; }
  .hero { padding: 40px 0; }
  .section { padding: 44px 0; }
  .nav-links { gap: 14px; }
  .nav-links .btn { display: none; }
  .demo-body { grid-template-columns: 1fr; }
  .demo-list { border-right: 0; border-bottom: 1px solid var(--line); }
  .cta-row .btn { flex: 1 1 100%; }
}
/* сторінка згоди OAuth */
.consent-card { max-width: 620px; margin: 0 auto; padding: 32px; }
.consent-card h1 { font-size: 1.6rem; margin: 0 0 .5em; overflow-wrap: anywhere; }
.consent-card h2 { font-size: 1rem; margin: 1.4em 0 .4em; }
.consent-dest code, .consent-session code { font-weight: 600; }
.consent-list { margin: 0 0 1.2em; padding-left: 1.2em; }
.consent-list li { margin: .25em 0; }
.consent-session { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; padding: 10px 12px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 1em; }
.consent .cta-row { margin: 1.2em 0 .6em; }
.small { font-size: .88rem; }
@media (max-width: 560px) { .consent-card { padding: 20px; } }
