/* Readable module sizes from XOR-051; XOR-052 group surfaces and outlines follow below. */
html body main{width:1280px;max-width:calc(100% - 16px);padding:8px 0 24px;font-size:14px;line-height:20px}
html body .layout,html body.row-layout .layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:16px;align-items:start}
html body .layout>figure,html body .field-scroll,html body.row-layout .layout>figure,html body.row-layout .field-scroll{width:100%;min-width:0;max-width:100%}
html body .controls,html body.row-layout .controls{display:grid;width:100%;grid-template-columns:minmax(0,1fr);gap:4px}
html body .controls>section{padding:0;border:1px solid var(--line2);width:100%;min-width:0}
html body main .controls h2{margin:0;font-size:14px;line-height:32px}
html body main button{--compact-w:128px!important;width:var(--compact-w)!important;min-width:var(--compact-w)!important;max-width:var(--compact-w)!important;flex:0 0 var(--compact-w)!important;height:32px!important;min-height:32px!important;max-height:32px!important;line-height:30px!important;padding:0 8px!important;background:var(--btn)!important;color:var(--ink)!important;border:1px solid var(--line)!important;box-shadow:none;text-shadow:none}
html body main button:hover,html body main button:focus-visible{border-color:var(--mut)!important}
html body main button[aria-pressed=true]{border-color:var(--red)!important;box-shadow:inset 0 0 0 1px var(--red)}
html body main button:active{box-shadow:inset 0 0 0 2px var(--red)}
html body main button[data-compact]{font-size:0!important}
html body main button[data-compact]::after{font:14px/30px var(--font)!important;max-width:100%;overflow:hidden;text-overflow:ellipsis;pointer-events:none}
html body main button[data-menu-width][data-menu-width=wide]{--compact-w:256px!important}
html body main button[data-menu-width][data-menu-width=mini]{--compact-w:64px!important}
html body main button[data-menu-width][data-menu-width=arrow],html body main button.step{--compact-w:32px!important}
html body main #thumbPlay{--compact-w:64px!important}
html body main #fitFieldTop{--compact-w:128px!important}
html body main button[data-menu-width][data-menu-width=wide]{max-width:100%!important;min-width:0!important}
html body main .controls button.menu-heading{--compact-w:100%!important;display:flex;justify-content:space-between;text-align:left;font:14px/30px var(--font)!important;padding:0 8px!important}
html body main button.menu-heading::after{content:'+';font:14px/30px var(--font);pointer-events:none}
html body main button.menu-heading[aria-expanded=true]::after{content:'−'}
.menu-body{padding:8px}.menu-body[hidden]{display:none!important}
.menu-summary{font-size:14px;line-height:20px;margin:0 0 8px;color:var(--mut)}
html body .group,html body .group.role,html body .search-actions,html body .playback-row{gap:4px;margin-top:4px;flex-wrap:wrap}
html body main .bar{height:auto;min-height:32px;font-size:14px;line-height:20px;gap:4px;flex-wrap:wrap}
html body main small,html body main .caption,html body main .meta,html body main output{font-size:14px;line-height:20px}
html body .caption{height:auto;gap:4px;justify-content:flex-start;margin-bottom:8px}
html body .caption #count{margin-left:auto}
html body .layout-strip{padding:8px 0;margin-top:8px;border-bottom:1px solid var(--line2)}
html body .layout-strip .playback-row{margin-top:4px}
html body .slider-row,html body .x-range,html body .frame-range,html body .x-thumb{height:32px;min-height:32px}
html body .slider-row{width:100%;gap:4px}
html body .x-range{width:auto;flex:1 1 0;min-width:0}
html body .x-number{font-size:14px;line-height:32px}
html body .x-bracket{font-size:24px;line-height:32px}
html body .frame-range .x-thumb{left:min(calc(50% + 64px),100%)!important}
html body main .preview-row,html body main .edit-row{display:grid;width:256px;max-width:100%;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:8px auto 0}
html body main .preview-row .tile{--compact-w:64px!important;width:64px!important;min-width:0!important;max-width:100%!important;height:64px!important;min-height:64px!important;max-height:64px!important;flex:none!important;padding:0!important;gap:0}
html body main .preview-row .tile svg{width:40px;height:40px}
html body main .preview-row .tile span{font-size:14px;line-height:20px;height:20px}
html body main .edit-row button{--compact-w:64px!important;padding:0!important}
html body .legend{font-size:14px;line-height:20px;gap:8px;margin-top:8px}
html body .field-help{width:100%;max-width:100%;margin-top:12px}
html body main .hint,html body main .sym-note,html body main .field-help p,html body main summary,html body main .xs-explain,html body main .xs-camera-note{font-size:14px;line-height:20px;white-space:normal;overflow-wrap:anywhere}
html body main details{margin-top:8px}
html body main summary{min-height:32px;cursor:pointer;color:var(--ink)}
html body main h3{font:14px/20px var(--font);margin:12px 0 4px}
html body main input:not([type=range]):not([type=checkbox]):not([type=file]),html body main select{height:32px!important;min-height:32px!important;font-size:14px!important;line-height:30px;padding:0 4px}
html body main input[type=number]{width:64px!important;max-width:128px}
html body main input[type=checkbox]{width:24px;height:24px;flex:none}
html body .color-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
html body .color-grid label{font-size:14px;line-height:20px;gap:4px;flex-wrap:wrap}
html body .color-grid input[type=color]{width:32px!important;min-width:32px;flex:0 0 32px;padding:0!important}
html body .search-input-wrap,html body .search-input-wrap textarea{min-height:128px;width:100%;flex-basis:100%}
html body .search-input-wrap textarea,html body .search-highlight{font-size:14px;line-height:20px;padding:4px}
html body .search-highlight .line{font-size:14px;line-height:20px;min-height:24px}
html body .found-list{max-height:256px}
html body main .found-chip{--compact-w:64px!important;font-size:14px!important}
html body .row-track{height:auto;gap:4px;flex-wrap:wrap;padding:8px 0;border-top:1px solid var(--line2)}
html body .row-track .row-name{width:100%;font-size:14px}
html body main .row-track button{--compact-w:128px!important}
html body main .row-track button[data-menu-width=arrow]{--compact-w:32px!important}
html body main .row-track input{height:32px;font-size:14px}
html body #spaceMount{margin-top:24px}
html body main .xor-space h2,html body main .xs-status,html body main .xs-symmetry-rays,html body main .xs-distance-label,html body main .xs-sequence [data-status]{font-size:14px;line-height:20px}
html body .xor-space .xs-controls{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
html body .xor-space .xs-actions,html body .xor-space .xs-symmetry,html body .xor-space .xs-shift,html body .xs-sequence-controls,html body .xs-export-range,html body .xs-export-actions{display:flex;flex-wrap:wrap;gap:4px;min-width:0}
html body .xor-space .xs-figure{padding:8px;border:1px solid var(--line2);gap:4px}
html body .xor-space .xs-figure select{width:128px;max-width:100%;min-width:0}
html body .xor-space .xs-figure label,html body .xs-export-range label,html body .xs-sequence-controls label,html body .xs-centres{font-size:14px;line-height:20px;min-height:32px}
html body .xor-space .xs-main{width:100%;height:auto;aspect-ratio:2/1;min-height:256px}
html body .xs-sequence-position{min-height:32px}
html body #audioFile{height:auto;font-size:14px;line-height:20px}
html body #audioFile::file-selector-button{width:128px;height:32px;font-size:14px;line-height:30px}
html body #film select{max-width:100%;min-height:32px}
html body .page-footer{height:auto;min-height:32px}
@media(max-width:900px){html body .layout,html body.row-layout .layout{grid-template-columns:minmax(0,1fr);gap:16px}html body .controls,html body.row-layout .controls{grid-template-columns:minmax(0,1fr);width:100%}html body .xor-space .xs-controls{grid-template-columns:minmax(0,1fr)}}
@media(max-width:420px){html body main{max-width:calc(100% - 8px)}html body .menu-body{padding:4px}html body .xor-space .xs-main{aspect-ratio:1;min-height:0}html body .xor-space .xs-projections{grid-template-columns:minmax(0,1fr)}}

/* XOR-052: group colours stay constant; only the outline shows interaction. */
html body main{--menu-accent:#8dbafa;--menu-text:#e6edfa;--menu-btn:#1b2430;--menu-base:#0e1116}
[data-menu-group=layout]{--menu-accent:#72caff;--menu-text:#d8efff;--menu-btn:#182a36;--menu-base:#101c25}
[data-menu-group=figures]{--menu-accent:#ffc478;--menu-text:#fff0db;--menu-btn:#30271d;--menu-base:#201a13}
[data-menu-group=view]{--menu-accent:#7ee1b3;--menu-text:#d6f8e8;--menu-btn:#1a2d27;--menu-base:#111e1a}
[data-menu-group=position]{--menu-accent:#8cc5f6;--menu-text:#dfedff;--menu-btn:#1b2938;--menu-base:#121c26}
[data-menu-group=overlay]{--menu-accent:#d3acff;--menu-text:#f0e3ff;--menu-btn:#2a2238;--menu-base:#1b1625}
[data-menu-group=search]{--menu-accent:#ffe28a;--menu-text:#fff5d9;--menu-btn:#302b1d;--menu-base:#201d14}
[data-menu-group=field]{--menu-accent:#8cddd9;--menu-text:#daf4f3;--menu-btn:#1a2d30;--menu-base:#121e20}
[data-menu-group=colors]{--menu-accent:#f6a9ce;--menu-text:#ffe0ee;--menu-btn:#322333;--menu-base:#211822}
[data-menu-group=film]{--menu-accent:#ffab92;--menu-text:#ffe7df;--menu-btn:#32241f;--menu-base:#211915}
[data-menu-group=space]{--menu-accent:#b4baff;--menu-text:#e8e9ff;--menu-btn:#25273a;--menu-base:#191a27}
[data-menu-group=library]{--menu-accent:#9bd3b4;--menu-text:#e4f6eb;--menu-btn:#203028;--menu-base:#152019}
html body main .controls>section{border:0;border-top:2px solid var(--menu-accent);background:var(--menu-base);color:var(--menu-text);padding:2px;gap:2px}
html body main .controls{gap:6px}
html body main .controls h2{margin:0}
html body main .controls button.menu-heading{color:var(--menu-accent)!important;font-weight:bold!important;text-align:center;justify-content:center;padding:0 24px!important}
html body main button.menu-heading::after{position:absolute;right:12px;color:var(--menu-accent);font-size:20px}
html body main button.menu-heading[aria-expanded=true]{background:transparent!important}
html body main button{position:relative;isolation:isolate;border:0!important;outline:0!important;border-radius:0!important;clip-path:polygon(8px 0,calc(100% - 8px) 0,100% 50%,calc(100% - 8px) 100%,8px 100%,0 50%)!important;background:var(--menu-btn)!important;color:var(--menu-text)!important;box-shadow:none!important;text-shadow:none!important;padding:0 10px!important;user-select:none;--menu-stroke:0px}
html body main button:hover,html body main button:focus-visible{--menu-stroke:1px;background:var(--menu-btn)!important;color:var(--menu-text)!important}
html body main button[aria-pressed=true],html body main button[aria-expanded=true]{--menu-stroke:2px;box-shadow:none!important}
html body main button:active:not(:disabled){--menu-stroke:3px;box-shadow:none!important}
html body main button::before{content:'';position:absolute;inset:0;pointer-events:none;background:var(--menu-accent);clip-path:polygon(evenodd,0 50%,8px 0,calc(100% - 8px) 0,100% 50%,calc(100% - 8px) 100%,8px 100%,0 50%,var(--menu-stroke) 50%,calc(8px + var(--menu-stroke) * .5) var(--menu-stroke),calc(100% - 8px - var(--menu-stroke) * .5) var(--menu-stroke),calc(100% - var(--menu-stroke)) 50%,calc(100% - 8px - var(--menu-stroke) * .5) calc(100% - var(--menu-stroke)),calc(8px + var(--menu-stroke) * .5) calc(100% - var(--menu-stroke)),var(--menu-stroke) 50%);mask-image:linear-gradient(90deg,#000 12px,transparent 12px,transparent calc(100% - 12px),#000 calc(100% - 12px))}
html body main button[aria-pressed=true]::before,html body main button[aria-expanded=true]::before,html body main button:active:not(:disabled)::before{mask-image:none}
html body main button:focus-visible::before{mask-image:none}
html body main button:disabled{--menu-stroke:0px;opacity:.4}
html body main button[data-compact]::after{color:var(--menu-text);text-shadow:none}
html body main .ico,html body main button[aria-pressed=true] .ico{color:var(--menu-accent)}
html body main .menu-body{padding:8px 4px}
html body main .menu-summary{color:var(--menu-text);opacity:.85;margin-bottom:8px}
html body main .menu-body h3,html body main .menu-body summary,html body main .menu-body .field-label,html body main .menu-body .bar>label{color:var(--menu-accent)}
html body main .menu-body h3{border-top:1px solid var(--menu-accent);padding-top:8px}
html body main .group,html body main .group.role,html body main .search-actions,html body main .playback-row{gap:2px}
html body main .color-grid{grid-template-columns:minmax(0,1fr);gap:8px}
html body main .menu-color-family{margin:0;padding:4px;border:0;border-top:1px solid var(--menu-accent);display:grid;gap:4px;min-width:0}
html body main .menu-color-family legend{color:var(--menu-accent);padding:0 4px}
html body main .menu-color-family label{display:flex;align-items:center;justify-content:space-between;gap:8px}
html body main .menu-color-family input[type=color]{margin-left:auto}
html body main input:not([type=range]):not([type=checkbox]):not([type=color]),html body main select{background:var(--menu-btn)!important;color:var(--menu-text)!important;border-color:var(--menu-accent)!important}
html body main #spaceMount{border-top:2px solid var(--menu-accent)}
html body main .xor-space .xs-figure{background:var(--menu-base);border-color:var(--menu-accent)}
html body main .xor-space .xs-figure label{color:var(--menu-text)}
html body main .xs-heading h2,html body main .xs-sequence h3,html body main .xs-export h3{color:var(--menu-accent)}
html body main #thumbPlay{--compact-w:128px!important}
html body main .menu-body [hidden]{display:none!important}
@media(max-width:420px){html body main .menu-body{padding:4px 2px}}
html body main button[data-hover-off]:not(:focus-visible):not(:active){--menu-stroke:0px}
html body main .controls button.menu-heading[aria-expanded=true]::before{mask-image:linear-gradient(#000 50%,transparent 50%)}
html body main .menu-body{position:relative;padding-bottom:14px}
html body main .menu-body::after{content:'';position:absolute;left:0;right:0;bottom:0;height:10px;pointer-events:none;border-bottom:2px solid var(--menu-accent);clip-path:polygon(0 0,8px 100%,calc(100% - 8px) 100%,100% 0,calc(100% - 2px) 0,calc(100% - 9px) calc(100% - 2px),9px calc(100% - 2px),2px 0);background:var(--menu-accent)}
html body main textarea,html body main #audioFile::file-selector-button{background:var(--menu-btn)!important;color:var(--menu-text)!important;border-color:var(--menu-accent)!important}
html body main #audioFile::file-selector-button:hover{background:var(--menu-btn)!important}

/* XOR-053: explicit normal widths beat the older [data-compact] 32px rule. */
html body{font-size:14px;line-height:20px}
html body header h1{font-size:clamp(24px,5vw,36px)}
html body .hub-link,html body .version,html body .page-footer{font-size:14px}
html body main button[data-compact][data-menu-width=normal]{--compact-w:128px!important}
html body main button[data-compact]::after{white-space:normal;overflow:visible;text-overflow:clip;font-size:14px!important;line-height:14px!important;overflow-wrap:anywhere}
html body main .edit-row button[data-compact]{padding:0 3px!important}
html body main .edit-row button[data-compact]::after{font-size:12px!important}
html body main .kraft-palettes{display:flex;flex-wrap:wrap;gap:4px}
html body main .kraft-palettes button{padding-left:26px!important}
html body main .kraft-palettes button::after{max-width:100%;font-size:12px!important;line-height:14px!important}
html body main .kraft-palettes button{background:linear-gradient(90deg,var(--palette-bg) 10px,var(--palette-bg) 17px,var(--palette-bit) 17px,var(--palette-bit) 24px,var(--menu-btn) 24px)!important}

/* XOR-058: rectangular controls, filled rows, two columns or a full-width singleton. */
html body main button{clip-path:none!important;border-radius:0!important;border:1px solid transparent!important;box-shadow:none!important}
html body main button::before{display:none!important}
html body main button:hover,html body main button:focus-visible{border-color:var(--menu-accent)!important}
html body main button[aria-pressed=true],html body main button[aria-expanded=true]{border-color:var(--menu-accent)!important;box-shadow:inset 0 0 0 1px var(--menu-accent)!important}
html body main button:active:not(:disabled){border-color:var(--menu-accent)!important;box-shadow:inset 0 0 0 2px var(--menu-accent)!important}
html body main button[data-hover-off]:not(:focus-visible):not(:active){border-color:transparent!important;box-shadow:none!important}
html body main button[data-compact][data-menu-width]{--compact-w:100%!important;width:100%!important;min-width:0!important;max-width:100%!important;flex:1 1 0!important;padding:0 6px!important}
html body main button.step[data-menu-width=arrow]{--compact-w:32px!important;width:32px!important;min-width:32px!important;max-width:32px!important;flex:0 0 32px!important}
html body main #thumbPlay[data-compact]{--compact-w:96px!important;width:96px!important;min-width:96px!important;max-width:96px!important;flex:0 0 96px!important}
html body main .menu-button-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:2px!important;margin:2px 0 0!important;align-items:stretch}
html body main .menu-button-grid>button:last-child:nth-child(odd){grid-column:1/-1}
html body main .menu-button-grid>button{width:100%!important;min-width:0!important;max-width:100%!important}
html body main .menu-body{padding:4px;gap:2px}
html body main .menu-body::after{display:none!important}
html body main .menu-summary{margin:0 0 4px}
html body main .controls{gap:2px}
html body main .controls>section{padding:2px}
html body main .preview-row{width:100%;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px;margin:4px 0}
html body main .figure-pair{display:grid;grid-template-columns:minmax(0,1fr);gap:2px;min-width:0}
html body main .preview-row .figure-pair .tile{width:100%!important;max-width:100%!important;min-width:0!important}
html body main .figure-pair button[data-compact]::after{font-size:14px!important}
html body main .xs-figure{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px;padding:4px}
html body main .xs-figure>label,html body main .xs-figure>.xs-roll,html body main .xs-shift{grid-column:1/-1}
html body main .xs-shift{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px}
html body main .xs-shift>.xs-pick{grid-column:1/-1}
html body main .xs-shift label{width:100%;min-width:0}
html body main .xs-symmetry{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px}
html body main .xs-symmetry>span{grid-column:1/-1}
html body main .row-track{padding:4px 0;gap:2px}
html body main #audioFile::file-selector-button{border-radius:0;clip-path:none}
html body main .kraft-palettes button[data-compact]{padding-left:26px!important}
@media(max-width:340px){html body main .menu-button-grid{grid-template-columns:minmax(0,1fr)}}

html body main .row-track{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px}
html body main .row-track>.row-name,html body main .row-track>label,html body main .row-track>button[id^=rowAuto]{grid-column:1/-1}
html body main .row-track>label{display:flex;gap:4px}
html body main .xs-sequence-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px}
html body main .xs-sequence-controls>label{grid-column:1/-1}
html body main .caption #fitFieldTop[data-compact]{width:112px!important;min-width:112px!important;max-width:112px!important;flex:0 0 112px!important}
html body main .xs-export-range{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px}
html body main .xs-export-range>label{grid-column:1/-1}
html body main .preview-row>.figure-pair{padding:0!important;margin:0!important;gap:2px!important;align-content:start}

/* XOR-062: one selected occurrence, other hits remain quiet. */
html body main .search-pattern-list{display:grid;grid-template-columns:minmax(0,1fr);gap:2px;max-height:240px;overflow:auto;margin:2px 0}
html body main .search-pattern-list:empty{display:none}
html body main button.search-pattern{display:flex;justify-content:space-between;align-items:center;gap:8px;width:100%!important;min-width:0!important;max-width:100%!important;padding:0 6px!important;font:14px/20px "AzBuk Mono",var(--font)!important;text-align:left}
html body main .search-pattern-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
html body main .search-pattern small{flex:none;font-size:12px;line-height:16px}
html body main button.search-pattern.found{border-color:#ffe14d66!important;color:#e4ce73!important}
html body main button.search-pattern[aria-pressed=true]{border-color:#ffe14d!important;box-shadow:inset 0 0 0 1px #ffe14d!important;color:#ffe14d!important}
html body main .search-highlight .line.found{background:#ffe14d24;color:var(--ink)}
html body main .search-highlight .line.current{background:#ffe14d70;color:var(--ink)}
html body main .search-cell-other{fill:#ffe14d;fill-opacity:.12;stroke:#ffe14d;stroke-opacity:.25;stroke-width:.04}
html body main .search-cell-current{fill:#ffe14d;fill-opacity:.78;stroke:#fff5a5;stroke-opacity:1;stroke-width:.14}
html body main .search-input-wrap{background:var(--menu-btn)}
html body main #searchPattern{background:transparent!important;color:transparent!important;caret-color:var(--menu-text)}
html body main #searchPattern,html body main .search-highlight{font-family:"AzBuk Mono",var(--font),monospace;font-size:14px;line-height:20px;padding:4px}
html body main .search-highlight .line{line-height:20px;min-height:20px}

/* Glyphen 3D shares the original swatches and compact colour panel. */
html body main .xs-colours{width:320px;max-width:100%;margin-top:4px;padding:2px;border-top:2px solid var(--menu-accent);background:var(--menu-base);color:var(--menu-text)}
html body main .xs-colours>h3{margin:0}
html body main .xs-colours .menu-heading{--compact-w:100%!important;display:block;color:var(--menu-accent)!important;font:700 14px/30px var(--font)!important;padding:0 24px!important}
