:root {
  --primary: #1769e0; --primary-dark: #0f4fb3; --text: #1a2333; --muted: #5b6779;
  --bg: #f6f8fb; --surface: #fff; --border: #e3e9f2; --code-bg: #eef2f8;
  --warn-bg: #fff7e6; --warn-border: #f0c36d; --tip-bg: #e8f3ff; --tip-border: #9cc4f5;
  --danger-bg: #fdeaea; --danger-border: #e8a0a0;
  --kbd-bg: #fff; --shot-shadow: rgba(16,40,90,.10); color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body { margin: 0; font: 15px/1.65 system-ui, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--code-bg); padding: 1px 6px; border-radius: 4px; font-family: "Cascadia Code", Consolas, monospace; font-size: .88em; }
pre { background: #10192b; color: #dce6f5; padding: 14px 16px; border-radius: 4px; overflow-x: auto; font-size: 13px; }
pre code { background: none; padding: 0; color: inherit; }
kbd { background: var(--kbd-bg); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 1px 7px; font-family: inherit; font-size: .85em; box-shadow: 0 1px 0 rgba(0,0,0,.04); white-space: nowrap; }

.layout { display: flex; min-height: 100vh; }
nav.sidebar { width: 300px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 16px 40px; }
.brand { display: flex; align-items: center; gap: 10px; margin: 0 6px 6px; }
.brand-mark { width: 34px; height: 34px; border-radius: 4px; background: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.brand-name { font-weight: 800; font-size: 17px; }
.brand-name span { color: var(--primary); }
.docs-badge { font-size: 11px; font-weight: 700; color: var(--muted); margin: 0 6px 14px; text-transform: uppercase; letter-spacing: .06em; }
#tocFilter { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 4px; font: inherit; font-size: 13px; margin-bottom: 14px; }
#tocFilter:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
nav .grp { font-size: 11px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 18px 6px 6px; }
nav ul { list-style: none; margin: 0; padding: 0; }
nav li a { display: block; padding: 5px 10px; border-radius: 4px; color: var(--text); font-size: 13.5px; }
nav li a:hover { background: var(--code-bg); text-decoration: none; }
/* the section in view: a tint that exists in both themes, never an inline colour */
nav li a.is-active { background: var(--tip-bg); color: var(--text); font-weight: 600; }
nav li a.sub { padding-left: 24px; color: var(--muted); font-size: 12.5px; }

main { flex: 1; min-width: 0; padding: 36px 48px 90px; }
h1 { font-size: 34px; margin: 0 0 6px; letter-spacing: -.02em; }
.lead { color: var(--muted); font-size: 16.5px; margin: 0 0 30px; }
section { margin-bottom: 20px; }
h2 { font-size: 25px; margin: 55px 0 12px; padding-top: 24px; border-top: 1px solid var(--border); letter-spacing: -.01em; }
section:first-of-type h2 { border-top: 0; padding-top: 0; margin-top: 25px; }
h3 { font-size: 18px; margin: 30px 0 8px; }
h4 { font-size: 15px; margin: 22px 0 6px; }
p, ul, ol { margin: 0 0 12px; }
ul, ol { padding-left: 24px; }
li { margin-bottom: 4px; }
table { border-collapse: collapse; width: 100%; margin: 14px 0 18px; font-size: 14px; background: var(--surface); border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
th { background: var(--code-bg); text-align: left; padding: 9px 14px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
td { padding: 9px 14px; border-top: 1px solid var(--border); vertical-align: top; }
figure { margin: 18px 0 22px; }
picture { display: contents; }
figure img { max-width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--border); box-shadow: 0 8px 28px var(--shot-shadow); }
.shot-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-start; margin: 18px 0 22px; }
.shot-row figure { flex: 1 1 220px; max-width: 340px; margin: 0; }
.shot-row.wide figure { flex: 1 1 420px; max-width: 720px; }
/* Intro hero — the app's identity rebuilt in the page's own design language. */
.hero { position: relative; overflow: hidden; margin: 18px 0 26px; padding: 26px 28px; border-radius: 4px; color: #fff; background: linear-gradient(135deg, #1e7bf2 0%, #1769e0 45%, #0f4fb3 100%); }
.hero-mark { position: absolute; right: -44px; bottom: -64px; width: 250px; height: auto; opacity: .08; transform: rotate(-12deg); pointer-events: none; }
.hero-head { display: flex; align-items: center; gap: 16px; position: relative; }
.hero-icon { width: 56px; height: 56px; border-radius: 4px; box-shadow: 0 6px 18px rgba(9,38,88,.35); }
.hero-name { font-size: 19px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.hero-tag { font-size: 14px; color: rgba(255,255,255,.85); margin-top: 3px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; position: relative; }
.hero-chips span { font-size: 11.5px; font-weight: 600; letter-spacing: .05em; padding: 4px 12px; border-radius: 4px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); }
@media (max-width: 560px) { .hero { padding: 20px; } .hero-name { font-size: 18px; } }
figcaption { font-size: 12.5px; color: var(--muted); margin-top: 7px; }
.callout { border-radius: 4px; padding: 12px 16px; margin: 14px 0; border: 1px solid; font-size: 14px; }
.callout p:last-child { margin-bottom: 0; }
.tip { background: var(--tip-bg); border-color: var(--tip-border); }
.warn { background: var(--warn-bg); border-color: var(--warn-border); }
.danger { background: var(--danger-bg); border-color: var(--danger-border); }
.callout b:first-child { display: block; margin-bottom: 3px; }
.shot-todo { border: 2px dashed var(--border); border-radius: 4px; padding: 26px; text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 22px; background: var(--surface); }
.steps { counter-reset: step; list-style: none; padding-left: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 42px; margin-bottom: 10px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.pill { display: inline-block; background: var(--code-bg); color: var(--primary-dark); border-radius: 4px; padding: 1px 10px; font-size: 12px; font-weight: 700; }
.footer-note { margin-top: 70px; padding-top: 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; }
.footer-note a { text-decoration: underline; }
.brand { text-decoration: none; color: inherit; }
.lang-row { margin: 0 6px 8px; font-size: 12px; font-weight: 700; line-height: 1.8; }
.lang-cur { color: var(--text); }
.back-row { margin: 0 6px 12px; font-size: 12px; }
th[scope="row"] { background: transparent; text-transform: none; letter-spacing: 0; color: var(--text); font-size: 14px; font-weight: 700; border-top: 1px solid var(--border); }
.mob-top { display: none; }
.backdrop { display: none; }
@media (max-width: 900px) {
  html { scroll-padding-top: 68px; }
  .mob-top { position: sticky; top: 0; z-index: 90; display: flex; align-items: center; gap: 10px; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 14px; }
  .mob-top .brand-mark { width: 30px; height: 30px; }
  .mob-top .brand-name { font-size: 16px; }
  .mob-burger { margin-left: auto; width: 42px; height: 38px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 0; }
  .mob-burger span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); }
  nav.sidebar { display: block; position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: min(320px, 86vw); z-index: 100; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 0 0 44px rgba(10,20,40,.3); }
  body.nav-open nav.sidebar { transform: none; }
  .backdrop { position: fixed; inset: 0; background: rgba(15,25,43,.45); z-index: 95; }
  body.nav-open .backdrop { display: block; }
  main { padding: 18px 16px 60px; }
  h1 { font-size: 26px; }
  h2 { font-size: 21px; margin-top: 40px; }
  h3 { font-size: 17px; }
  table { display: block; overflow-x: auto; }
  .lead { font-size: 15px; }
}


/* ---- dark theme: follows the OS unless the visitor chose one (data-theme on the root element, shared with
   bursucm.com through localStorage). Every colour is a token; nothing is styled in these blocks. ---- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark;
    --primary: #4d8dff; --primary-dark: #7fb0ff; --text: #e6ecf7; --muted: #9aa8c1;
    --bg: #0b1222; --surface: #111a2c; --border: #263149; --code-bg: #1b2538; --kbd-bg: #1b2538;
    --warn-bg: rgba(245, 183, 74, .12); --warn-border: rgba(245, 183, 74, .45);
    --tip-bg: rgba(77, 141, 255, .12); --tip-border: #2f4a7a;
    --danger-bg: rgba(201, 51, 43, .18); --danger-border: rgba(255, 138, 128, .45);
    --shot-shadow: rgba(0, 0, 0, .5); }
}
:root[data-theme="dark"] { color-scheme: dark;
    --primary: #4d8dff; --primary-dark: #7fb0ff; --text: #e6ecf7; --muted: #9aa8c1;
    --bg: #0b1222; --surface: #111a2c; --border: #263149; --code-bg: #1b2538; --kbd-bg: #1b2538;
    --warn-bg: rgba(245, 183, 74, .12); --warn-border: rgba(245, 183, 74, .45);
    --tip-bg: rgba(77, 141, 255, .12); --tip-border: #2f4a7a;
    --danger-bg: rgba(201, 51, 43, .18); --danger-border: rgba(255, 138, 128, .45);
    --shot-shadow: rgba(0, 0, 0, .5); }
:root[data-theme="light"] { color-scheme: light; }
#themeSelect { width: 100%; margin: 0 0 10px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
#themeSelect:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
