/* Focused drawing workspace. Only a zoomed canvas is cropped; no scroll UI. */
.painting-game .app-header{min-height:48px;padding:2px 16px;gap:10px}
.painting-game .header-title h1{font-size:15px;letter-spacing:0}
.painting-game .header-title small{display:none}
.painting-game .screen-body{padding:8px 16px 12px;overflow:clip}
.painting-game .game-layout{display:flex;flex-direction:column;height:100%;gap:0}
.painting-game .instruction-line,.painting-game .game-status{display:none}
.painting-game .game-layout #game-root.paint-focus{display:flex;flex:1;min-width:0;min-height:0;flex-direction:column;gap:10px}
.paint-focus .paint-sheets{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;flex:1;min-height:0;min-width:0}
.paint-focus .paint-sheets:has(.paint-model){grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.paint-focus .paint-paper,.paint-focus .paint-model{display:flex;flex-direction:column;min-height:0;min-width:0;background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:10px}
.paint-focus .paint-sheet-heading{display:flex;align-items:center;justify-content:space-between;min-height:28px;font-size:12px;font-weight:650;color:var(--secondary-text);padding:0 6px}
.paint-focus .paint-sheet-heading .reference-toggle{min-width:44px;min-height:28px;height:28px;padding:4px 8px;border:0;background:transparent}
.paint-focus .reference-toggle .ui-icon{width:18px;height:18px}
.paint-focus .paint-viewport{flex:1;position:relative;min-width:0;min-height:0;border:0;padding:0;border-radius:0;overflow:clip;overscroll-behavior:contain;--ruler-size:20px}
.paint-focus .paint-surface{position:absolute;left:var(--ruler-size);top:var(--ruler-size);right:0;bottom:0;overflow:clip;touch-action:none}
.paint-focus .pixel-board{position:absolute;left:0;top:0;margin:0;max-width:none;display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr));touch-action:none;will-change:transform}
.paint-focus .cell{height:var(--cell-size);min-width:0;min-height:0;aspect-ratio:auto;border-width:.5px;border-color:#c6cbd4;font-size:clamp(6px,calc(var(--cell-size)*.58),14px);padding:0;line-height:1}
.paint-focus .paint-top-ruler{position:absolute;top:0;left:var(--ruler-size);right:0;height:var(--ruler-size);overflow:clip;background:var(--surface)}
.paint-focus .paint-left-ruler{position:absolute;left:0;top:var(--ruler-size);bottom:0;width:var(--ruler-size);overflow:clip;background:var(--surface)}
.paint-focus .coordinate-columns{position:static;height:100%;display:grid;grid-template-columns:repeat(var(--cols),minmax(0,1fr))}
.paint-focus .coordinate-rows{position:static;width:100%;display:grid;grid-template-rows:repeat(var(--rows),minmax(0,1fr))}
.paint-focus .coordinate-columns span,.paint-focus .coordinate-rows span{font-size:9px;background:var(--surface);color:var(--secondary-text)}
.paint-focus .paint-ruler-corner{position:absolute;top:0;left:0;width:var(--ruler-size);height:var(--ruler-size);background:var(--surface)}
.paint-focus .coordinates-off .paint-top-ruler,.paint-focus .coordinates-off .paint-left-ruler,.paint-focus .coordinates-off .paint-ruler-corner{display:none}
.paint-focus .paint-dock{display:flex;align-items:center;justify-content:center;gap:16px;flex-shrink:0;min-width:0}
.paint-focus .paint-tool-row{display:flex;align-items:center;gap:6px;flex-wrap:nowrap;margin:0}
.paint-focus .paint-tool-row button{flex:none;min-width:44px;min-height:44px;width:auto;max-width:none;padding:10px 14px;font-size:12px}
.paint-focus .paint-tool-row .paint-color-current{display:flex;gap:8px;min-width:100px;background:var(--surface)}
.paint-color-current i{display:block;width:24px;height:24px;border-radius:8px;border:1px solid #25283d33;background:var(--current-color)}
.paint-focus .verify-paint{min-height:44px;padding:10px 22px}
.paint-focus .paint-verification{margin:0;padding:0;text-align:center;font-size:12px;background:transparent}
.paint-focus .paint-verification[hidden]{display:none}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important}
.paint-focus .paint-model-space{flex:1;min-height:0;min-width:0;display:grid;place-items:center}
.clean-reference.coordinate-frame{width:calc(var(--reference-side) + var(--reference-gutter));max-width:100%;grid-template-columns:var(--reference-gutter) var(--reference-side);grid-template-rows:var(--reference-gutter) var(--reference-side);margin:auto}
.clean-reference.coordinate-frame.coordinates-off{grid-template-columns:var(--reference-side);grid-template-rows:var(--reference-side)}
.clean-reference .reference-grid{width:100%!important;height:100%;grid-template-columns:repeat(var(--cols),minmax(0,1fr))}
.clean-reference .reference-grid span{border:.5px solid #25283d22;min-width:0;min-height:0;aspect-ratio:auto}
.clean-reference .coordinate-columns,.clean-reference .coordinate-rows,.clean-reference .coordinate-corner{position:static}
.clean-reference .coordinate-columns span,.clean-reference .coordinate-rows span{font-size:8px;background:transparent;color:var(--secondary-text)}
.clean-reference .coordinate-corner{background:transparent;color:transparent}
.clean-palette.paint-palette{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.clean-palette .paint-color{width:100%;min-height:48px;justify-content:flex-start;font-size:13px}
.clean-paint-options{display:flex;flex-direction:column;gap:12px;margin-bottom:14px}
.clean-option-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.clean-option-buttons button{padding:8px;font-size:12px;min-height:44px}
.clean-paint-options .assistance-help{margin:0;font-size:12px;padding:8px}
.clean-paint-options summary{font-size:13px;cursor:pointer;padding:10px 0;color:var(--primary)}
.clean-paint-options .paint-guide{font-size:12px}
@media(max-width:760px) and (orientation:portrait){
 .painting-game .screen-body{padding:4px 8px 8px}
 .painting-game .app-header{padding:2px 10px;min-height:46px}
 .paint-focus .paint-sheets{gap:6px}
 .paint-focus .paint-sheets:has(.paint-model){grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(92px,28%) minmax(0,1fr)}
 .paint-focus .paint-paper,.paint-focus .paint-model{border-radius:14px;padding:5px}
 .paint-focus .paint-sheet-heading{font-size:11px;min-height:24px}
 .paint-focus .paint-model .paint-sheet-heading{position:absolute;left:12px;top:4px;right:8px;pointer-events:none}
 .paint-focus .paint-model{position:relative;padding:4px 48px}
 .paint-focus .paint-model .reference-toggle{pointer-events:auto;min-height:44px;min-width:44px}
 .paint-focus .paint-dock{gap:8px;flex-wrap:wrap}
 .paint-focus .paint-tool-row{gap:5px}
 .paint-focus .paint-tool-row button{min-width:44px;max-width:44px;width:44px;padding:9px}
 .paint-focus .paint-tool-row button span{display:none}
 .paint-focus .paint-tool-row .paint-color-current{min-width:54px;max-width:54px;width:54px}
 .paint-focus .verify-paint{min-width:110px}
 .paint-focus .paint-top-ruler span,.paint-focus .paint-left-ruler span{font-size:8px}
}
@media(max-width:420px) and (orientation:portrait){.paint-focus .paint-dock{gap:6px}.paint-focus .verify-paint{min-width:0;flex:1;padding:10px 9px}.paint-focus .paint-tool-row{gap:3px}.paint-focus .paint-tool-row .paint-color-current{min-width:44px;max-width:44px;width:44px}}
@media(max-height:480px){
 .painting-game .screen-body{padding:2px 8px 6px}
 .paint-focus .paint-sheets{gap:8px}
 .paint-focus .paint-paper,.paint-focus .paint-model{padding:4px}
 .paint-focus .paint-sheet-heading{min-height:22px;font-size:10px}
 .paint-focus .paint-tool-row button{padding:8px 10px;font-size:11px}
 .paint-focus .paint-tool-row button span{display:none}
 .paint-focus .paint-tool-row .paint-color-current{min-width:44px}
 .paint-focus .paint-dock{gap:10px}
}
dialog.sheet[open]:has(.clean-paint-options){display:flex;flex-direction:column;overflow:clip;width:min(460px,calc(100% - 24px));max-height:calc(100dvh - 24px)}dialog.sheet:has(.clean-paint-options)>h2{flex-shrink:0}dialog.sheet:has(.clean-paint-options)>p:empty{display:none}dialog.sheet:has(.clean-paint-options)>.pause-links{min-height:0;overflow:auto;scrollbar-width:none;overscroll-behavior:contain}dialog.sheet:has(.clean-paint-options)>.pause-links::-webkit-scrollbar{display:none}dialog.sheet:has(.clean-paint-options)>.dialog-actions{flex-shrink:0;margin-top:12px}
@media(max-width:420px){.paint-focus .paint-tool-row{gap:3px}.paint-focus .paint-tool-row button{min-width:44px;max-width:44px;width:44px;padding:9px}.paint-focus .paint-tool-row button span{display:none}.paint-focus .paint-tool-row .paint-color-current{min-width:44px;max-width:44px}.paint-focus .paint-dock{gap:6px}.paint-focus .verify-paint{min-width:0;flex:1;padding:10px 9px;font-size:12px}}
.painting-game .header-actions .icon-button{min-width:44px;width:44px}dialog.sheet[open]:has(.clean-palette){display:flex;flex-direction:column;overflow:clip}dialog.sheet:has(.clean-palette)>.clean-palette{min-height:0;overflow:auto;scrollbar-width:none}dialog.sheet:has(.clean-palette)>.clean-palette::-webkit-scrollbar{display:none}dialog.sheet:has(.clean-palette)>.dialog-actions{flex-shrink:0}
/* Model and drawing form two equal sheets in one vertical workspace. */
.paint-focus.paint-stacked .paint-sheets{display:flex;flex-direction:column;align-items:center;gap:12px;overflow-y:auto;overflow-x:clip;scrollbar-width:none;overscroll-behavior:contain;touch-action:pan-y;padding:0 0 4px}
.paint-focus.paint-stacked .paint-sheets::-webkit-scrollbar{display:none}
.paint-focus.paint-stacked .paint-model,.paint-focus.paint-stacked .paint-paper{flex:none;width:min(100%,600px);height:auto;aspect-ratio:1;padding:10px;position:relative}
.paint-focus.paint-stacked .paint-sheet-heading,.paint-focus.paint-stacked .paint-model .paint-sheet-heading{position:static;min-height:44px;height:44px;flex-shrink:0;pointer-events:auto;padding:0 6px}
.paint-focus.paint-stacked .paint-sheet-heading .reference-toggle{min-height:44px;height:44px}
.paint-focus.paint-stacked .paint-model-space,.paint-focus.paint-stacked .paint-viewport{flex:1;min-height:0}
.clean-paint-options .paint-menu-hint{margin:0;padding:12px;border:1px solid var(--primary);border-radius:12px;background:var(--primary-soft);color:var(--heading);font-size:13px;line-height:1.45}.clean-paint-options .paint-menu-hint[hidden]{display:none}
