/* Help site (MB-115). Same look as the app: IBM Plex Sans, slate surfaces, one blue accent, 6–8 px corners, lucide icons
   (tokens copied from src/app/globals.css). Dark mode follows the system or the toggle. Everything ships with the site. */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap; src: url(fonts/plex-sans-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 100 700; font-display: swap; src: url(fonts/plex-sans-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/plex-mono-latin.woff2) format("woff2"); }

:root {
  --background: #ffffff; --foreground: #0f172a; --card: #ffffff; --primary: #1e40af; --primary-foreground: #ffffff;
  --secondary: #f1f5f9; --muted: #f8fafc; --muted-foreground: #475569; --accent: #f1f5f9;
  --brand-soft: color-mix(in oklab, var(--primary) 7%, white); --brand-line: color-mix(in oklab, var(--primary) 22%, white);
  --success: #15803d; --warning: #b45309; --warning-soft: #fffbeb; --warning-line: #fcd34d; --destructive: #b91c1c;
  --border: #e2e8f0; --input: #cbd5e1; --ring: var(--primary);
  --sidebar: #f8fafc; --sidebar-foreground: #334155; --sidebar-accent: #eef2f6;
  --mark: color-mix(in oklab, var(--primary) 16%, #fde68a);
  --radius: 0.375rem; --radius-lg: 0.375rem; --radius-xl: 0.525rem;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.05); --shadow: 0 1px 3px rgb(15 23 42 / 0.08), 0 4px 16px rgb(15 23 42 / 0.06);
  --font: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace;
  --top: 3.5rem; color-scheme: light;
}
html.dark {
  --background: #0b1120; --foreground: #e2e8f0; --card: #0f172a; --primary: #93b4fb; --primary-foreground: #0b1120;
  --secondary: #1e293b; --muted: #111a2e; --muted-foreground: #94a3b8; --accent: #1e293b;
  --brand-soft: color-mix(in oklab, #3b82f6 16%, #0f172a); --brand-line: color-mix(in oklab, #3b82f6 40%, #0f172a);
  --warning: #fbbf24; --warning-soft: color-mix(in oklab, #f59e0b 12%, #0f172a); --warning-line: color-mix(in oklab, #f59e0b 45%, #0f172a);
  --border: #1e293b; --input: #334155; --sidebar: #0d1526; --sidebar-foreground: #cbd5e1; --sidebar-accent: #1a2437;
  --mark: color-mix(in oklab, #3b82f6 35%, #0f172a);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.3); --shadow: 0 1px 3px rgb(0 0 0 / 0.35), 0 8px 24px rgb(0 0 0 / 0.3); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-padding-top: calc(var(--top) + 1rem); }
body { margin: 0; font: 400 15px/1.6 var(--font); color: var(--foreground); background: var(--background); }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid color-mix(in oklab, var(--ring) 60%, transparent); outline-offset: 2px; border-radius: var(--radius); }
::selection { background: color-mix(in oklab, var(--primary) 20%, transparent); }
h1, h2, h3 { letter-spacing: -0.011em; text-wrap: balance; line-height: 1.25; }
code, kbd { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--secondary); border: 1px solid var(--border); border-radius: 4px; padding: 0.05em 0.35em; }
kbd { display: inline-block; min-width: 1.4em; padding: 0 0.35em; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--card); color: var(--muted-foreground); text-align: center; line-height: 1.4; }
.icon { width: 1rem; height: 1rem; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0.5rem; z-index: 100; background: var(--card); padding: 0.5rem 0.75rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.skip:focus { left: 0.5rem; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top); background: color-mix(in oklab, var(--background) 88%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border); }
.topbar-in { height: 100%; max-width: 88rem; margin: 0 auto; padding: 0 1rem; display: flex; align-items: center; gap: 0.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 1rem; color: var(--foreground); text-decoration: none; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: var(--radius-xl); background: var(--primary); color: var(--primary-foreground); }
.brand-mark .icon { width: 1.15rem; height: 1.15rem; }
.topbar .search { flex: 1; max-width: 34rem; margin-left: auto; }
.topbar-actions { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }
.topbar .search + .topbar-actions { margin-left: 0; }
.icon-btn, .lang { display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; height: 2.25rem; min-width: 2.25rem; padding: 0 0.5rem; border: 1px solid transparent; border-radius: var(--radius); background: none; color: var(--muted-foreground); font: 500 0.8125rem var(--font); text-decoration: none; cursor: pointer; }
.icon-btn:hover, .lang:hover { background: var(--accent); color: var(--foreground); text-decoration: none; }
.icon-btn .icon { width: 1.15rem; height: 1.15rem; }
.i-moon { display: none; } html.dark .i-sun { display: none; } html.dark .i-moon { display: inline; }
.menu-btn { display: none; }

