/* Saan project site: "Saan Glass". Decisions: design/design-system.md (section 9 overrides the flat rules of sections 1, 4 and 5).
   Order: fonts, tokens, scene, base, glass surfaces, header, page structure, components, pages, fallbacks, print.
   Fonts are self-hosted (assets/fonts). No external request. */
@font-face { font-family: "Noto Sans Thai Looped"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/NotoSansThaiLooped-400.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Thai Looped"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/NotoSansThaiLooped-500.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Thai Looped"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/NotoSansThaiLooped-600.woff2") format("woff2"); }
@font-face { font-family: "Noto Sans Thai Looped"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/NotoSansThaiLooped-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/IBMPlexMono-Regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/IBMPlexMono-Medium.woff2") format("woff2"); }

/* ---------- tokens ---------- */
:root {
    --background: #F5F5EF;
    --surface: #FFFDF5;
    --text: #202D27;
    --muted: #526157;
    --border: #C8D2C7;
    --border-strong: #758579;
    --primary: #163B30;
    --primary-hover: #0E2C23;
    --on-primary: #FFFDF5;
    --accent: #D9E6AC;
    --on-accent: #163B30;
    --link: #155E4B;
    --visited: #654680;
    --focus: #005FCC;
    --success: #21633F;
    --warning: #805800;
    --danger: #B83317;
    --info: #215B80;
    --font-body: "Noto Sans Thai Looped", "Leelawadee UI", Tahoma, Thonburi, sans-serif;
    --font-mono: "IBM Plex Mono", Consolas, monospace;
    --gutter: 16px;
    /* glass tokens (section 9): the scene fields, three fills, the edge and the shadows */
    --scene-lime: rgba(217, 230, 172, .42);
    --scene-green: rgba(22, 59, 48, .16);
    --scene-peach: rgba(236, 170, 132, .30);
    --scene-teal: rgba(70, 160, 168, .20);
    --glass: rgba(255, 253, 245, .66);
    --glass-strong: rgba(255, 253, 245, .88);
    --sheet: rgba(255, 253, 245, .97);
    --tint: rgba(255, 253, 245, .64);
    --control: rgba(255, 255, 255, .82);
    --code-bg: rgba(255, 255, 255, .78);
    --glass-border: rgba(255, 255, 255, .62);
    --glass-line: rgba(22, 59, 48, .12);
    --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .72);
    --glass-shadow: 0 8px 32px rgba(22, 59, 48, .12);
    --raised-shadow: 0 16px 48px rgba(22, 59, 48, .20);
    --chip: rgba(22, 59, 48, .10);
    --inset: rgba(255, 255, 255, .58);
    --blur: 18px;
    --r-card: 16px;
    --r-panel: 20px;
    --r-ctl: 12px;
    --shadow-float: var(--raised-shadow);
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --background: #111915; --surface: #19251F; --text: #EDF2EA; --muted: #B2BEB4; --border: #42574B; --border-strong: #84998B;
        --primary: #A8CCB9; --primary-hover: #C0DECE; --on-primary: #111915; --accent: #CCD991; --on-accent: #111915; --link: #9FD8BE; --visited: #D0B8EB;
        --focus: #91BDFF; --success: #93D3A4; --warning: #E8C66A; --danger: #FFAA96; --info: #A9D2F4;
        --scene-lime: rgba(204, 217, 145, .11); --scene-green: rgba(70, 150, 118, .24); --scene-peach: rgba(214, 120, 88, .13); --scene-teal: rgba(60, 150, 172, .18);
        --glass: rgba(25, 37, 31, .60); --glass-strong: rgba(25, 37, 31, .86); --sheet: rgba(25, 37, 31, .97); --tint: rgba(25, 37, 31, .68); --control: rgba(10, 17, 13, .55); --code-bg: rgba(10, 17, 13, .6);
        --glass-border: rgba(255, 255, 255, .14); --glass-line: rgba(255, 255, 255, .10); --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .10);
        --glass-shadow: 0 8px 32px rgba(0, 0, 0, .35); --raised-shadow: 0 16px 48px rgba(0, 0, 0, .5); --chip: rgba(168, 204, 185, .14); --inset: rgba(255, 255, 255, .05);
    }
}
:root[data-theme="dark"] {
    --background: #111915; --surface: #19251F; --text: #EDF2EA; --muted: #B2BEB4; --border: #42574B; --border-strong: #84998B;
    --primary: #A8CCB9; --primary-hover: #C0DECE; --on-primary: #111915; --accent: #CCD991; --on-accent: #111915; --link: #9FD8BE; --visited: #D0B8EB;
    --focus: #91BDFF; --success: #93D3A4; --warning: #E8C66A; --danger: #FFAA96; --info: #A9D2F4;
    --scene-lime: rgba(204, 217, 145, .11); --scene-green: rgba(70, 150, 118, .24); --scene-peach: rgba(214, 120, 88, .13); --scene-teal: rgba(60, 150, 172, .18);
    --glass: rgba(25, 37, 31, .60); --glass-strong: rgba(25, 37, 31, .86); --sheet: rgba(25, 37, 31, .97); --tint: rgba(25, 37, 31, .68); --control: rgba(10, 17, 13, .55); --code-bg: rgba(10, 17, 13, .6);
    --glass-border: rgba(255, 255, 255, .14); --glass-line: rgba(255, 255, 255, .10); --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .10);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, .35); --raised-shadow: 0 16px 48px rgba(0, 0, 0, .5); --chip: rgba(168, 204, 185, .14); --inset: rgba(255, 255, 255, .05);
}

:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

