/* One open visual palette; existing inputs remain the source of state. */
body[data-hammer-palette=tilemap] #editor-panel select{display:none!important}
body[data-hammer-palette=tilemap] #hammer-tile-art-controls>label:first-of-type{display:none!important}
body[data-hammer-palette=tilemap] #editor-panel .tool-category>summary,
body[data-hammer-palette=tilemap] #hammer-all-tile-previews>summary,
body[data-hammer-palette=tilemap] #editor-save-section>summary,
body[data-hammer-palette=tilemap] #hammer-level-advanced>summary{display:none!important}
body[data-hammer-palette=tilemap] .tilemap-section-label{font:700 10px/1.4 Orbitron,sans-serif;color:#a9c8e5;margin:10px 2px 7px;letter-spacing:.06em}
body[data-hammer-palette=tilemap] #editor-panel .tool-category{padding:4px;border:0;border-top:1px solid #33669966;background:transparent}
body[data-hammer-palette=tilemap] #editor-panel #tools{display:block;overflow:auto;min-height:140px;flex:1;overscroll-behavior:contain;padding-right:5px;scrollbar-color:#336699 #071322}
body[data-hammer-palette=tilemap] #editor-panel #editor-pane-tools{display:flex!important;flex-direction:column;flex:1;min-height:0;overflow:hidden}
body[data-hammer-palette=tilemap] #editor-panel{display:flex!important;flex-direction:column;overflow:hidden!important;padding:8px;box-sizing:border-box}
body[data-hammer-palette=tilemap] #editor-panel[hidden]{display:none!important}
body[data-hammer-palette=tilemap] #editor-panel .tool-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:4px!important}
body[data-hammer-palette=tilemap] #editor-panel .tool-card{position:relative;min-height:79px!important;padding:4px 2px!important;font:600 9px/1.3 'Segoe UI',sans-serif!important;overflow:hidden;white-space:normal}
body[data-hammer-palette=tilemap] #editor-panel .tool-card[hidden]{display:none!important}
body[data-hammer-palette=tilemap] #editor-panel .tool-card:focus-visible{outline:2px solid #fff;outline-offset:-2px}
body[data-hammer-palette=tilemap] #editor-panel .tool-card[aria-pressed=true]{outline:2px solid #badbff;outline-offset:-2px;background:#21466b!important}
body[data-hammer-palette=tilemap] #editor-panel .tool-card[data-tile-role=breakable]{border-bottom:3px solid #42d983}
body[data-hammer-palette=tilemap] #editor-panel .tool-card[data-tile-role=solid]{border-bottom:3px solid #ed6773}
body[data-hammer-palette=tilemap] #editor-panel .tool-card :is(.scenery-preview,.tool-card-visual){max-width:54px!important;max-height:54px!important;margin:2px auto 5px!important}
body[data-hammer-palette=tilemap] #editor-panel .tilemap-composite{display:block!important;position:relative;background:none!important;transform:none!important;filter:none!important;width:54px!important;height:54px!important}
body[data-hammer-palette=tilemap] #editor-panel .tilemap-composite:before,body[data-hammer-palette=tilemap] #editor-panel .tilemap-composite:after{display:none!important}
body[data-hammer-palette=tilemap] #editor-panel .tilemap-composite>canvas.tilemap-composite-canvas{display:block!important;width:100%;height:100%;image-rendering:pixelated}
body[data-hammer-palette=tilemap] #editor-panel #selected-tool-preview.tilemap-composite{width:62px!important;height:62px!important;max-width:62px!important;max-height:62px!important}
body[data-hammer-palette=tilemap] #selected-tool-preview.tilemap-composite>span{display:none!important}
body[data-hammer-palette=tilemap] #editor-panel #selected-tool-inspector{grid-column:1/-1;grid-template-columns:62px 1fr;padding:3px!important;margin:0!important;min-height:66px;border:0}
body[data-hammer-palette=tilemap] #selected-tool-inspector small,body[data-hammer-palette=tilemap] #selected-tool-description{display:none!important}
body[data-hammer-palette=tilemap] #selected-tool-name{font-size:11px}
body[data-hammer-palette=tilemap] #selected-tool-cell{font:10px/1.4 'Segoe UI',sans-serif}
body[data-hammer-palette=tilemap] #editor-panel #hammer-common-editor{gap:4px;margin:3px 0 5px;flex:none}
body[data-hammer-palette=tilemap] #hammer-common-editor>label{display:grid;grid-template-columns:72px 1fr;align-items:center}
body[data-hammer-palette=tilemap] #hammer-common-editor>.row{display:flex!important;gap:4px}
body[data-hammer-palette=tilemap] #hammer-common-editor>.row button{flex:1;min-height:25px!important;padding:4px!important}
body[data-hammer-palette=tilemap] #editor-panel #hammer-tile-art-controls{display:grid;grid-template-columns:1fr;gap:4px;padding:5px;border:1px solid #33669966;border-radius:5px}
body[data-hammer-palette=tilemap] #hammer-tile-art-controls>label,body[data-hammer-palette=tilemap] .hammer-tile-direction>label{gap:3px!important;font-size:9px!important}
body[data-hammer-palette=tilemap] .hammer-tile-direction{grid-template-columns:1fr auto;gap:4px}
body[data-hammer-palette=tilemap] .tilemap-choices,body[data-hammer-palette=tilemap] #tilemap-filter-bar{display:flex;flex-wrap:wrap;gap:3px;min-width:0}
body[data-hammer-palette=tilemap] #editor-panel .tilemap-choices button,body[data-hammer-palette=tilemap] #tilemap-filter-bar button{flex:1;min-width:0;min-height:25px;padding:4px 5px;font:600 10px/1.3 'Segoe UI',sans-serif;white-space:normal;background:#0a2138;border:1px solid #33669988;border-radius:3px;color:#c4d9ed}
body[data-hammer-palette=tilemap] #editor-panel .tilemap-choices button[aria-pressed=true],body[data-hammer-palette=tilemap] #tilemap-filter-bar button[aria-pressed=true]{background:#29557e;border-color:#afd4f4;color:#fff}
body[data-hammer-palette=tilemap] .tilemap-choices button[data-role=breakable]{box-shadow:inset 0 -2px #42d983}
body[data-hammer-palette=tilemap] .tilemap-choices button[data-role=solid]{box-shadow:inset 0 -2px #ed6773}
body[data-hammer-palette=tilemap] #hammer-tile-edge-controls .tilemap-choices{display:grid;grid-template-columns:repeat(5,minmax(0,1fr))}
body[data-hammer-palette=tilemap] #hammer-tile-edge-controls button{font-size:9px!important;padding:3px!important;min-height:24px!important}
body[data-hammer-palette=tilemap] #hammer-tile-rotate{min-height:25px!important;font-size:10px!important;padding:4px!important}
body[data-hammer-palette=tilemap] #hammer-editor-controls{padding:4px 0;flex:none}
body[data-hammer-palette=tilemap] #hammer-editor-controls>h3{display:none}
body[data-hammer-palette=tilemap] #editor-search{margin:0 0 5px!important;min-height:29px}
body[data-hammer-palette=tilemap] #tilemap-guide-legend{display:flex;align-items:center;gap:5px;font:10px/1.4 'Segoe UI',sans-serif;margin:6px 0;color:#abc7df}
body[data-hammer-palette=tilemap] #tilemap-guide-legend i{width:8px;height:8px;border-radius:2px;display:inline-block}
body[data-hammer-palette=tilemap] #tilemap-guide-legend .green{background:#42d983}
body[data-hammer-palette=tilemap] #tilemap-guide-legend .red{background:#ed6773}
body[data-hammer-palette=tilemap] #hammer-bg-gallery{grid-template-columns:repeat(3,minmax(0,1fr))!important}
body[data-hammer-palette=tilemap] #hammer-bg-preview{display:none}
body[data-hammer-palette=tilemap] #editor-panel #hammer-structure-actions{display:flex;padding:4px;gap:4px}
body[data-hammer-palette=tilemap] #editor-panel #hammer-structure-actions .tool-card{min-height:27px!important}
body[data-hammer-palette=tilemap] #editor-workbench-heading{margin-bottom:3px}
body[data-hammer-palette=tilemap] #editor-status{font-size:10px;margin:4px 0}
body[data-hammer-palette=tilemap] #editor-panel .editor-test-action{margin:3px 0}
body[data-hammer-palette=tilemap] #test-button{min-height:30px!important;padding:7px!important}
@media(min-width:1000px){body[data-hammer-palette=tilemap]:is([data-hammer-mode=editor],[data-hammer-test=true]) .workspace.editor-open{grid-template-columns:410px minmax(0,1fr)}}
@media(max-width:600px){body[data-hammer-palette=tilemap] #editor-panel{max-height:640px!important;min-height:560px}body[data-hammer-palette=tilemap] #editor-panel .tool-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}}

/* Keep the working area large: compact brush controls beside their preview. */
body[data-hammer-palette=tilemap] #editor-panel #hammer-tile-art-controls{grid-template-columns:70px minmax(0,1fr);gap:3px 7px;padding:5px}
body[data-hammer-palette=tilemap] #editor-panel #hammer-tile-art-controls #selected-tool-inspector{grid-column:1;grid-row:1/4;display:flex;flex-direction:column;align-self:center;text-align:center;gap:3px;overflow:hidden}
body[data-hammer-palette=tilemap] #editor-panel #hammer-tile-art-controls>:is(label,.hammer-tile-direction){grid-column:2;margin:0!important;padding:0!important;min-height:0}
body[data-hammer-palette=tilemap] #editor-panel #hammer-tile-art-controls #selected-tool-cell{display:none}
body[data-hammer-palette=tilemap] #editor-panel #hammer-tile-art-controls #selected-tool-name{font:600 9px/1.3 'Segoe UI',sans-serif}
body[data-hammer-palette=tilemap] #editor-panel #hammer-tile-art-controls .tilemap-choices button{min-height:23px!important;font:600 10px/1.25 'Segoe UI',sans-serif!important;padding:3px!important}
body[data-hammer-palette=tilemap] #editor-panel #hammer-tile-art-controls #hammer-tile-edge-controls .tilemap-choices button{min-height:22px!important;font-size:9px!important}
body[data-hammer-palette=tilemap] #editor-panel #hammer-common-editor>label{margin:0!important;min-height:30px}
body[data-hammer-palette=tilemap] #editor-panel #hammer-common-editor>label input{min-height:28px;height:28px;margin:0;padding:4px 7px}
body[data-hammer-palette=tilemap] #editor-panel #hammer-common-editor>.row{margin:0!important}
body[data-hammer-palette=tilemap] #editor-panel #hammer-common-editor>.row button{min-height:25px!important;margin:0!important}
body[data-hammer-palette=tilemap] #editor-panel #tools{overflow-x:hidden}
body[data-hammer-palette=tilemap] #editor-panel #tools>*{max-width:100%;min-width:0;box-sizing:border-box}
body[data-hammer-palette=tilemap] #editor-autodraft-state{display:block!important;font:9px/1.3 'Segoe UI',sans-serif;margin:3px 0!important}
body[data-hammer-palette=tilemap] #editor-panel label:has(>#hammer-world-bg){display:none}
body[data-hammer-palette=tilemap] #editor-panel #hammer-editor-controls :is(input,button){font:600 10px/1.3 'Segoe UI',sans-serif!important}
/* Six compact columns put the complete terrain set in reach at desktop height. */
body[data-hammer-palette=tilemap] #editor-panel #tools .tool-grid{grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:4px!important}
body[data-hammer-palette=tilemap] #editor-panel #tools .tool-grid .tool-card{min-height:76px!important;height:76px!important;padding:3px 1px!important;font:600 9px/1.2 'Segoe UI',sans-serif!important;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px}
body[data-hammer-palette=tilemap] #editor-panel #tools .tool-grid .tool-card>span:not(.scenery-preview):not(.tool-card-visual){font:600 9px/1.2 'Segoe UI',sans-serif!important;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;max-width:100%}
body[data-hammer-palette=tilemap] #editor-panel #tools .tool-grid .tool-card>small{font:8px/1.1 'Segoe UI',sans-serif!important}
body[data-hammer-palette=tilemap] #editor-panel #tools .tool-grid .tool-card :is(.scenery-preview,.tool-card-visual){width:42px!important;height:42px!important;max-width:42px!important;max-height:42px!important;margin:1px auto 3px!important;flex:none}
body[data-hammer-palette=tilemap] #editor-panel #tools .tool-grid .tool-card[hidden]{display:none!important}
body[data-hammer-palette=tilemap] #editor-panel #hammer-structure-actions{margin:0;padding:0 0 4px}
@media(max-width:600px){body[data-hammer-palette=tilemap] #editor-panel #tools .tool-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}}