/* Search */
.search { position: relative; }
.search-field { position: relative; display: flex; align-items: center; }
.search-field > .icon { position: absolute; left: 0.75rem; color: var(--muted-foreground); pointer-events: none; }
.search input { width: 100%; height: 2.375rem; padding: 0 2.5rem 0 2.25rem; border: 1px solid var(--input); border-radius: var(--radius); background: var(--card); color: var(--foreground); font: 400 0.9375rem var(--font); box-shadow: var(--shadow-sm); appearance: none; }
.search input::placeholder { color: var(--muted-foreground); opacity: 0.85; }
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 18%, transparent); }
.search input::-webkit-search-cancel-button { display: none; }
.search-key { position: absolute; right: 0.6rem; pointer-events: none; }
.search input:focus ~ .search-key, .search input:not(:placeholder-shown) ~ .search-key { visibility: hidden; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 0.4rem); z-index: 40; max-height: min(70vh, 32rem); overflow: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow); padding: 0.35rem; text-align: left; }
.result { display: block; padding: 0.6rem 0.7rem; border-radius: var(--radius); color: var(--foreground); text-decoration: none; }
.result:hover, .result[aria-selected="true"] { background: var(--brand-soft); text-decoration: none; }
.result-top { display: flex; align-items: baseline; gap: 0.5rem; justify-content: space-between; }
.result-title { font-weight: 600; }
.result-section { flex: none; font-size: 0.75rem; color: var(--muted-foreground); }
.result-snippet { display: block; margin-top: 0.15rem; font-size: 0.8125rem; color: var(--muted-foreground); line-height: 1.5; }
.results mark { background: var(--mark); color: inherit; border-radius: 2px; padding: 0 1px; }
.results-empty { padding: 0.9rem 0.75rem; color: var(--muted-foreground); font-size: 0.875rem; }
.results-foot { display: flex; gap: 0.75rem; padding: 0.5rem 0.7rem 0.25rem; border-top: 1px solid var(--border); margin-top: 0.25rem; font-size: 0.75rem; color: var(--muted-foreground); }