/* ---------- scene: one fixed layer behind everything, painted once, never scrolls ---------- */
html { background: var(--background); -webkit-text-size-adjust: 100%; }
body { margin: 0; position: relative; isolation: isolate; min-height: 100vh; background: transparent; color: var(--text); font: 400 1.125rem/1.75 var(--font-body); word-break: normal; overflow-wrap: break-word;
    padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
body::before {
    content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(52vmax 44vmax at 6% 4%, var(--scene-lime), transparent 62%),
        radial-gradient(48vmax 40vmax at 96% 10%, var(--scene-teal), transparent 62%),
        radial-gradient(56vmax 46vmax at 88% 104%, var(--scene-peach), transparent 64%),
        radial-gradient(46vmax 38vmax at -4% 92%, var(--scene-green), transparent 62%),
        var(--background);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
h1, h2, h3, h4 { font-weight: 600; color: var(--text); margin: 0; text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
h1 { font-size: 1.75rem; line-height: 1.4; }
h2 { font-size: 1.5rem; line-height: 1.5; }
h3 { font-size: 1.3125rem; line-height: 1.5; }
h4 { font-size: 1.25rem; line-height: 1.5; }
p { margin: 0 0 24px; }
a { color: var(--link); text-decoration: underline; text-underline-offset: .2em; text-decoration-skip-ink: auto; }
a:visited { color: var(--visited); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; height: auto; }
code, pre, .hash { font-family: var(--font-mono); font-size: .9375rem; line-height: 1.65; }
code, .hash { background: var(--code-bg); border: 1px solid var(--glass-line); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
/* short inline code (up to about 24 characters, set by the build) stays on one line; code.long and .hash may wrap anywhere */
code:not(.long):not(.hash) { white-space: nowrap; }
ul, ol { margin: 0 0 24px; padding-left: 1.5rem; }
li { margin-bottom: 4px; }
time { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 0; z-index: 60; background: var(--primary); color: var(--on-primary); padding: 12px 16px; border-radius: 0 0 var(--r-ctl) 0; }
.skip:focus { left: 8px; top: 8px; border-radius: var(--r-ctl); }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.meta { color: var(--muted); font-size: .9375rem; line-height: 1.6; }
.meta-card { display: block; margin-top: 16px; padding: 12px 16px; border-radius: var(--r-ctl); background: var(--tint); border: 1px solid var(--glass-border); }
.lead { font-size: 1.125rem; line-height: 1.7; }
/* icons: one family (tools/lib/icons.php), sized by the container */
.icon { width: 1.5rem; height: 1.5rem; flex: none; display: inline-block; vertical-align: middle; }
.ic-chip { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none; border-radius: var(--r-ctl); background: var(--chip); color: var(--primary); border: 1px solid var(--glass-line); }
.ic-chip .icon { width: 1.5rem; height: 1.5rem; }
.ic-chip.sm { width: 36px; height: 36px; border-radius: 10px; }
.ic-chip.sm .icon { width: 1.25rem; height: 1.25rem; }

/* ---------- glass surfaces: three depths (chrome, card, raised); .glass blurs, .tint is the plain translucent fill for nested things ---------- */
.glass { background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi), var(--glass-shadow); -webkit-backdrop-filter: blur(var(--blur)) saturate(140%); backdrop-filter: blur(var(--blur)) saturate(140%); }
.tint { background: var(--tint); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi), var(--glass-shadow); }
.raised { box-shadow: var(--glass-hi), var(--raised-shadow); }
@media (max-width: 639px) { :root { --blur: 12px; } }

/* ---------- header ---------- */
.site-head { position: relative; z-index: 40; border-width: 0 0 1px; border-radius: 0 0 var(--r-panel) var(--r-panel); padding-top: env(safe-area-inset-top); }
.utility { font-size: .9375rem; }
.utility .wrap { display: flex; align-items: center; justify-content: space-between; gap: 0 16px; min-height: 48px; flex-wrap: wrap; }
.utility ul { display: flex; gap: 0 8px; list-style: none; margin: 0; padding: 0; }
.utility li { margin: 0; }
.utility a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--text); }
.utility a:visited { color: var(--text); }
.theme-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: var(--tint); border: 1px solid var(--glass-line); }
.theme-switch[hidden] { display: none; }
.theme-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; min-height: 44px; min-width: 44px; padding: 0 14px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--text); cursor: pointer; transition: background-color .18s, border-color .18s; }
.theme-switch button .icon { width: 1.25rem; height: 1.25rem; }
.theme-switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--primary); font-weight: 600; }
.theme-switch button:hover { text-decoration: underline; }
.brandrow .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; padding-top: 6px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-height: 48px; }
.brand:visited { color: var(--text); }
.brand img { height: 44px; width: auto; display: block; }
.brand-text { display: block; line-height: 1.4; }
.brand-name { font-weight: 700; font-size: 1.5rem; display: block; }
.tagline { font-size: .9375rem; color: var(--muted); display: none; }
.site-search { position: relative; display: flex; flex: 1 1 100%; order: 3; }
.search-ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; display: inline-flex; }
.site-search input { flex: 1; min-width: 0; min-height: 48px; font: inherit; font-size: 1rem; padding: 6px 12px 6px 44px; color: var(--text); background: var(--control); border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.site-search button { min-height: 48px; padding: 0 18px; font: inherit; font-weight: 600; font-size: 1rem; background: var(--primary); color: var(--on-primary); border: 1px solid var(--primary); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; cursor: pointer; }
.site-search button:hover { background: var(--primary-hover); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.navbar { border-top: 1px solid var(--glass-line); }
.nav-wide { display: none; }
.nav { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 6px 0 8px; gap: 4px; }
.nav li { margin: 0; }
.nav a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; color: var(--text); text-decoration: none; font-size: 1rem; line-height: 1.5; border-radius: 999px; border: 1px solid transparent; transition: background-color .18s; }
.nav a:visited { color: var(--text); }
.nav a .icon { width: 1.25rem; height: 1.25rem; color: var(--primary); }
.nav a:hover { background: var(--tint); border-color: var(--glass-line); }
.nav a[aria-current="page"] { font-weight: 600; background: var(--accent); color: var(--on-accent); border-color: var(--primary); }
.nav a[aria-current="page"] .icon { color: var(--on-accent); }
.nav-narrow { margin-left: auto; }
.nav-narrow summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; min-width: 44px; min-height: 48px; padding: 0 16px; font-size: 1rem; font-weight: 600; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); background: var(--control); color: var(--text); cursor: pointer; }
.nav-narrow summary::-webkit-details-marker { display: none; }
.nav-narrow[open] summary { background: var(--accent); color: var(--on-accent); }
/* the phone menu: a full-width sheet under the header */
.nav-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 50; list-style: none; margin: 0; padding: 8px var(--gutter) calc(16px + env(safe-area-inset-bottom)); max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); overflow-y: auto;
    background: var(--sheet); border: 1px solid var(--glass-border); border-top: 0; border-radius: 0 0 var(--r-panel) var(--r-panel); box-shadow: var(--glass-hi), 0 10px 24px rgba(22, 59, 48, .12); }
