/* Docs section (#/docs, #/docs/<name>) and the build label at the foot of every page. Read mode:
   a 72ch prose column, tables and code scroll inside their own box, Thai set in a Thai face. */

/* Build label: quiet, left under the brand, never in the crowded top bar. */
.shell-foot { max-width: 1240px; margin: -40px auto 0; padding: 0 16px 20px; }
.build-label { display: inline-block; padding: 2px 6px; border-radius: 6px; color: var(--text-faint); font-size: 12px; letter-spacing: 0.01em; }
.build-label:hover { color: var(--text-dim); }

/* Thai: system Thai faces first (Windows Leelawadee UI, macOS Thonburi, Linux Noto), looser leading for stacked marks. */
:lang(th) { font-family: "Leelawadee UI", "Noto Sans Thai", "Noto Sans Thai UI", Thonburi, Sarabun, Tahoma, var(--sans); }
code:lang(th), pre:lang(th), .mono:lang(th) { font-family: var(--mono); }

/* Language switch: two segments, the current one filled. */
.doc-head .seg { display: inline-flex; padding: 2px; border: 1px solid var(--border-control); border-radius: var(--radius-sm); background: var(--inset); }
.doc-head .seg-btn { min-width: 44px; padding: 4px 12px; border-radius: 6px; color: var(--text-dim); font-weight: 600; font-size: 13px; text-align: center; text-decoration: none; }
.doc-head .seg-btn:hover { color: var(--text); }
.doc-head .seg-btn.is-on { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 1px var(--accent); }
.doc-head .seg-btn.is-off { color: var(--text-faint); cursor: not-allowed; }

.doc-head { align-items: flex-end; }
.doc-head-text { min-width: 0; flex: 1 1 320px; }
.doc-head .page-title:lang(th) { line-height: 1.45; }

.doc-item { flex-wrap: nowrap; }
.doc-item .test-name a { color: var(--text); text-decoration: none; }
.doc-item .test-name a:hover { color: var(--accent); text-decoration: underline; }
.doc-twin { flex: none; font-size: 13px; font-weight: 600; }

.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.doc-toc { display: none; }
@media (min-width: 1100px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr) 220px; }
  .doc-toc { display: block; position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; font-size: 13px; }
}
.doc-toc-title { margin: 0 0 8px; color: var(--text-dim); font-weight: 600; }
.doc-toc ul { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 1px solid var(--border); }
.doc-toc li { margin: 0 0 6px; }
.doc-toc a { color: var(--text-dim); text-decoration: none; }
.doc-toc a:hover { color: var(--text); text-decoration: underline; }

/* Rendered markdown. */
.md-body { min-width: 0; font-size: 15px; line-height: 1.65; overflow-wrap: break-word; }
.md-body:lang(th) { line-height: 1.85; }
.md-body > :first-child { margin-top: 0; }
/* Prose keeps a reading measure; tables and code may use the whole column. */
.md-body > :is(p, ul, ol, blockquote, h2, h3, h4, h5, h6, hr) { max-width: 78ch; }
.md-body h2, .md-body h3, .md-body h4, .md-body h5, .md-body h6 { position: relative; margin: 2em 0 0.6em; line-height: 1.3; letter-spacing: -0.01em; scroll-margin-top: 76px; outline: none; }
.md-body h2 { font-size: 20px; padding-bottom: 6px; border-bottom: 1px solid var(--border-soft); }
.md-body h3 { font-size: 16.5px; }
.md-body h4, .md-body h5, .md-body h6 { font-size: 15px; color: var(--text-dim); }
.md-body h2:target, .md-body h3:target, .md-body h2:focus-visible, .md-body h3:focus-visible { color: var(--accent); }
.md-anchor { margin-left: 0.4em; color: var(--text-faint); text-decoration: none; font-weight: 500; opacity: 0; transition: opacity 120ms ease-out; }
.md-body :is(h2, h3, h4, h5, h6):hover .md-anchor, .md-anchor:focus-visible { opacity: 1; }
.md-body p, .md-body ul, .md-body ol, .md-body blockquote { margin: 0 0 1em; }
.md-body ul, .md-body ol { padding-left: 1.4em; }
.md-body li { margin: 0.25em 0; }
.md-body li > ul, .md-body li > ol { margin: 0.25em 0 0; }
.md-body li::marker { color: var(--text-faint); }
.md-body strong { font-weight: 650; color: var(--text); }
.md-body hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.md-body blockquote { padding: 2px 0 2px 14px; border-left: 1px solid var(--border); color: var(--text-dim); }
.md-body code { padding: 1px 5px; border-radius: 4px; background: var(--panel-2); font-family: var(--mono); font-size: 0.88em; overflow-wrap: anywhere; }
.md-file { color: var(--text-dim); text-decoration: underline dotted var(--text-faint); text-underline-offset: 3px; cursor: help; }
.md-img { color: var(--text-faint); font-style: italic; }

.md-code { position: relative; margin: 0 0 1.2em; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--inset); overflow: hidden; }
.md-code-lang { padding: 5px 12px; border-bottom: 1px solid var(--border-soft); color: var(--text-faint); font-size: 12px; font-family: var(--mono); }
.md-code pre { margin: 0; padding: 12px 14px; overflow-x: auto; font: 13px/1.55 var(--mono); tab-size: 2; }
.md-code pre code { padding: 0; background: none; font-size: inherit; overflow-wrap: normal; white-space: pre; }

.md-table { position: relative; margin: 0 0 1.2em; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); }
.md-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; line-height: 1.5; }
.md-table th { padding: 8px 12px; text-align: left; font-weight: 600; color: var(--text-dim); background: var(--panel-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.md-table td { padding: 8px 12px; vertical-align: top; border-bottom: 1px solid var(--border-soft); min-width: 8ch; }
.md-table tr:last-child td { border-bottom: 0; }
.md-table td code { overflow-wrap: normal; white-space: nowrap; }

@media (max-width: 640px) {
  .md-body { font-size: 14.5px; }
  .md-table td, .md-table th { padding: 7px 9px; }
  .doc-item { flex-wrap: wrap; }
}
/* Column alignment from the table's delimiter row (classes: the CSP allows no inline style). */
.md-table .md-left { text-align: left; }
.md-table .md-right { text-align: right; }
.md-table .md-center { text-align: center; }
@media (max-width: 640px) { .md-body h2, .md-body h3, .md-body h4, .md-body h5, .md-body h6 { scroll-margin-top: 112px; } }
