/* ==========================================================================
   Binary OS site (public/os/). Loads after site.css and builds on its tokens.
   1. Appearance (dark default, light option)  2. Header and footer  3. Page heads
   4. Documentation layout and prose  5. Components  6. Download  7. Forum  8. Responsive
   ========================================================================== */

/* 1. Appearance ------------------------------------------------------------- */
.os-site { --os-util-h: 38px; --os-header-h: 72px; }
.os-site .h3 { font-size: var(--fs-h3); font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.os-site code, .os-site kbd { font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace; font-size: .9em; }
.os-site :not(pre) > code { padding: 2px 6px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); word-break: break-word; }
.os-site kbd { padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border); border-bottom-width: 2px; background: var(--surface); }
.os-site .icon-inline { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin-right: 8px; color: var(--accent-text); }

/* Light option: html[data-theme="light"] (set by os-theme.js from the viewer's own choice) */
html[data-theme="light"] .os-site {
  --bg: #ffffff; --bg-alt: var(--ice-100); --surface: #ffffff; --surface-2: var(--ice-50);
  --text: var(--navy-800); --text-soft: var(--slate-600); --border: var(--line);
  --accent: var(--cyan-500); --accent-text: var(--cyan-700);
  --btn-bg: var(--navy-800); --btn-fg: #ffffff; --btn-hover: var(--navy-700); --focus: var(--cyan-500);
  --shadow: 0 24px 48px -28px rgba(11, 40, 80, .35);
  --st-proto-bg: #dff5ea; --st-proto-fg: #17724e;
  --st-dev-bg: #e3f4fc; --st-dev-fg: #0a6f98;
  --st-plan-bg: #efeafd; --st-plan-fg: #4d3fb0;
  --st-concept-bg: #eef1f6; --st-concept-fg: #46566d;
  color-scheme: light;
}
html:not([data-theme="light"]) .os-site { color-scheme: dark; }
html[data-theme="light"] .os-site .glow-card { background: var(--surface); }
html[data-theme="light"] .os-site .os-hero { background: radial-gradient(900px 500px at 80% 10%, #dcecf9 0%, transparent 62%), linear-gradient(180deg, var(--ice-100), #fff); }
html[data-theme="light"] .os-site .os-hero .by a { color: var(--text); }
html[data-theme="light"] .os-site .concept-tag { background: rgba(255, 255, 255, .92); color: var(--navy-800); border-color: var(--line); }
html[data-theme="light"] .os-site .field input, html[data-theme="light"] .os-site .field select, html[data-theme="light"] .os-site .field textarea { background: #fff; }
html[data-theme="light"] .os-site .field .error, html[data-theme="light"] .os-site .form-status[data-state="error"] { color: #b93a0a; }
html[data-theme="light"] .os-site .form-status[data-state="ok"] { color: var(--st-proto-fg); }
html[data-theme="light"] .os-site .modal { background: #fff; }
.os-site .diagram img, .os-site .figure img { background: #fff; }
.os-site .device img { background: transparent; }

/* 2. Header and footer ------------------------------------------------------ */
.os-util { background: #030a14; color: #8fa6c2; font-size: var(--fs-micro); border-bottom: 1px solid rgba(160, 200, 240, .12); }
.os-util-inner { display: flex; justify-content: space-between; align-items: center; gap: var(--s-4); min-height: var(--os-util-h); }
.os-util a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: inherit; padding: 6px 0; }
.os-util a:hover { color: #fff; }
.os-util .icon { width: 14px; height: 14px; }
.os-dot { width: 8px; height: 8px; border-radius: 50%; background: #7da7ff; box-shadow: 0 0 0 3px rgba(125, 167, 255, .2); }

.os-header.site-header { position: sticky; top: 0; z-index: 40; background: rgba(5, 13, 26, .94); color: #eaf3fb; border-bottom: 1px solid rgba(160, 200, 240, .16); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.os-header-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-5); min-height: var(--os-header-h); }
.os-brand { display: block; flex: none; }
.os-brand img { height: 32px; width: auto; }
.os-nav { display: flex; align-items: center; gap: var(--s-5); flex: 1; justify-content: flex-end; }
.os-nav ul { display: flex; align-items: center; gap: clamp(12px, 1.6vw, 26px); margin: 0; padding: 0; list-style: none; }
.os-nav ul a { display: block; padding: 8px 2px; text-decoration: none; font-size: var(--fs-small); font-weight: 600; color: #c6d4e6; border-bottom: 2px solid transparent; white-space: nowrap; }
.os-nav ul a:hover { color: #fff; border-bottom-color: rgba(255, 255, 255, .35); }
.os-nav ul a[aria-current] { color: #fff; border-bottom-color: var(--os-cyan); }
.os-tools { display: flex; align-items: center; gap: var(--s-2); }
.os-icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(160, 200, 240, .25); background: transparent; color: #eaf3fb; cursor: pointer; text-decoration: none; }
.os-icon-btn:hover { border-color: #6fd9f7; color: #6fd9f7; }
.os-icon-btn .icon { width: 20px; height: 20px; }
.os-header .btn--primary { background: #fff; color: var(--navy-900); }
.os-header .btn--primary:hover { background: var(--ice-200); }
.os-header .btn .icon { width: 18px; height: 18px; }
.os-header .btn:hover .icon { transform: translateY(2px); }
.os-header :focus-visible { outline-color: #6fd9f7; }
.os-toggle { background: transparent; color: #fff; border-color: rgba(160, 200, 240, .3); }
.icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: none; }
html[data-theme="light"] .icon-sun { display: block; }
html:not([data-theme="light"]) .icon-sun { display: none; }
html:not([data-theme="light"]) .icon-moon { display: block; }

.os-footer { background: #030a14; }
.os-footer-top { grid-template-columns: 1.4fr repeat(5, 1fr); }
.os-footer .footer-brand img { width: 44px; height: auto; }

/* 3. Page heads ------------------------------------------------------------- */
.os-page-hero { position: relative; overflow: hidden; background: radial-gradient(900px 420px at 85% 0%, rgba(14, 66, 121, .55) 0%, transparent 70%), linear-gradient(180deg, var(--bg-alt), var(--bg)); border-bottom: 1px solid var(--border); }
html[data-theme="light"] .os-page-hero { background: radial-gradient(900px 420px at 85% 0%, #dcecf9 0%, transparent 70%), linear-gradient(180deg, var(--ice-100), #fff); }
.os-page-hero-inner { padding-top: clamp(32px, 5vw, 64px); padding-bottom: clamp(36px, 5vw, 72px); }
.os-page-hero h1 { max-width: 20ch; }
.os-page-hero .lede { margin-top: var(--s-5); }
.hero-badge { margin-top: var(--s-5); }
.legend-wrap { margin-top: var(--s-6); max-width: 60rem; }
.os-page-top { padding-top: var(--s-5); }
.os-page-top .breadcrumb { margin-bottom: 0; }
.os-hero .figure figcaption { color: var(--text-soft); }

/* 4. Documentation layout and prose ---------------------------------------- */
.doc-layout { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: start; padding-top: var(--s-5); padding-bottom: var(--section); }
.doc-layout.has-toc { grid-template-columns: 252px minmax(0, 1fr) 216px; }
.doc-side, .doc-toc { position: sticky; top: calc(var(--os-header-h) + 20px); max-height: calc(100vh - var(--os-header-h) - 40px); overflow-y: auto; scrollbar-width: thin; }
.doc-side-menu summary { display: none; }
.doc-side-title { font-size: var(--fs-micro); letter-spacing: .12em; text-transform: uppercase; color: var(--text-soft); margin: 0 0 var(--s-3); font-weight: 700; }
.doc-side ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.doc-side a { display: block; padding: 9px 12px; border-radius: var(--r-sm); text-decoration: none; font-size: var(--fs-small); color: var(--text-soft); border-left: 3px solid transparent; }
.doc-side a:hover { background: var(--surface); color: var(--text); }
.doc-side a[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 700; border-left-color: var(--accent); }
.doc-toc h2 { font-size: var(--fs-micro); letter-spacing: .12em; text-transform: uppercase; color: var(--text-soft); margin: 0 0 var(--s-3); font-weight: 700; }
.doc-toc ul { display: grid; gap: 4px; margin: 0; padding: 0 0 0 var(--s-3); list-style: none; border-left: 1px solid var(--border); }
.doc-toc a { display: block; padding: 4px 0 4px 10px; margin-left: -1px; border-left: 2px solid transparent; font-size: var(--fs-small); text-decoration: none; color: var(--text-soft); }
.doc-toc a:hover { color: var(--text); }
.doc-toc a.is-active { color: var(--accent-text); border-left-color: var(--accent); font-weight: 600; }
.doc-main { min-width: 0; }
.doc-head { margin-bottom: var(--s-6); padding-bottom: var(--s-6); border-bottom: 1px solid var(--border); }
.doc-head h1 { font-size: clamp(2rem, 4vw, 3.1rem); }
.doc-head .lede { margin-top: var(--s-4); }
.doc-badge { margin-top: var(--s-4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }

.prose { max-width: 50rem; }
.prose > * + * { margin-top: var(--s-4); }
.prose h2 { margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--border); font-size: clamp(1.45rem, 2.4vw, 1.9rem); scroll-margin-top: calc(var(--os-header-h) + 20px); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin-top: var(--s-6); scroll-margin-top: calc(var(--os-header-h) + 20px); }
.prose p, .prose li { color: var(--text); }
.prose ul, .prose ol { padding-left: 1.3em; display: grid; gap: var(--s-2); }
.prose li::marker { color: var(--accent-text); }
.prose a:not(.btn):not(.text-link) { color: var(--accent-text); text-underline-offset: 3px; }
.prose a:not(.btn):not(.text-link):hover { color: var(--text); }
.prose .text-link { color: var(--accent-text); }
.prose strong { font-weight: 700; }
.prose .grid { margin-top: var(--s-4); }
.prose .card h3 { margin-top: 0; }
.prose .spec-list { margin-top: var(--s-4); }
.prose .faq, .prose .table-wrap, .prose .step-list, .prose .codeblock, .prose .note { margin-top: var(--s-5); }
.prose > .app-hero + * { margin-top: var(--s-6); }

.app-hero { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.app-hero img { width: 96px; height: 96px; border-radius: 22px; }
.app-hero p + p { margin-top: var(--s-3); }
.icon-row { display: flex; gap: var(--s-4); flex-wrap: wrap; margin-top: var(--s-4); }
.icon-row img { border-radius: 18px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); margin-top: var(--s-8); max-width: 50rem; }
.pager a { display: grid; gap: 2px; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--r-md); text-decoration: none; font-weight: 600; }
.pager a:hover { border-color: var(--accent); }
.pager span { font-size: var(--fs-micro); color: var(--text-soft); letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.pager-next { text-align: right; grid-column: 2; }
.pager-prev { grid-column: 1; }
.doc-help { margin-top: var(--s-7); max-width: 50rem; padding: var(--s-5); border: 1px dashed var(--border); border-radius: var(--r-lg); color: var(--text-soft); }
.doc-help h2 { font-size: 1.15rem; margin-bottom: var(--s-2); color: var(--text); }
.doc-help a { color: var(--accent-text); }

/* Notes */
.note { display: grid; gap: 6px; padding: 16px 18px; border-radius: var(--r-md); border: 1px solid var(--border); border-left-width: 4px; background: var(--surface); }
.note strong { font-size: var(--fs-small); letter-spacing: .02em; }
.note > div { color: var(--text-soft); }
.note--info { border-left-color: var(--os-cyan); }
.note--warn { border-left-color: #f2b541; }
.note--ok { border-left-color: #3dc88c; }

/* Tables */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.data-table caption { text-align: left; color: var(--text-soft); padding-bottom: var(--s-3); font-size: var(--fs-small); }
.data-table th, .data-table td { text-align: left; vertical-align: top; padding: 12px 14px 12px 0; border-top: 1px solid var(--border); }
.data-table thead th { font-size: var(--fs-micro); letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); border-top: 0; white-space: nowrap; }
.data-table tbody th { font-weight: 600; }
.data-table td { color: var(--text-soft); }
.data-table tbody tr:last-child > * { border-bottom: 1px solid var(--border); }
.file-table td:last-child { text-align: right; white-space: nowrap; padding-right: 0; }

/* Steps */
.step-list { counter-reset: step; display: grid; gap: var(--s-4); padding: 0 !important; list-style: none; }
.step-list > li { counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--s-4); padding: var(--s-4) var(--s-5); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.step-list > li::before { content: counter(step); grid-row: 1 / span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #031528; font-weight: 800; }
.step-title { display: block; margin: 8px 0 4px; font-size: 1.1rem; font-weight: 700; color: var(--text); }
.step-list > li > div { color: var(--text-soft); }
.step-list > li > div p + p { margin-top: var(--s-2); }

/* FAQ */
.faq { display: grid; gap: var(--s-3); }
.faq-item { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.faq-item summary { cursor: pointer; padding: 16px 52px 16px 20px; font-weight: 600; list-style: none; position: relative; min-height: 52px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: ""; position: absolute; right: 20px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--accent-text); border-bottom: 2px solid var(--accent-text); transform: translateY(-70%) rotate(45deg); transition: transform .18s; }
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-item[open] summary { border-bottom: 1px solid var(--border); }
.faq-a { padding: 16px 20px 20px; color: var(--text-soft); }
.faq-a > * + * { margin-top: var(--s-3); }
.faq-a a { color: var(--accent-text); }
.faq-tools { margin-bottom: var(--s-5); max-width: 50rem; }
.faq-filter, .search-box input { width: 100%; font: inherit; color: var(--text); background: var(--surface); padding: 12px 16px; min-height: 52px; border: 1.5px solid var(--border); border-radius: var(--r-pill); }
.faq-filter:focus-visible, .search-box input:focus-visible { outline-offset: 1px; border-color: var(--accent); }

/* Code blocks */
.codeblock { position: relative; border: 1px solid var(--border); border-radius: var(--r-md); background: #030a14; color: #d9e8f8; overflow: hidden; }
html[data-theme="light"] .os-site .codeblock { background: #0b1a33; }
.codeblock pre { margin: 0; padding: 18px 18px 18px; overflow-x: auto; font-size: .88rem; line-height: 1.6; tab-size: 2; }
.codeblock-label { display: block; padding: 8px 14px; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: #8fa6c2; border-bottom: 1px solid rgba(160, 200, 240, .15); padding-right: 110px; }
.copy-btn { position: absolute; right: 8px; top: 6px; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border-radius: var(--r-pill); border: 1px solid rgba(160, 200, 240, .3); background: rgba(255, 255, 255, .06); color: #eaf3fb; font: inherit; font-size: .8rem; cursor: pointer; }
.copy-btn:hover { border-color: #6fd9f7; color: #6fd9f7; }
.copy-btn .icon { width: 16px; height: 16px; }
.copy-btn[data-done] { color: #7fe0b5; border-color: #7fe0b5; }

/* 5. Components ------------------------------------------------------------- */
.tag { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--r-pill); border: 1px solid var(--border); font-size: var(--fs-micro); font-weight: 700; color: var(--text-soft); letter-spacing: .03em; }
.state-grid .card { height: 100%; }
.state-grid .card .text-link { margin-top: auto; }

.lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); }
.lane { display: flex; flex-direction: column; gap: var(--s-4); padding: clamp(20px, 2.4vw, 30px); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.lane-head { display: grid; gap: var(--s-2); justify-items: start; }
.lane-head h2, .lane-head h3 { font-size: 1.35rem; }
.lane-list { display: grid; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.lane-list li { padding: 10px 0; border-top: 1px solid var(--border); color: var(--text); }
.lane-list--detail li { display: grid; gap: 2px; }
.lane-list--detail li span { color: var(--text-soft); font-size: var(--fs-small); }

.timeline { display: grid; gap: 0; list-style: none; padding: 0; margin: 0; max-width: 58rem; border-left: 2px solid var(--border); margin-left: 8px; }
.timeline-item { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--s-5); padding: 0 0 var(--s-7) var(--s-6); position: relative; }
.timeline-item::before { content: ""; position: absolute; left: -9px; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--accent); }
.timeline-date { display: grid; gap: 6px; justify-items: start; color: var(--text-soft); font-size: var(--fs-small); font-weight: 600; }
.timeline-item h2 { font-size: 1.35rem; margin-bottom: var(--s-2); }
.timeline-item p { color: var(--text-soft); }

.map-group h2 { margin-bottom: var(--s-3); }
.map-group .plain-list a { text-decoration: none; }
.map-group .plain-list a:hover { color: var(--accent-text); text-decoration: underline; }

.site-search { max-width: 50rem; }
.search-box { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); }
.search-box > .icon { color: var(--accent-text); }
.search-results { list-style: none; margin: var(--s-5) 0 0; padding: 0; display: grid; gap: var(--s-3); }
.search-results li { padding: var(--s-4) var(--s-5); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.search-results a { font-weight: 700; text-decoration: none; font-size: 1.1rem; }
.search-results a:hover { color: var(--accent-text); text-decoration: underline; }
.search-results p { color: var(--text-soft); margin-top: 4px; }
.search-results .path { font-size: var(--fs-micro); color: var(--text-soft); }
.search-results mark { background: rgba(0, 185, 229, .25); color: inherit; border-radius: 3px; padding: 0 2px; }

.hash-compare { display: grid; gap: var(--s-4); max-width: 38rem; margin-top: var(--s-4); }
.hash-result { font-weight: 700; min-height: 1.6em; }
.hash-result[data-state="ok"] { color: var(--st-proto-fg); }
.hash-result[data-state="bad"] { color: #ff9d7a; }
html[data-theme="light"] .hash-result[data-state="bad"] { color: #b93a0a; }

/* 6. Download --------------------------------------------------------------- */
.empty-state { display: grid; gap: var(--s-4); justify-items: start; padding: clamp(24px, 4vw, 48px); border: 1.5px dashed var(--border); border-radius: var(--r-lg); background: var(--surface); }
.empty-state h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.release { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); padding: clamp(20px, 3vw, 32px); display: grid; gap: var(--s-5); }
.release + .release { margin-top: var(--s-6); }
.release-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-3); align-items: baseline; }
.release-head h2, .release-head h3 { font-size: 1.6rem; }
.release-files { display: grid; gap: var(--s-4); }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: var(--s-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--bg); }
.file-row h4 { font-size: 1.05rem; margin: 0 0 4px; }
.file-meta { display: flex; flex-wrap: wrap; gap: 4px var(--s-4); font-size: var(--fs-small); color: var(--text-soft); }
.hash-line { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); align-items: center; font-size: var(--fs-micro); color: var(--text-soft); }
.hash-line code { word-break: break-all; }
.hash-line .copy-btn { position: static; color: var(--text); border-color: var(--border); background: transparent; min-height: 32px; }
.hash-line .copy-btn:hover { color: var(--accent-text); border-color: var(--accent); }

/* 7. Forum ------------------------------------------------------------------ */
.forum { padding-bottom: var(--section); }
.forum-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); padding: var(--s-4) 0 var(--s-5); }
.forum-search { display: flex; gap: var(--s-2); align-items: center; }
.forum-search input { min-height: 44px; padding: 8px 16px; border-radius: var(--r-pill); border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; width: min(18rem, 60vw); }
.forum-user { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; font-size: var(--fs-small); color: var(--text-soft); }
.forum-user a { color: var(--accent-text); }
.flash { padding: 14px 18px; border-radius: var(--r-md); border: 1px solid var(--border); border-left-width: 4px; background: var(--surface); margin-bottom: var(--s-5); }
.flash--ok { border-left-color: #3dc88c; }
.flash--bad { border-left-color: #ff7a59; }
.flash--info { border-left-color: var(--os-cyan); }
.forum-table { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.forum-row { display: grid; grid-template-columns: minmax(0, 1fr) 6.5rem 14rem; gap: var(--s-4); padding: 16px 20px; align-items: center; border-top: 1px solid var(--border); }
.forum-row:first-child { border-top: 0; }
.forum-row--head { font-size: var(--fs-micro); letter-spacing: .08em; text-transform: uppercase; color: var(--text-soft); font-weight: 700; background: var(--surface-2); }
.forum-row h2, .forum-row h3 { font-size: 1.1rem; margin: 0 0 2px; }
.forum-row h2 a, .forum-row h3 a { text-decoration: none; }
.forum-row h2 a:hover, .forum-row h3 a:hover { color: var(--accent-text); text-decoration: underline; }
.forum-row p { color: var(--text-soft); font-size: var(--fs-small); }
.forum-count { text-align: center; font-weight: 700; }
.forum-count span { display: block; font-size: var(--fs-micro); color: var(--text-soft); font-weight: 500; }
.forum-last { font-size: var(--fs-small); color: var(--text-soft); }
.pill { display: inline-flex; padding: 2px 9px; border-radius: var(--r-pill); font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--st-dev-bg); color: var(--st-dev-fg); margin-right: 6px; vertical-align: 2px; }
.pill--pin { background: var(--st-plan-bg); color: var(--st-plan-fg); }
.pill--lock { background: var(--st-concept-bg); color: var(--st-concept-fg); }
.pill--staff { background: var(--st-proto-bg); color: var(--st-proto-fg); }
.pill--pending { background: #fff1d1; color: #7a5a00; }
.post { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--s-5); padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.post + .post { margin-top: var(--s-4); }
.post-author { display: grid; gap: 6px; justify-items: start; align-content: start; font-size: var(--fs-small); color: var(--text-soft); }
.avatar { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: linear-gradient(135deg, var(--cyan-400), var(--navy-700)); color: #fff; font-weight: 800; font-size: 1.2rem; }
.post-author a { font-weight: 700; color: var(--text); text-decoration: none; }
.post-author a:hover { color: var(--accent-text); }
.post-body { min-width: 0; }
.post-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2); font-size: var(--fs-small); color: var(--text-soft); padding-bottom: var(--s-3); margin-bottom: var(--s-4); border-bottom: 1px solid var(--border); }
.post-text { overflow-wrap: anywhere; }
.post-text > * + * { margin-top: var(--s-3); }
.post-text a { color: var(--accent-text); }
.post-text blockquote { margin-left: 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); color: var(--text-soft); }
.post-text pre { margin: 0; padding: 14px; overflow-x: auto; border-radius: var(--r-sm); background: #030a14; color: #d9e8f8; font-size: .88rem; }
.post-text ul { padding-left: 1.3em; }
.post-actions { display: flex; flex-wrap: wrap; gap: var(--s-4); margin-top: var(--s-4); font-size: var(--fs-small); }
.post-actions a, .post-actions button { color: var(--text-soft); background: none; border: 0; font: inherit; cursor: pointer; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; }
.post-actions a:hover, .post-actions button:hover { color: var(--accent-text); }
.post--hidden { opacity: .6; border-style: dashed; }
.pagination { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-6) 0; }
.pagination a, .pagination span { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-md); text-decoration: none; font-weight: 600; }
.pagination .current { background: var(--accent); color: #031528; border-color: var(--accent); }
.pagination a:hover { border-color: var(--accent); }
.forum-form { display: grid; gap: var(--s-4); max-width: 44rem; }
.forum-form textarea { min-height: 200px; }
.forum-narrow { max-width: 30rem; }
.forum-hint { font-size: var(--fs-micro); color: var(--text-soft); }
.forum-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: clamp(24px, 4vw, 56px); align-items: start; }
.forum-aside > * + * { margin-top: var(--s-4); }
.stat-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); text-align: center; }
.stat-list div { padding: var(--s-4) var(--s-2); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.stat-list strong { display: block; font-size: 1.5rem; }
.stat-list span { font-size: var(--fs-micro); color: var(--text-soft); }
.mod-table td, .mod-table th { vertical-align: middle; }
.inline-form { display: inline; }
.btn-danger { background: transparent; color: #ff9d7a; border-color: #ff9d7a; }
html[data-theme="light"] .btn-danger { color: #b93a0a; border-color: #b93a0a; }

/* 8. Responsive ------------------------------------------------------------- */
@media (max-width: 1240px) {
  .doc-layout.has-toc { grid-template-columns: 240px minmax(0, 1fr); }
  .doc-toc { display: none; }
}
@media (max-width: 1100px) {
  .os-footer-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .os-nav { position: absolute; left: 0; right: 0; top: 100%; display: block; background: #050d1a; border-bottom: 1px solid rgba(160, 200, 240, .2); padding: 8px var(--gutter) 22px; max-height: calc(100dvh - var(--os-header-h)); overflow-y: auto; }
  .js .os-nav:not(.is-open) { display: none; }
  .os-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .os-nav ul a { padding: 14px 0; font-size: 1.05rem; border-bottom: 1px solid rgba(160, 200, 240, .14); }
  .os-tools { margin-top: var(--s-4); }
  .os-tools .btn { flex: 1; }
  .os-header-inner { position: relative; }
  .os-header.site-header .nav-toggle { background: transparent; }
}
@media (max-width: 960px) {
  .doc-layout, .doc-layout.has-toc { grid-template-columns: minmax(0, 1fr); }
  .doc-side { position: static; max-height: none; overflow: visible; }
  .doc-side-menu { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
  .doc-side-menu summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; min-height: 52px; cursor: pointer; font-weight: 700; list-style: none; }
  .doc-side-menu summary::-webkit-details-marker { display: none; }
  .doc-side-menu summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--accent-text); border-bottom: 2px solid var(--accent-text); transform: rotate(45deg); transition: transform .18s; }
  .doc-side-menu[open] summary::after { transform: rotate(-135deg); }
  .doc-side-hint { font-weight: 400; color: var(--text-soft); margin-left: 6px; }
  .doc-side-menu nav { padding: 0 10px 12px; }
  .doc-side-title { display: none; }
  .lanes { grid-template-columns: 1fr; }
  .forum-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .os-footer-top { grid-template-columns: 1fr 1fr; }
  .timeline-item { grid-template-columns: 1fr; gap: var(--s-2); }
  .forum-row { grid-template-columns: minmax(0, 1fr) auto; }
  .forum-row .forum-last { grid-column: 1 / -1; }
  .forum-row--head { display: none; }
  .post { grid-template-columns: 1fr; gap: var(--s-3); }
  .post-author { grid-template-columns: auto 1fr; align-items: center; gap: 4px var(--s-3); }
  .post-author .avatar { grid-row: span 2; width: 44px; height: 44px; }
  .file-row { grid-template-columns: 1fr; }
  .app-hero { grid-template-columns: 64px minmax(0, 1fr); gap: var(--s-4); }
  .app-hero img { width: 64px; height: 64px; border-radius: 15px; }
  .pager { grid-template-columns: 1fr; }
  .pager-next, .pager-prev { grid-column: auto; text-align: left; }
  .search-box { grid-template-columns: 24px minmax(0, 1fr); }
  .search-box .btn { grid-column: 1 / -1; }
  .os-util-more { display: none; }
}
@media (max-width: 480px) {
  .os-footer-top { grid-template-columns: 1fr; }
  .os-brand img { height: 28px; }
  .stat-list { grid-template-columns: 1fr; }
}
@media print {
  .os-util, .os-header, .doc-side, .doc-toc, .pager, .doc-help, .copy-btn { display: none !important; }
  .doc-layout, .doc-layout.has-toc { display: block; }
}