.nav-list li { margin: 0; }
.nav-list a { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 0 12px; color: var(--text); text-decoration: none; font-size: 1.0625rem; border-radius: var(--r-ctl); }
.nav-list a .icon { color: var(--primary); }
.nav-list a:visited { color: var(--text); }
.nav-list a[aria-current="page"] { font-weight: 600; background: var(--accent); color: var(--on-accent); }
.nav-list a[aria-current="page"] .icon { color: var(--on-accent); }
@media (max-width: 799px) {
    .brand img { height: 40px; }
    .brandrow .brand { flex: 1; }
    .navbar { display: none; }
    .theme-switch button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .theme-switch button { padding: 0; }
}
@media (min-width: 800px) {
    .tagline { display: block; }
    .site-search { flex: 0 1 340px; order: 0; margin-left: auto; }
    .brandrow .wrap { min-height: 80px; flex-wrap: nowrap; }
    .nav-narrow { display: none; }
    .nav-wide { display: block; }
}

/* tablet portrait: the six navigation items stay on one row */
@media (min-width: 800px) and (max-width: 959px) { .nav { gap: 2px; } .nav a { padding: 0 10px; gap: 6px; font-size: .9375rem; } }

/* ---------- breadcrumbs ---------- */
.crumbs { padding: 16px 0 0; font-size: .9375rem; color: var(--muted); }
.crumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.crumbs li { margin: 0; display: inline-flex; align-items: center; }
.crumbs li + li::before { content: "/"; padding: 0 8px; color: var(--muted); }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.crumbs [aria-current="page"] { color: var(--text); }

/* ---------- page structure ---------- */
main:focus { outline: 0; }
.page { padding-top: 8px; padding-bottom: 48px; }
.page-head { padding: 8px 0 24px; max-width: 800px; }
.page-head h1 { margin-bottom: 12px; }
.page-head p:last-child { margin-bottom: 0; }
.head-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 14px; border-radius: var(--r-card); background: var(--tint); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi), var(--glass-shadow); color: var(--primary); }
.head-icon .icon { width: 1.75rem; height: 1.75rem; }
.section { margin-top: 32px; }
.section > h2 { margin-bottom: 16px; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; margin-bottom: 16px; }
.section-head h2, .section > h2, .defs h2, .area > h2, .area-head h2 { display: flex; align-items: center; gap: 12px; margin: 0; }
.section > h2 { margin-bottom: 16px; }
.h-ic { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--chip); color: var(--primary); border: 1px solid var(--glass-line); }
.h-ic .icon { width: 1.375rem; height: 1.375rem; }
.section-head a { font-size: 1rem; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.panel { border-radius: var(--r-panel); padding: 20px; }
.cols { display: grid; gap: 32px; }
@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 960px) {
    :root { --gutter: 32px; }
    .cols.main-side { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 24px 40px; }
}
@media (min-width: 640px) {
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.375rem; }
    body { line-height: 1.8; }
    .lead { font-size: 1.25rem; }
    .section { margin-top: 48px; }
    .panel { padding: 24px 28px; }
}
/* the article panel: nearly opaque glass so that long reading stays comfortable (fill opacity .86 and up) */
.article-pane { background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--r-panel); box-shadow: var(--glass-hi), var(--glass-shadow); padding: 20px 18px; -webkit-backdrop-filter: blur(var(--blur)) saturate(140%); backdrop-filter: blur(var(--blur)) saturate(140%); }
@media (min-width: 640px) { .article-pane { padding: 28px 32px; } }

