:root { color-scheme: light; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: #202426; background: #fff; line-height: 1.6; letter-spacing: 0; }
* { box-sizing: border-box; }
body { margin: 0; }
header, main, footer { max-width: 1120px; margin: auto; padding: 24px; }
header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; border-bottom: 1px solid #d7dedd; font-size: 14px; }
header nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
header .brand { font-size: 22px; font-weight: 700; text-decoration: none; }
header .brand-detail { display: block; font-size: 11px; color: #5b6665; font-weight: 400; }
header .author { font-size: 13px; }
header [aria-current=page] { font-weight: 700; color: #922f43; text-decoration-thickness: 2px; }
.family-nav { max-width: 1120px; margin: auto; display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 14px 24px; border-bottom: 1px solid #d7dedd; font-size: 14px; }
.family-nav a { padding: 4px 0; }
.family-nav [aria-current=page] { font-weight: 700; color: #922f43; text-decoration-thickness: 2px; }
.codec-list { list-style: none; padding: 0; margin: 24px 0; }
.codec-list li { padding: 14px 0; border-top: 1px solid #d7dedd; }
.codec-list p { margin: 4px 0 0; font-size: 14px; }
.codec-list .implementation-size { color: #5b6665; font-size: 13px; }
.codec-preview { display: block; width: 156px; height: auto; max-width: 100%; image-rendering: pixelated; background: #edf2f0; }
.image-output { display: block; max-width: 100%; height: auto; max-height: 480px; object-fit: contain; object-position: left; background: #edf2f0; }
a { color: #12665c; text-underline-offset: 3px; overflow-wrap: anywhere; }
a:hover { color: #922f43; }
h1 { font-size: 40px; line-height: 1.2; margin: 10px 0 18px; }
h1 span { display: inline-block; font-size: 19px; font-weight: 400; color: #5b6665; }
h2 { font-size: 21px; line-height: 1.3; margin: 0 0 10px; }
h3 { font-size: 17px; line-height: 1.4; margin: 18px 0 8px; }
p { margin: 0 0 12px; }
section { padding: 24px 0; border-top: 1px solid #d7dedd; }
main { overflow-wrap: anywhere; }
main > p { margin-bottom: 24px; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 13px; }
pre { max-width: 100%; overflow: auto; overflow-wrap: normal; padding: 18px; border: 1px solid #d7dedd; border-radius: 4px; background: #f4f6f7; line-height: 1.7; }
pre code { font-size: 13px; }
.links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; margin: 12px 0 0; }
.muted, small { color: #5b6665; }
.note { font-size: 13px; margin-top: 12px; }
.original { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; margin: 14px 0; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th, td { padding: 12px 10px; border-bottom: 1px solid #d7dedd; vertical-align: top; }
thead { background: #edf2f0; }
tbody th { min-width: 126px; }
td { width: 38%; }
small { display: block; font-size: 12px; font-weight: 400; }
audio { display: block; width: 100%; max-width: 310px; min-width: 0; height: 40px; }
td audio, .listen { margin-top: 8px; }
[hidden] { display: none !important; }
button, select, input { font: inherit; max-width: 100%; }
button { border: 1px solid #12665c; border-radius: 4px; background: #12665c; color: #fff; padding: 9px 15px; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
.listen { display: block; background: transparent; color: #12665c; font-size: 13px; min-height: 40px; }
button:hover:not(:disabled) { background: #0c4a43; color: #fff; }
:focus-visible { outline: 2px solid #922f43; outline-offset: 3px; }
form { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto; gap: 16px; align-items: end; margin: 14px 0; }
.operation { grid-column: 1 / -1; border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0; }
.operation legend { font-size: 14px; margin-bottom: 5px; }
.operation label { display: flex; align-items: center; gap: 6px; border: 1px solid #a8b7b1; padding: 8px 12px; background: #fff; min-height: 42px; cursor: pointer; }
.operation label:first-of-type { border-radius: 4px 0 0 4px; }
.operation label:last-of-type { border-radius: 0 4px 4px 0; border-left: 0; }
.operation label:has(input:checked) { background: #edf2f0; border-color: #12665c; }
label { display: grid; gap: 5px; font-size: 14px; }
input[type=file] { width: 100%; font-size: 13px; padding: 9px 0; }
select { width: 100%; border: 1px solid #a8b7b1; border-radius: 4px; padding: 9px; background: #fff; color: #202426; }
.status { font-size: 14px; margin: 8px 0; overflow-wrap: anywhere; }
.status.error { color: #922f43; }
.output { border-top: 1px solid #d7dedd; padding: 14px 0; }
.output > span { display: block; margin-bottom: 8px; font-size: 14px; overflow-wrap: anywhere; }
progress { width: 100%; height: 8px; accent-color: #12665c; }
footer { font-size: 13px; color: #5b6665; border-top: 1px solid #d7dedd; }
.definition pre { overflow: auto; padding: 12px; background: #edf2f0; font-size: 13px; }
.skip-link { position: absolute; left: 16px; top: -80px; background: #fff; padding: 10px; z-index: 10; }
.skip-link:focus { top: 12px; }
.eyebrow { font-size: 12px; color: #922f43; font-weight: 600; margin-bottom: 12px; }
.lead { font-size: 22px; line-height: 1.4; color: #202426; max-width: 760px; }
.project-index { margin: 28px 0; border-top: 2px solid #202426; }
.project-index a { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid #d7dedd; text-decoration: none; }
.project-index strong { font-size: 18px; }
.project-index span { color: #5b6665; font-size: 14px; }
.section-nav { display: flex; flex-wrap: wrap; gap: 10px 22px; padding: 12px 0; margin: 18px 0 24px; border-bottom: 1px solid #d7dedd; font-size: 14px; }
.section-nav [aria-current=page] { color: #922f43; font-weight: 700; }
.example-pair, .architecture-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }
.example-pair > div, .architecture-overview > div { min-width: 0; }
.source-example { max-width: 780px; }
.format-sample { display: flex; gap: 28px; align-items: start; }
.format-sample img { width: 156px; height: auto; flex: 0 0 156px; image-rendering: pixelated; }
.core-map { margin: 0; max-width: 460px; }
.core-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; aspect-ratio: 1; }
.core-grid span { display: flex; align-items: center; justify-content: center; min-width: 0; font-family: ui-monospace, monospace; font-size: 13px; border: 1px solid #12665c; background: #e7f0ed; }
.core-grid .system-core { background: #922f43; border-color: #922f43; color: #fff; }
figcaption { font-size: 12px; color: #5b6665; margin: 10px 0 0; }
.legend-system { color: #922f43; font-weight: 600; }
.legend-application { color: #12665c; font-weight: 600; margin-left: 12px; }
.facts { margin: 0 0 18px; }
.facts > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-bottom: 1px solid #d7dedd; font-size: 14px; }
.facts dt { color: #5b6665; }
.facts dd { margin: 0; font-weight: 600; }
.document-layout { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: 32px; align-items: start; }
.document-layout aside { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: auto; }
.contents { font-size: 12px; border-right: 1px solid #d7dedd; padding-right: 16px; }
summary { cursor: pointer; font-weight: 600; }
.contents ol { list-style: none; margin: 14px 0; padding: 0; }
.contents li { margin: 0 0 10px; }
.contents a { text-decoration: none; }
.specification { min-width: 0; overflow-wrap: anywhere; font-size: 15px; }
.specification h1 { font-size: 30px; margin-top: 0; }
.specification h2 { margin-top: 34px; padding-top: 18px; border-top: 1px solid #d7dedd; }
.specification h4 { font-size: 15px; }
.specification table { min-width: 560px; }
.specification td { width: auto; }
.specification th { min-width: 110px; }
.specification pre { overflow-wrap: normal; }
.specification [id] { scroll-margin-top: 20px; }
.source-reference { color: #5b6665; text-decoration: underline dotted; }
.historical-source { border-top: 1px solid #d7dedd; padding-top: 18px; margin: 24px 0; }
.historical-source pre { max-height: 600px; }
.grammar-source { overflow-wrap: normal; }
#preview pre { max-height: 360px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.scene-preview { width: 100%; height: 360px; }
.scene-preview canvas { display: block; width: 100%; height: 360px; }
.frame-controls { display: flex; align-items: center; gap: 16px; margin: 12px 0; }
.frame-controls input { flex: 1; min-width: 0; }
.definition li { margin-bottom: 8px; }
@media (max-width: 600px) {
  header, main, footer, .family-nav { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 34px; } h1 span { font-size: 16px; }
  form { grid-template-columns: minmax(0, 1fr) 140px; }
  .file-label { grid-column: 1 / -1; }
  table { min-width: 560px; } th, td { padding: 10px 8px; }
  td audio { max-width: 215px; }
  .project-index a { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .example-pair, .architecture-overview { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .format-sample { flex-wrap: wrap; gap: 18px; }
  .lead { font-size: 20px; }
  .core-map { width: 100%; max-width: 400px; }
  .facts > div { grid-template-columns: 98px minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 850px) {
  .document-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .document-layout aside { position: static; max-height: 180px; }
  .contents { border-right: 0; border-bottom: 1px solid #d7dedd; padding-bottom: 12px; }
  .specification h1 { font-size: 28px; }
}