/* Side menu (desktop column; drawer on phones) */
.sidenav { position: fixed; top: var(--top); bottom: 0; left: 0; width: 17rem; overflow-y: auto; padding: 1.25rem 0.75rem 2rem; background: var(--sidebar); border-right: 1px solid var(--border); z-index: 20; }
.sidenav-head { display: none; }
.nav-group + .nav-group { margin-top: 1.25rem; }
.nav-title { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.35rem; padding: 0 0.6rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
.nav-title .icon { width: 0.875rem; height: 0.875rem; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.sidenav li a { position: relative; display: block; padding: 0.4rem 0.6rem 0.4rem 0.75rem; border-radius: var(--radius); color: var(--sidebar-foreground); font-size: 0.875rem; line-height: 1.35; text-decoration: none; }
.sidenav li a:hover { background: var(--sidebar-accent); color: var(--foreground); }
.sidenav li a[aria-current="page"] { background: var(--sidebar-accent); color: var(--foreground); font-weight: 600; }
.sidenav li a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 0.4rem; bottom: 0.4rem; width: 3px; border-radius: 2px; background: var(--primary); }
.is-home .sidenav { display: none; }
.scrim { position: fixed; inset: 0; z-index: 25; background: rgb(15 23 42 / 0.45); }

/* Article layout */
.layout { margin-left: 17rem; display: grid; grid-template-columns: minmax(0, 1fr) 15rem; gap: 2.5rem; max-width: 71rem; padding: 2rem 2.5rem 4rem; }
.layout:not(:has(.toc)) { grid-template-columns: minmax(0, 1fr); }
.article-main { min-width: 0; max-width: 46rem; outline: none; }
/* Polish row 674 (UI/UX): a picture can never widen an article (an inline one, e.g. under a list item, was its file's width). */
.article-main img { max-width: 100%; height: auto; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: 0.8125rem; color: var(--muted-foreground); margin-bottom: 1rem; }
.crumbs a { color: var(--muted-foreground); }
.crumbs .icon { width: 0.875rem; height: 0.875rem; opacity: 0.7; }
.crumbs [aria-current] { color: var(--foreground); }
.article-head { padding-bottom: 1.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.article-head h1 { margin: 0 0 0.6rem; font-size: 1.875rem; font-weight: 600; }
.article-meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; font-size: 0.8125rem; color: var(--muted-foreground); }
.meta-item { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; padding: 0.05rem 0.45rem; border: 1px solid var(--border); border-radius: 999px; background: var(--secondary); color: var(--foreground); font-size: 0.75rem; font-weight: 500; }
.btn { display: inline-flex; align-items: center; gap: 0.45rem; height: 2.25rem; padding: 0 0.9rem; border-radius: var(--radius); font: 500 0.875rem var(--font); text-decoration: none; border: 1px solid transparent; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: color-mix(in oklab, var(--primary) 88%, black); }
html.dark .btn-primary:hover { background: color-mix(in oklab, var(--primary) 85%, white); }
.open-app { margin-top: 1rem; }

/* Prose */
.prose { font-size: 0.96875rem; line-height: 1.7; }
.prose > p, .prose > ul { margin: 0 0 1rem; }
.prose h2 { margin: 2.25rem 0 0.75rem; font-size: 1.3125rem; font-weight: 600; }
.prose h3 { margin: 1.75rem 0 0.5rem; font-size: 1.0625rem; font-weight: 600; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin: 0.25rem 0; }
.prose li::marker { color: var(--muted-foreground); }
.prose strong { font-weight: 600; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 1.25rem; }
.steps > li { position: relative; counter-increment: step; padding: 0 0 0.85rem 2.6rem; margin: 0; min-height: 1.75rem; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0.05rem; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 999px; background: var(--brand-soft); border: 1px solid var(--brand-line); color: var(--primary); font-size: 0.8125rem; font-weight: 600; }
.steps > li > ul { margin: 0.35rem 0 0; padding-left: 1.1rem; }
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 0.86rem; top: 2rem; bottom: 0.15rem; width: 1px; background: var(--border); }
.callout { display: flex; gap: 0.75rem; margin: 1.25rem 0; padding: 0.85rem 1rem; border: 1px solid var(--brand-line); border-radius: var(--radius-xl); background: var(--brand-soft); }
.callout > .icon { width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; color: var(--primary); }
.callout p { margin: 0; }
.callout-title { font-weight: 600; font-size: 0.875rem; }
.callout-note { border-color: var(--border); background: var(--muted); }
.callout-note > .icon { color: var(--muted-foreground); }
.callout-develop { border-style: dashed; }
.callout-warning { border-color: var(--warning-line); background: var(--warning-soft); }
.callout-warning > .icon, .callout-warning .callout-title { color: var(--warning); }
.shot { margin: 1.5rem 0; }
.shot-btn { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--card); box-shadow: var(--shadow); overflow: hidden; cursor: zoom-in; }
.shot-btn img { display: block; width: 100%; height: auto; }
.shot-zoom { position: absolute; right: 0.6rem; bottom: 0.6rem; width: 2rem !important; height: 2rem !important; padding: 0.45rem; border-radius: var(--radius); background: rgb(15 23 42 / 0.65); color: #fff; opacity: 0; transition: opacity 0.15s; }
.shot-btn:hover .shot-zoom, .shot-btn:focus-visible .shot-zoom { opacity: 1; }
.shot figcaption { margin-top: 0.5rem; font-size: 0.8125rem; color: var(--muted-foreground); text-align: center; }
.table { overflow-x: auto; margin: 1rem 0 1.5rem; border: 1px solid var(--border); border-radius: var(--radius-xl); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
th, td { padding: 0.55rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-foreground); }
tr:last-child td { border-bottom: 0; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.pager-link { display: flex; flex-direction: column; gap: 0.2rem; padding: 0.85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-xl); color: var(--foreground); text-decoration: none; }
.pager-link:hover { border-color: var(--brand-line); background: var(--brand-soft); text-decoration: none; }
.pager-link.next { text-align: right; align-items: flex-end; }
.pager-label { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.75rem; color: var(--muted-foreground); }
.pager-title { font-weight: 600; font-size: 0.9375rem; color: var(--primary); }
.toc { position: sticky; top: calc(var(--top) + 2rem); align-self: start; max-height: calc(100vh - var(--top) - 3rem); overflow: auto; font-size: 0.8125rem; }
.toc-title { margin: 0 0 0.5rem; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-foreground); }
.toc ul, .toc-mobile ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a, .toc-mobile a { display: block; padding: 0.3rem 0 0.3rem 0.85rem; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted-foreground); text-decoration: none; line-height: 1.4; }
.toc a:hover, .toc-mobile a:hover { color: var(--foreground); }
.toc a.active { color: var(--primary); border-left-color: var(--primary); font-weight: 500; }
.toc-mobile { display: none; margin: 0 0 1.5rem; border: 1px solid var(--border); border-radius: var(--radius-xl); background: var(--muted); }
.toc-mobile summary { display: flex; align-items: center; gap: 0.5rem; padding: 0.65rem 0.85rem; font-weight: 500; font-size: 0.875rem; cursor: pointer; }
.toc-mobile ul { margin: 0 0.85rem 0.75rem; }