/* ---------- buttons, chips ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px 22px; font: 600 1rem/1.5 var(--font-body); text-decoration: none; border-radius: var(--r-ctl); border: 1px solid var(--primary); background: var(--primary); color: var(--on-primary); cursor: pointer; box-shadow: 0 2px 10px rgba(22, 59, 48, .18); transition: background-color .18s, transform .18s; }
.btn:visited { color: var(--on-primary); }
.btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.secondary { background: var(--tint); color: var(--link); border-color: var(--border-strong); box-shadow: none; }
.btn.secondary:visited { color: var(--link); }
.btn.secondary:hover { background: var(--glass-strong); }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.link-more { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: .9375rem; font-weight: 600; line-height: 1.5; border-radius: 999px; border: 1px solid currentColor; background: var(--glass-strong); text-decoration: none; white-space: normal; }
.badge .icon { width: 1rem; height: 1rem; }
.badge:visited { color: inherit; }
.badge.beta { color: var(--info); }
.badge.experimental { color: var(--warning); }
.badge.stable { color: var(--success); }
a.badge:hover { text-decoration: underline; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: .9375rem; font-weight: 600; line-height: 1.7; }
.tag .icon { width: 1rem; height: 1rem; }
.draft-mark { display: inline-block; padding: 0 10px; border-radius: 999px; border: 1px solid var(--warning); color: var(--warning); font-size: .9375rem; font-weight: 600; line-height: 1.6; background: var(--glass-strong); }
.notice { background: var(--tint); border: 1px solid var(--glass-border); border-left: 4px solid var(--info); border-radius: 14px; padding: 16px 20px; margin: 0 0 24px; box-shadow: var(--glass-hi); }
.notice h2, .notice h3, .notice .notice-title { font-size: 1.125rem; font-weight: 600; margin: 0 0 4px; border: 0; padding: 0; }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.notice.warning { border-left-color: var(--warning); }
.notice.danger, .notice.err { border-left-color: var(--danger); }
.notice.success, .notice.ok { border-left-color: var(--success); }
.notice[tabindex="-1"]:focus { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- lists as rows, news cover art, pagers, filters ---------- */
.rows { list-style: none; margin: 0; padding: 0; }
.row { padding: 16px 0; border-top: 1px solid var(--glass-line); margin: 0; }
.row:first-child { border-top: 0; padding-top: 0; }
.row:last-child { padding-bottom: 0; }
.row-title { font-size: 1.25rem; line-height: 1.5; font-weight: 600; margin: 0 0 4px; }
.row-title a { color: var(--text); text-decoration-color: var(--border-strong); }
.row-title a:hover { color: var(--link); }
.row-meta { color: var(--muted); font-size: .9375rem; line-height: 1.6; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.row p { margin: 0; }
.news-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 16px; align-items: start; }
.news-row .row-title { font-size: 1.25rem; }
.news-body { min-width: 0; }
@media (min-width: 640px) { .news-row { grid-template-columns: 96px minmax(0, 1fr); gap: 4px 20px; } .news-row .row-title { font-size: 1.375rem; } }
.cover { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--glass-border); background: var(--background); }
.cover::before { content: ""; position: absolute; inset: 0; }
.cover-release { --c1: rgba(217, 230, 172, .95); --c2: rgba(70, 160, 168, .45); --cb: #DCE9D6; }
.cover-security { --c1: rgba(236, 170, 132, .90); --c2: rgba(22, 59, 48, .35); --cb: #F1DDD0; }
.cover-project { --c1: rgba(70, 160, 168, .65); --c2: rgba(217, 230, 172, .90); --cb: #D9ECE6; }
.cover-docs { --c1: rgba(22, 59, 48, .30); --c2: rgba(217, 230, 172, .90); --cb: #E4EDDD; }
.cover::before { background: radial-gradient(90% 90% at 10% 8%, var(--c1), transparent 62%), radial-gradient(80% 80% at 96% 100%, var(--c2), transparent 66%), var(--cb); }
.cover-disc { position: absolute; inset: 0; margin: auto; display: flex; align-items: center; justify-content: center; width: 56%; height: 56%; border-radius: 50%; background: rgba(255, 253, 245, .88); color: #163B30; border: 1px solid rgba(255, 255, 255, .8); box-shadow: 0 4px 14px rgba(22, 59, 48, .18); }
.cover-disc .icon { width: 52%; height: 52%; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .cover-release { --c1: rgba(204, 217, 145, .55); --c2: rgba(60, 150, 172, .42); --cb: #1a2923; }
    :root:not([data-theme="light"]) .cover-security { --c1: rgba(226, 130, 98, .55); --c2: rgba(70, 150, 118, .28); --cb: #2a211d; }
    :root:not([data-theme="light"]) .cover-project { --c1: rgba(60, 150, 172, .55); --c2: rgba(204, 217, 145, .38); --cb: #17282a; }
    :root:not([data-theme="light"]) .cover-docs { --c1: rgba(70, 150, 118, .45); --c2: rgba(204, 217, 145, .38); --cb: #1b2a22; }
    :root:not([data-theme="light"]) .cover-disc { background: rgba(25, 37, 31, .9); color: #A8CCB9; border-color: rgba(255, 255, 255, .22); }
}
:root[data-theme="dark"] .cover-release { --c1: rgba(204, 217, 145, .55); --c2: rgba(60, 150, 172, .42); --cb: #1a2923; }
:root[data-theme="dark"] .cover-security { --c1: rgba(226, 130, 98, .55); --c2: rgba(70, 150, 118, .28); --cb: #2a211d; }
:root[data-theme="dark"] .cover-project { --c1: rgba(60, 150, 172, .55); --c2: rgba(204, 217, 145, .38); --cb: #17282a; }
:root[data-theme="dark"] .cover-docs { --c1: rgba(70, 150, 118, .45); --c2: rgba(204, 217, 145, .38); --cb: #1b2a22; }
:root[data-theme="dark"] .cover-disc { background: rgba(25, 37, 31, .9); color: #A8CCB9; border-color: rgba(255, 255, 255, .22); }
.cover.wide { aspect-ratio: 21 / 6; }
.cover.wide .cover-disc { width: auto; height: 78%; aspect-ratio: 1; }
.empty { color: var(--muted); }
.pager-nav { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 32px 0 0; padding: 0; }
.pager-nav li { margin: 0; }
.pager-nav a, .pager-nav span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); text-decoration: none; background: var(--tint); }
.pager-nav [aria-current="page"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0 0 24px; padding: 0; }
.filters li { margin: 0; }
.filters a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--tint); text-decoration: none; color: var(--text); }
.filters a:visited { color: var(--text); }
.filters a .icon { width: 1.125rem; height: 1.125rem; color: var(--primary); }
.filters a[aria-current="page"] { background: var(--accent); color: var(--on-accent); font-weight: 600; border-color: var(--primary); }
.filters a[aria-current="page"] .icon { color: var(--on-accent); }

/* ---------- entry cards ---------- */
.entries { display: grid; gap: 16px; list-style: none; margin: 0; padding: 0; }
.entry { margin: 0; background: var(--tint); border: 1px solid var(--glass-border); border-radius: var(--r-card); box-shadow: var(--glass-hi), var(--glass-shadow); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.entry .ic-chip { margin-bottom: 6px; }
.entry h3 { font-size: 1.25rem; margin: 0 0 2px; }
.entry p { margin: 0 0 8px; font-size: 1rem; line-height: 1.7; }
.entry p:last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: no-preference) {
    .entry, .cap-card, .stat { transition: transform .2s ease, box-shadow .2s ease; }
    .entry:hover, .cap-card:hover { transform: translateY(-2px); }
}
@media (min-width: 640px) { .entries.three { grid-template-columns: repeat(3, 1fr); } .entries.four { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .entries.four { grid-template-columns: repeat(4, 1fr); } }

/* ---------- facts ---------- */
.facts { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0 0 24px; }
.facts dt { font-size: .9375rem; color: var(--muted); margin-top: 12px; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
@media (min-width: 640px) {
    .facts { grid-template-columns: 11rem minmax(0, 1fr); column-gap: 16px; }
    .facts dt, .facts dd { padding: 8px 0; margin: 0; border-top: 1px solid var(--glass-line); }
    .facts dt:first-of-type, .facts dt:first-of-type + dd { border-top: 0; }
}
.facts-list { display: grid; grid-template-columns: minmax(0, 1fr); margin: 0 0 24px; border: 1px solid var(--glass-border); border-radius: var(--r-card); background: var(--tint); padding: 4px 16px; }
.facts-list dt { margin: 12px 0 0; font-size: .9375rem; color: var(--muted); }
.facts-list dd { margin: 0 0 12px; overflow-wrap: anywhere; }
@media (min-width: 640px) {
    .facts-list { grid-template-columns: 12rem minmax(0, 1fr); column-gap: 16px; }
    .facts-list dt, .facts-list dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--glass-line); }
    .facts-list dt:nth-last-of-type(1), .facts-list dd:last-of-type { border-bottom: 0; }
}

/* ---------- tables: glass rows; labelled cards on phones ---------- */
.scroll-x { overflow-x: auto; max-width: 100%; margin: 0 0 24px; border: 1px solid var(--glass-border); border-radius: var(--r-card); background: var(--tint); box-shadow: var(--glass-hi); }
.scroll-x:focus-visible, .cmd pre:focus-visible { outline-offset: 0; }
.wtable { border-collapse: collapse; width: 100%; min-width: 30rem; }
.wtable th, .wtable td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--glass-line); line-height: 1.6; font-size: 1rem; }
.wtable thead th { background: var(--chip); font-weight: 600; }
.wtable tbody tr:last-child td { border-bottom: 0; }
.rowtable { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0 0 24px; background: var(--tint); border: 1px solid var(--glass-border); border-radius: var(--r-card); box-shadow: var(--glass-hi), var(--glass-shadow); overflow: hidden; }
.rowtable th, .rowtable td { padding: 12px 16px; text-align: left; vertical-align: top; border-top: 1px solid var(--glass-line); font-size: 1rem; line-height: 1.6; }
.rowtable thead th { background: var(--chip); font-weight: 600; border-top: 0; }
.rowtable td p { margin: 0; }
.rowtable .sha-row td { border-top: 0; padding-top: 0; }
@media (min-width: 720px) { .rowtable.files td:nth-child(4) { white-space: nowrap; } }
.fname { display: inline-flex; align-items: center; gap: 10px; }
.fname .icon.kind { width: 1.375rem; height: 1.375rem; color: var(--primary); }
@media (max-width: 719px) {
    .rowtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .rowtable, .rowtable tbody, .rowtable tr, .rowtable td { display: block; width: 100%; }
    .rowtable { background: transparent; border: 0; box-shadow: none; overflow: visible; border-radius: 0; }
    .rowtable tr { background: var(--tint); border: 1px solid var(--glass-border); border-radius: var(--r-card); padding: 12px 16px; margin-bottom: 12px; box-shadow: var(--glass-hi), var(--glass-shadow); }
    .rowtable td { border: 0; padding: 4px 0; }
    .rowtable td[data-label]::before { content: attr(data-label); display: block; font-size: .9375rem; color: var(--muted); }
    .rowtable.files tr:not(.sha-row) { margin-bottom: 0; border-bottom: 0; border-radius: var(--r-card) var(--r-card) 0 0; box-shadow: none; }
    .rowtable.files tr.sha-row { margin-top: 0; padding-top: 0; border-top: 0; border-radius: 0 0 var(--r-card) var(--r-card); }
}
.sha { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.sha .hash { flex: 1 1 18rem; min-width: 0; }
.copy { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; font: 600 1rem/1.5 var(--font-body); color: var(--link); background: var(--control); border: 1px solid var(--border-strong); border-radius: var(--r-ctl); cursor: pointer; }
.copy .icon { width: 1.125rem; height: 1.125rem; }
.copy:hover { background: var(--glass-strong); }
.copy[hidden] { display: none; }

/* ---------- command blocks ---------- */
.cmd { margin: 0 0 24px; }
.cmd pre { margin: 0; padding: 12px 16px; overflow-x: auto; max-width: 100%; background: var(--code-bg); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-ctl); white-space: pre; }
.cmd pre code { padding: 0; border: 0; background: transparent; overflow-wrap: normal; font-size: .9375rem; }
.cmd .copy { margin-top: 8px; }

/* ---------- screenshots in simple frames ---------- */
.shot { margin: 0 0 24px; min-width: 0; }
.shot-frame { display: block; border: 1px solid var(--glass-border); border-radius: 14px; overflow: hidden; background: var(--glass-strong); box-shadow: var(--glass-hi), var(--glass-shadow); }
.shot-frame::before { content: ""; display: block; height: 22px; border-bottom: 1px solid var(--glass-line); background:
    radial-gradient(circle at 13px 11px, var(--border-strong) 3.5px, transparent 4px), radial-gradient(circle at 28px 11px, var(--border-strong) 3.5px, transparent 4px), radial-gradient(circle at 43px 11px, var(--border-strong) 3.5px, transparent 4px), var(--tint); }
.shot-frame img { display: block; width: 100%; height: auto; }
.shot-frame:hover { border-color: var(--link); }
.shot figcaption { margin-top: 10px; color: var(--muted); font-size: .9375rem; line-height: 1.6; }
.shot.phone { max-width: 240px; }
.shot.phone .shot-frame { border-radius: 26px; padding: 6px; background: #1d2c25; border-color: rgba(255, 255, 255, .22); }
.shot.phone .shot-frame::before { display: none; }
.shot.phone .shot-frame img { border-radius: 20px; }
.shot.crop .shot-frame img { aspect-ratio: 16 / 9; object-fit: cover; object-position: top left; }
.shots { display: grid; gap: 24px; margin: 20px 0 8px; align-items: start; }
@media (min-width: 720px) { .shots.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.shots .shot { margin: 0; }

/* ---------- home ---------- */
.intro { padding: 24px 0 8px; }
.intro h1 { font-size: 1.875rem; max-width: 22em; margin-bottom: 16px; }
.intro .intro-text p { max-width: 44rem; }
.intro .status-line { color: var(--muted); font-size: 1rem; margin-top: 16px; margin-bottom: 0; }
@media (min-width: 640px) { .intro { padding-top: 40px; } .intro h1 { font-size: 2.5rem; } }
.intro-grid { display: grid; gap: 32px; align-items: center; }
@media (min-width: 1024px) { .intro-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 48px; } }
/* layered device composition: a browser frame with the trial school's home page and a phone with the guardian portal on top */
.devices { position: relative; width: 100%; max-width: 620px; margin: 0 auto; padding-bottom: 8%; }
.devices .dev-browser { display: block; border: 1px solid var(--glass-border); border-radius: 16px; overflow: hidden; background: var(--glass-strong); box-shadow: var(--glass-hi), 0 24px 60px rgba(22, 59, 48, .24); }
.devices .dev-browser::before { content: ""; display: block; height: 28px; border-bottom: 1px solid var(--glass-line); background:
    radial-gradient(circle at 16px 14px, var(--border-strong) 4px, transparent 4.5px), radial-gradient(circle at 34px 14px, var(--border-strong) 4px, transparent 4.5px), radial-gradient(circle at 52px 14px, var(--border-strong) 4px, transparent 4.5px), var(--tint); }
.devices .dev-browser img { display: block; width: 100%; height: auto; }
.devices .dev-phone { position: absolute; right: -2%; bottom: 0; width: 29%; display: block; padding: 5px; border-radius: 24px; background: #1d2c25; border: 1px solid rgba(255, 255, 255, .24); box-shadow: 0 18px 44px rgba(22, 59, 48, .34); }
.devices .dev-phone img { display: block; width: 100%; height: auto; border-radius: 19px; }
.devices .dev-browser:hover, .devices .dev-phone:hover { border-color: var(--link); }
.devices-cap { display: block; margin: 22px 0 0; padding: 8px 14px; color: var(--muted); font-size: .9375rem; line-height: 1.6; max-width: 38rem; background: var(--tint); border: 1px solid var(--glass-border); border-radius: var(--r-ctl); }
@media (max-width: 479px) { .devices .dev-phone { right: 0; width: 31%; border-radius: 18px; padding: 4px; } .devices .dev-phone img { border-radius: 14px; } }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; list-style: none; padding: 0; margin-bottom: 0; }
.stat { display: flex; align-items: center; gap: 12px; margin: 0; padding: 14px 16px; border-radius: var(--r-card); }
.snum { display: block; font-size: 1.625rem; font-weight: 700; line-height: 1.2; color: var(--text); }
.slabel { display: block; font-size: .9375rem; line-height: 1.4; color: var(--muted); }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } .stat { padding: 18px 20px; } .snum { font-size: 1.875rem; } }
.release-box { border-radius: var(--r-panel); padding: 20px; }
.release-box h2 { font-size: 1.375rem; margin: 0 0 8px; padding: 0; border: 0; display: flex; align-items: center; gap: 12px; }
.release-box .facts { margin-bottom: 16px; grid-template-columns: 1fr; }
.release-box .facts dt, .release-box .facts dd { padding: 0; border: 0; }
.release-box .facts dt { margin-top: 12px; }
.release-box .notice { margin-bottom: 16px; }
/* capability areas: icon cards with a small screenshot */
.cap-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; list-style: none; margin: 0; padding: 0; }
@media (min-width: 640px) { .cap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .cap-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cap-card { margin: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-card); }
.cap-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--glass-line); background: var(--glass-strong); }
.cap-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.cap-thumb.phone-thumb img { object-fit: cover; object-position: top center; }
@media (max-width: 639px) { .cap-thumb { aspect-ratio: auto; height: 124px; } }
.cap-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cap-title { display: flex; align-items: center; gap: 12px; }
.cap-card h3 { font-size: 1.1875rem; line-height: 1.45; margin: 0; }
.cap-card p { margin: 0; font-size: 1rem; line-height: 1.7; }
.cap-card .meta { margin-top: auto; padding-top: 6px; }

/* ---------- features ---------- */
.defs { margin-bottom: 8px; }
.defs h2 { margin-bottom: 8px; }
.defs-card { border-radius: var(--r-panel); padding: 20px; }
@media (min-width: 720px) { .defs .facts { grid-template-columns: 17rem minmax(0, 1fr); } }
.toc-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.toc-list li { margin: 0; }
.toc-list a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--tint); text-decoration: none; color: var(--text); }
.toc-list a .icon { width: 1.125rem; height: 1.125rem; color: var(--primary); }
.toc-list a:visited { color: var(--text); }
.toc-list a:hover { background: var(--accent); color: var(--on-accent); }
.toc-list a:hover .icon { color: var(--on-accent); }
.area { margin-top: 32px; scroll-margin-top: 16px; border-radius: var(--r-panel); padding: 20px 16px; }
.area-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.area-head .ic-chip { width: 52px; height: 52px; border-radius: 14px; }
.area-head .ic-chip .icon { width: 1.75rem; height: 1.75rem; }
.area .area-intro { max-width: 52rem; }
@media (min-width: 720px) { .area { padding: 28px 28px 20px; } }
.modtable td p { font-size: 1rem; }
.modtable .mname { font-weight: 600; }

/* ---------- docs and wiki ---------- */
.doc-layout { display: grid; gap: 16px; padding-bottom: 48px; }
.doc-menu { font-size: 1rem; line-height: 1.5; }
.doc-menu-wide { display: none; }
.doc-menu-fold summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; font-weight: 600; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); background: var(--control); cursor: pointer; list-style: none; }
.doc-menu-fold summary::-webkit-details-marker { display: none; }
.doc-menu-fold[open] summary { background: var(--accent); color: var(--on-accent); }
.doc-menu-fold .menu-body { padding: 8px 12px 12px; margin-top: 8px; border-radius: var(--r-card); }
.doc-menu h2 { font-size: .9375rem; font-weight: 600; color: var(--muted); margin: 16px 0 4px; }
.doc-menu ul { list-style: none; margin: 0; padding: 0; }
.doc-menu li { margin: 0; }
.doc-menu a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--text); text-decoration: none; border-left: 2px solid var(--glass-line); overflow-wrap: anywhere; border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
.doc-menu a:visited { color: var(--text); }
.doc-menu a:hover { background: var(--chip); }
.doc-menu a[aria-current="page"] { font-weight: 600; background: var(--accent); color: var(--on-accent); border-left-color: var(--primary); }
.menu-home { margin: 0; }
.doc-main { min-width: 0; }
.article { max-width: 672px; }
.article.article-pane { max-width: 736px; }
.article .meta-line { color: var(--muted); font-size: .9375rem; line-height: 1.6; margin: 8px 0 24px; }
.article h1 { margin-bottom: 8px; }
.on-page { border: 1px solid var(--glass-line); border-radius: var(--r-card); background: var(--inset); padding: 12px 16px; margin: 0 0 24px; font-size: 1rem; }
.on-page .on-title { font-weight: 600; margin: 0 0 4px; }
.on-page ol { margin: 0; padding-left: 1.25rem; }
.on-page a { display: inline-flex; align-items: center; min-height: 44px; }
.doc-aside { display: none; }
.wiki-body > :first-child { margin-top: 0; }
.wiki-body h2 { margin: 32px 0 12px; padding-top: 24px; border-top: 1px solid var(--glass-line); scroll-margin-top: 16px; }
.wiki-body h3 { margin: 32px 0 12px; scroll-margin-top: 16px; }
.wiki-body h4 { margin: 24px 0 12px; scroll-margin-top: 16px; }
.wiki-body ol { padding-left: 1.5rem; }
.wiki-body li ul, .wiki-body li ol { margin-top: 4px; margin-bottom: 8px; }
.wiki-body img { border: 1px solid var(--glass-border); border-radius: 12px; box-shadow: var(--glass-shadow); }
.wiki-body .note { background: var(--inset); border: 1px solid var(--glass-line); border-left: 4px solid var(--info); border-radius: 14px; padding: 12px 20px; margin: 0 0 24px; }
.wiki-body .note p { margin: 0 0 8px; }
.wiki-body .note p:last-child { margin-bottom: 0; }
.next-docs { display: grid; gap: 12px; margin: 48px 0 0; padding-top: 24px; border-top: 1px solid var(--glass-line); }
.next-docs h2 { font-size: 1.125rem; margin: 0; }
.next-docs a { display: block; padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: var(--r-card); background: var(--control); text-decoration: none; min-height: 44px; }
.next-docs a:visited { color: var(--link); }
.next-docs .dir { display: block; font-size: .9375rem; color: var(--muted); }
.report { margin: 32px 0 0; color: var(--muted); font-size: 1rem; }
@media (min-width: 640px) { .next-docs.two { grid-template-columns: 1fr 1fr; } .next-docs h2 { grid-column: 1 / -1; } .next-docs .next { text-align: right; grid-column: 2; } }
@media (min-width: 960px) {
    .doc-layout { grid-template-columns: 232px minmax(0, 1fr); gap: 24px; align-items: start; }
    .doc-menu-fold { display: none; }
    .doc-menu-wide { display: block; position: sticky; top: 8px; max-height: calc(100vh - 16px); overflow-y: auto; border-radius: var(--r-panel); padding: 8px 12px 16px; }
}
@media (min-width: 1280px) {
    .doc-layout.has-toc { grid-template-columns: 240px 720px 200px; justify-content: start; gap: 24px; }
    .doc-layout.has-toc .article { max-width: 720px; }
    .doc-layout.has-toc .on-page { display: none; }
    .doc-aside { display: block; position: sticky; top: 8px; font-size: .9375rem; line-height: 1.5; margin-top: 8px; padding: 12px 8px; border-radius: var(--r-card); }
    .doc-aside .on-title { font-weight: 600; margin: 0 0 8px 12px; }
    .doc-aside ol { list-style: none; margin: 0; padding: 0; }
    .doc-aside li { margin: 0; }
    .doc-aside a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-left: 2px solid var(--glass-line); color: var(--text); text-decoration: none; }
    .doc-aside a:visited { color: var(--text); }
    .doc-aside a:hover { background: var(--chip); }
}
.docs-search { margin-bottom: 8px; }

/* ---------- news article ---------- */
.news-article { max-width: 720px; }
.news-article .cover { margin-bottom: 20px; }
.news-article h1 { margin: 8px 0 12px; }
.news-article .row-meta { margin-bottom: 16px; }
.news-article .summary { font-size: 1.25rem; line-height: 1.7; }

/* ---------- search ---------- */
.big-search { position: relative; display: flex; max-width: 680px; margin: 0 0 24px; padding: 8px; background: var(--tint); border: 1px solid var(--glass-border); border-radius: var(--r-card); box-shadow: var(--glass-hi), var(--glass-shadow); }
.big-search .search-ic { left: 24px; }
.big-search input { flex: 1; min-width: 0; min-height: 52px; font: inherit; font-size: 1rem; padding: 6px 12px 6px 48px; color: var(--text); background: var(--control); border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--r-ctl) 0 0 var(--r-ctl); }
.big-search button { min-height: 52px; padding: 0 22px; font: 600 1rem var(--font-body); background: var(--primary); color: var(--on-primary); border: 1px solid var(--primary); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; cursor: pointer; }
.results { list-style: none; margin: 0; padding: 0; }
.results li { padding: 16px 0; border-top: 1px solid var(--glass-line); margin: 0; }
.results li:first-child { border-top: 0; padding-top: 0; }
.results .kind { display: inline-block; margin-right: 8px; }
.results a.rt { font-size: 1.25rem; font-weight: 600; display: inline; }
.results .snip { margin: 4px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.7; }
.results mark { background: var(--accent); color: var(--on-accent); padding: 0 2px; border-radius: 3px; }
.js-only[hidden], .no-js-only[hidden] { display: none; }