/* Home */
.hero { padding: 3.5rem 1.25rem 3rem; text-align: center; background: radial-gradient(60rem 22rem at 50% -6rem, var(--brand-soft), transparent 70%), var(--background); border-bottom: 1px solid var(--border); }
.hero-in { max-width: 44rem; margin: 0 auto; }
.hero h1 { margin: 0; font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 600; }
.hero-sub { margin: 0.5rem 0 1.75rem; color: var(--muted-foreground); font-size: 1.0625rem; }
.search-hero input { height: 3.5rem; padding-left: 3rem; font-size: 1.0625rem; border-radius: var(--radius-xl); box-shadow: var(--shadow); }
.search-hero .search-field > .icon { left: 1.1rem; width: 1.25rem; height: 1.25rem; }
.search-hero .search-key { right: 1rem; }
.search-keys { margin: 0.75rem 0 0; font-size: 0.8125rem; color: var(--muted-foreground); }
.home-in { max-width: 72rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.block { margin-bottom: 2.75rem; }
.block > h2 { margin: 0 0 1rem; font-size: 1.125rem; font-weight: 600; }
.grid { display: grid; gap: 0.875rem; }
.grid-popular { grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); }
.grid-roles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-topics { display: block; columns: 2 16rem; column-gap: 0.875rem; }
.grid-topics > .topic { break-inside: avoid; margin-bottom: 0.875rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm); }
.card-link { display: flex; align-items: flex-start; gap: 0.85rem; padding: 1rem; color: var(--foreground); text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.card-link:hover, .role:hover { border-color: var(--brand-line); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.card-icon { display: grid; place-items: center; flex: none; width: 2.25rem; height: 2.25rem; border-radius: var(--radius-xl); background: var(--brand-soft); color: var(--primary); }
.card-body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.card-title { font-weight: 600; line-height: 1.35; }
.card-text { font-size: 0.8125rem; color: var(--muted-foreground); line-height: 1.5; }
.card-arrow { margin-left: auto; margin-top: 0.15rem; color: var(--muted-foreground); opacity: 0; transition: opacity 0.15s; }
.card-link:hover .card-arrow { opacity: 1; color: var(--primary); }
.role { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.25rem; color: var(--foreground); text-decoration: none; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.role-icon { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: var(--radius-xl); background: var(--primary); color: var(--primary-foreground); }
.role-icon .icon { width: 1.35rem; height: 1.35rem; }
.role-name { font-weight: 600; font-size: 1.0625rem; margin-top: 0.25rem; }
.role-cta { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: auto; padding-top: 0.25rem; font-size: 0.8125rem; font-weight: 500; color: var(--primary); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 2rem; align-items: start; }
.topic { padding: 1rem 1.1rem; }
.topic-title { display: flex; align-items: center; gap: 0.65rem; margin: 0 0 0.6rem; font-size: 0.9375rem; font-weight: 600; }
.topic-title .card-icon { width: 2rem; height: 2rem; }
.topic-count { margin-left: auto; font-size: 0.75rem; font-weight: 400; color: var(--muted-foreground); }
.topic ul { list-style: none; margin: 0; padding: 0; }
.topic li a { display: block; padding: 0.3rem 0; font-size: 0.875rem; }
.topic details summary { margin-top: 0.25rem; font-size: 0.8125rem; color: var(--muted-foreground); cursor: pointer; }
.news { position: relative; padding: 1.1rem 1.15rem; }
.news-icon { position: absolute; right: 1rem; top: 1.1rem; color: var(--primary); }
.news-date { margin: 0 0 0.5rem; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted-foreground); }
.news ul { margin: 0; padding-left: 1.1rem; font-size: 0.875rem; }
.news li { margin: 0.4rem 0; }
.news-all { display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.75rem; font-size: 0.8125rem; font-weight: 500; }

/* Picture viewer */
.lightbox { width: min(96vw, 90rem); max-height: 94vh; padding: 0; border: 0; border-radius: var(--radius-xl); background: var(--card); box-shadow: var(--shadow); }
.lightbox::backdrop { background: rgb(2 6 23 / 0.75); }
.lightbox img { display: block; width: 100%; height: auto; max-height: 94vh; object-fit: contain; }
.lightbox-close { position: absolute; top: 0.5rem; right: 0.5rem; background: var(--card); box-shadow: var(--shadow-sm); }

/* Tablet and phone */
@media (max-width: 1180px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .toc-mobile { display: block; }
}
@media (max-width: 980px) {
  .menu-btn { display: inline-flex; }
  /* Polish row 710 (set678): the closed menu is hidden, not only moved off screen, so Tab skips its links; it hides after the slide-out. */
  .sidenav, .is-home .sidenav { display: block; top: 0; width: min(20rem, 86vw); z-index: 50; transform: translateX(-102%); visibility: hidden; transition: transform 0.2s ease, visibility 0s linear 0.2s; box-shadow: var(--shadow); padding-top: 0.5rem; }
  .sidenav.open { transform: none; visibility: visible; transition: transform 0.2s ease, visibility 0s; }
  .sidenav-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0 0.75rem 0.6rem; margin-bottom: 0.75rem; border-bottom: 1px solid var(--border); font-weight: 600; }
  .scrim { z-index: 45; }
  .layout { margin-left: 0; padding: 1.5rem 1.25rem 3rem; }
  .grid-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .topbar-in { padding: 0 0.5rem; gap: 0.35rem; }
  .is-article .brand span:last-child { display: none; }
  .topbar .search { max-width: none; }
  .topbar .search-key, .lang span { display: none; }
  .results { position: fixed; left: 0.5rem; right: 0.5rem; top: calc(var(--top) + 0.25rem); max-height: calc(100vh - var(--top) - 1rem); }
  .search-hero .results { position: absolute; left: 0; right: 0; top: calc(100% + 0.4rem); }
  .search-keys { display: none; }
  .hero { padding: 2.25rem 1rem 2rem; }
  .search-hero input { height: 3.1rem; font-size: 1rem; }
  .home-in { padding: 1.75rem 1rem 3rem; }
  .grid-popular { grid-template-columns: minmax(0, 1fr); }
  /* MB-207 (UX_AUDIT F2): on a phone "On this page" stays at the top while reading; open, its list scrolls inside the box; a tap on a heading closes it (help.js). */
  .toc-mobile { position: sticky; top: calc(var(--top) + 0.5rem); z-index: 25; background: var(--background); box-shadow: 0 2px 6px rgb(0 0 0 / 0.08); }
  .toc-mobile[open] ul { max-height: 55vh; overflow-y: auto; }
  .toc-mobile summary { min-height: 2.5rem; }
  .toc-mobile a { padding-top: 0.6rem; padding-bottom: 0.6rem; }
  .grid-roles { gap: 0.6rem; }
  .role { padding: 1rem; }
  .article-head h1 { font-size: 1.5rem; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager-link.next { text-align: left; align-items: flex-start; }
  .shot-zoom { opacity: 1; }
  /* Polish row 675 (UI/UX): phone taps of 44 px: menu links, and the Menu, light/dark and close buttons (desktop unchanged). */
  .sidenav li a { display: flex; align-items: center; min-height: 2.75rem; }
  .menu-btn, .theme-btn, .close-btn { height: 2.75rem; min-width: 2.75rem; }
  /* Polish row 710 (set678): the other phone taps of 44 px: the brand link, the top-bar search, Open in the app, "N more" and See all. */
  .brand { min-height: 2.75rem; }
  .topbar .search input { height: 2.75rem; }
  .open-app { height: 2.75rem; }
  .topic details summary { min-height: 2.75rem; line-height: 2.75rem; }
  .news-all { min-height: 2.75rem; }
  /* No keyboard shortcut on a phone: the "/" key hint gives its room to the placeholder. */
  .search-hero .search-key { display: none; }
  .search-hero input { padding-right: 1rem; }
  /* Polish row 710 (set678): Enlarge shows the picture at its own width on a phone, scrolling sideways and down; Close stays in view. */
  .lightbox { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; overflow: auto; }
  .lightbox img { width: auto; max-width: none; max-height: none; }
  .lightbox-close { position: fixed; z-index: 1; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
@media print { .topbar, .sidenav, .toc, .toc-mobile, .pager, .open-app, .shot-zoom { display: none !important; } .layout { margin: 0; padding: 0; display: block; } }

/* MB-318: a code block to paste (a script), with its Copy button. */
.code-block { position: relative; margin: 1.25rem 0; }
.code-block pre { margin: 0; padding: 0.85rem 1rem; padding-top: 2.4rem; overflow-x: auto; background: var(--secondary); border: 1px solid var(--border); border-radius: var(--radius-xl); font-size: 0.8125rem; line-height: 1.5; }
.code-block pre code { background: none; border: 0; padding: 0; white-space: pre; }
.code-copy { position: absolute; top: 0.4rem; right: 0.4rem; min-height: 40px; min-width: 64px; padding: 0 0.75rem; border: 1px solid var(--border); border-radius: 8px; background: var(--background); color: inherit; font: inherit; font-size: 0.8125rem; cursor: pointer; }
.code-copy:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