/* ---------- forms: glass controls with visible labels ---------- */
.form { max-width: 680px; display: grid; gap: 20px; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: .9375rem; line-height: 1.6; margin: 0 0 6px; }
.field input[type=text], .field input[type=email], .field select, .field textarea { width: 100%; min-height: 48px; padding: 8px 14px; font: inherit; font-size: 1rem; color: var(--text); background: var(--control); border: 1px solid var(--border-strong); border-radius: var(--r-ctl); }
.field textarea { min-height: 160px; resize: vertical; }
.field [aria-invalid="true"] { border: 2px solid var(--danger); }
.field .err-text { color: var(--danger); margin: 4px 0 0; font-weight: 600; font-size: 1rem; }
.field .err-text:empty { display: none; }
.field.check label { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; min-height: 44px; }
.field.check input { margin-top: 4px; width: 24px; height: 24px; flex: none; }
/* a group of checkboxes (roles on /demo/request/): one legend, two columns where there is room, 44px rows for touch */
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field[tabindex="-1"]:focus { outline: 3px solid var(--focus); outline-offset: 6px; border-radius: 8px; }
.field.checks .check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 24px; }
.field.checks .check-grid label { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; min-height: 44px; margin: 0; padding: 8px 0; }
.field.checks input { margin-top: 4px; width: 24px; height: 24px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.errsum ul { margin: 8px 0 0; padding-left: 1.25rem; }
.table-wrap { overflow-x: auto; }

/* ---------- footer ---------- */
.site-foot { margin-top: 48px; border-width: 1px 0 0; border-radius: var(--r-panel) var(--r-panel) 0 0; padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); font-size: 1rem; line-height: 1.7; }
.foot-grid { display: grid; gap: 16px 32px; }
.foot-h { display: flex; align-items: center; gap: 10px; font-size: 1.125rem; font-weight: 600; margin: 0 0 4px; }
.foot-h .icon { color: var(--primary); width: 1.25rem; height: 1.25rem; }
.foot-links { list-style: none; margin: 0; padding: 0; }
.foot-links li { margin: 0; }
.foot-links a { display: flex; align-items: center; min-height: 44px; }
.foot-links a[aria-current="page"] { font-weight: 600; }
.foot-note { margin: 24px 0 0; padding-top: 16px; border-top: 1px solid var(--glass-line); color: var(--muted); font-size: .9375rem; line-height: 1.7; }
@media (min-width: 720px) { .foot-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- release summary card ---------- */
.release-card { border-radius: var(--r-panel); padding: 20px; margin: 0 0 24px; }
.rc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.rc-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; flex: none; border-radius: 14px; background: var(--chip); color: var(--primary); border: 1px solid var(--glass-line); }
.rc-icon .icon { width: 1.75rem; height: 1.75rem; }
.rc-title { font-size: 1.375rem; font-weight: 600; line-height: 1.4; margin: 0 0 2px; }
.rc-head .row-meta { margin: 0; }
.rstats { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; list-style: none; margin: 0; padding: 0; }
.rstat { margin: 0; display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto auto; column-gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--inset); border: 1px solid var(--glass-line); }
.rstat .icon { grid-row: 1 / span 2; color: var(--primary); align-self: center; }
.rnum { font-size: 1.375rem; font-weight: 700; line-height: 1.3; }
.rlabel { font-size: .9375rem; color: var(--muted); line-height: 1.5; }
.rc-link { margin: 16px 0 0; }
@media (min-width: 640px) { .rstats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- small helpers ---------- */
.sub-h { font-size: 1.25rem; margin: 32px 0 12px; }
ul.plain { list-style: none; margin: 8px 0 0; padding: 0; font-size: 1rem; }
ul.plain li { margin: 0; }
ul.plain a { display: inline-flex; align-items: center; min-height: 44px; }
.status-line { color: var(--muted); font-size: 1rem; }
.row-meta-top { margin-bottom: 8px; }
.row-meta-date { margin-bottom: 16px; }
.cap-list .meta { margin: 0; }
/* readable line length for running text on wide screens; module table columns that must not wrap inside a word */
.page p { max-width: 52rem; }
.modtable td:nth-child(1) { min-width: 12rem; }
.modtable td:nth-child(3) { min-width: 14rem; }
.modtable td:nth-child(4) { white-space: nowrap; }
.modtable td:nth-child(2) { overflow-wrap: anywhere; }
@media (max-width: 719px) { .modtable td:nth-child(1), .modtable td:nth-child(3) { min-width: 0; } .modtable td:nth-child(4) { white-space: normal; } }

/* ---------- landscape phones and short windows: the sheet may scroll, nothing is sticky ---------- */
@media (max-height: 480px) and (orientation: landscape) {
    .site-head { border-radius: 0; }
    .nav-list { max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); }
    .devices { max-width: 420px; }
}

/* ---------- fallbacks: opaque surfaces when the glass cannot work or is not wanted ---------- */
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :root, :root:not([data-theme="light"]), :root[data-theme="dark"], :root[data-theme="light"] { --glass: var(--surface); --glass-strong: var(--surface); --sheet: var(--surface); --tint: var(--surface); --control: var(--surface); --code-bg: var(--surface); }
    body::before { display: none; }
}
@media (prefers-reduced-transparency: reduce) {
    :root, :root:not([data-theme="light"]), :root[data-theme="dark"], :root[data-theme="light"] { --glass: var(--surface); --glass-strong: var(--surface); --sheet: var(--surface); --tint: var(--surface); --control: var(--surface); --code-bg: var(--surface); --glass-shadow: none; --raised-shadow: 0 4px 12px rgba(0, 0, 0, .18); }
    .glass, .article-pane { -webkit-backdrop-filter: none; backdrop-filter: none; }
    body::before { background: var(--background); }
}
@media (forced-colors: active) {
    body::before { display: none; }
    .glass, .tint, .article-pane, .entry, .cap-card, .stat, .panel, .area, .release-card, .rowtable, .scroll-x, .notice, .nav-list { -webkit-backdrop-filter: none; backdrop-filter: none; border: 1px solid CanvasText; box-shadow: none; background: Canvas; }
    .cover::before { display: none; }
    .btn, .badge, .tag { border: 1px solid ButtonText; }
}

/* ---------- print: plain ---------- */
@media print {
    body::before { display: none; }
    body { background: #fff; color: #000; font-size: 12pt; }
    .glass, .tint, .article-pane, .entry, .cap-card, .stat, .panel, .area, .release-card, .rowtable, .scroll-x, .notice { background: #fff !important; box-shadow: none !important; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: #999; }
    .site-head, .site-foot .foot-grid, .devices, .cover, .theme-switch, .copy, .skip, .doc-menu, .doc-aside, .filters, .pager-nav { display: none !important; }
    a { color: #000; }
    .wrap { max-width: none; padding: 0; }
}
