/* Cosmetic finishing wave. Paint-only treatments preserve tile, tool, and character geometry. */
:is([data-theme=paper],[data-theme=blueprint],[data-theme=night],[data-theme=club],[data-theme=overhead],[data-theme=wip-cart],[data-theme=lunch-break]) :is(.rack-tool,.tool-sprite,.attached-tools){font-variant-numeric:tabular-nums}
.rack-tool[aria-pressed=true]{outline:2px solid var(--forest);outline-offset:-2px}
.rack-tool:focus-visible,.tool-sprite:focus-visible,.map-node:focus-visible{outline:3px solid var(--focus);outline-offset:4px}
.rack-tool:disabled{border-style:dashed}
.table-changed{outline:2px dashed var(--focus);outline-offset:-4px}
.pair-focused{outline:2px solid var(--focus);outline-offset:-3px}
.note[data-state="1"] .mark,.note[data-state="2"] .mark,.note[data-state="3"] .mark{opacity:1;font-weight:700}
.character:has(img){background:none!important;border:0!important;box-shadow:none!important;overflow:visible}
:is([data-theme=night],[data-theme=overhead],[data-theme=wip-cart],[data-theme=lunch-break]) .character img{transform:rotate(var(--heading,0rad))}

/* Quiet palettes: registration pencil, technical lines, steel/brass, and soft tabletop. */
[data-theme=paper] .inspection-bay{border-color:#687c5b;box-shadow:inset 0 0 0 3px #f6f5e8,inset 0 0 0 4px #a9b595;background:#f6f5e8}
[data-theme=paper] .drafting-area{background-color:#eeefe3;background-image:repeating-linear-gradient(0deg,transparent 0 25px,#a8b49818 25px 26px);border-top:2px solid #bdc7ae}
[data-theme=paper] .rack-tool{background:#fbfaee;border-color:#b8c4aa}
[data-theme=paper] .rack-tool.active{box-shadow:inset 0 -3px #6d8964}
[data-theme=paper] #loadTable thead th{border-bottom:2px solid #aabb9a}
[data-theme=paper] .map-node-dot{box-shadow:0 2px 0 #a9b595}

[data-theme=blueprint] .inspection-bay{border:1px solid #8fc4e6;border-radius:0;background:linear-gradient(#93d9ff33 1px,transparent 1px),linear-gradient(90deg,#93d9ff33 1px,transparent 1px),#153a5c;background-size:26px 26px;box-shadow:inset 0 0 0 5px #153a5c,inset 0 0 0 6px #8fc4e6}
[data-theme=blueprint] .drafting-area{background-color:#12304d;background-image:linear-gradient(#42749c2a 1px,transparent 1px),linear-gradient(90deg,#42749c2a 1px,transparent 1px);background-size:26px 26px;border-top:2px solid #8fc4e6}
[data-theme=blueprint] .rack-tool{border:1px solid #79b6df;background:#153957;border-radius:2px}
[data-theme=blueprint] .attached-tools{border:1px solid #d2efff;background:#123553;color:#e5f3ff}
[data-theme=blueprint] #loadTable th{border-color:#648eac;background:#153957}
[data-theme=blueprint] .tool-sprite:not([data-toy]){border-radius:2px;border-width:1px;box-shadow:0 0 0 2px #153d64}
[data-theme=blueprint] .map-node-dot{box-shadow:0 0 0 2px #102e4d,0 0 0 3px #79b6df}

[data-theme=night] .inspection-bay{border:2px solid #c49b63;border-radius:5px;background:radial-gradient(circle at 8px 8px,#aeb1a0 1.5px,transparent 2px),radial-gradient(circle at calc(100% - 8px) 8px,#aeb1a0 1.5px,transparent 2px),radial-gradient(circle at 8px calc(100% - 8px),#aeb1a0 1.5px,transparent 2px),radial-gradient(circle at calc(100% - 8px) calc(100% - 8px),#aeb1a0 1.5px,transparent 2px),#292e2e;box-shadow:inset 0 0 0 4px #1c2021,0 3px 0 #111517}
[data-theme=night] .drafting-area{background:#282d2d;border-top:3px solid #bd996a}
[data-theme=night] .rack-tool{border:1px solid #72796e;background:linear-gradient(#3d4341,#2d3332);box-shadow:0 2px 0 #111517}
[data-theme=night] .rack-tool.active{background:#4a4030;border-color:#efb66c}
[data-theme=night] .attached-tools{border:1px solid #c8aa79;background:#363a35;color:#f4cf91}
[data-theme=night] #loadTable th{background:#383e3c;border-color:#6b7163}
[data-theme=night] .tool-sprite:not([data-toy]){background:#343a36;border-color:#d1ac72;box-shadow:0 3px 0 #111517}
[data-theme=night] .map-node-dot{box-shadow:0 3px 0 #0c1112}

[data-theme=club] .inspection-bay{border:3px solid #a58acb;border-radius:20px;background:#f6d7ec;box-shadow:inset 0 0 0 5px #f4eaf8,0 4px 0 #bba4cf}
[data-theme=club] .drafting-area{background:linear-gradient(115deg,#ffe3df,#eddef8 60%,#def0e4);border-top:3px solid #c3aad8}
[data-theme=club] .rack-tool{background:#fff0f3;border:2px solid #d9b4d9;border-radius:13px;box-shadow:0 3px 0 #c7aed7}
[data-theme=club] .rack-tool.active{background:#e2d3f4;border-color:#6f4cc3}
[data-theme=club] .attached-tools{background:#e5d6f2;border:1px solid #9b78c1;color:#4c307e;border-radius:8px}
[data-theme=club] #loadTable th{background:#e7dbef;border-color:#c1acd2}
[data-theme=club] .tool-sprite:not([data-toy]){border:2px solid #a384c6;border-radius:12px;box-shadow:0 3px 0 #bca2d2}
[data-theme=club] .map-node-dot{box-shadow:0 4px 0 #c3aad8}
[data-theme=club] .tile:nth-child(4n+1){background:#ffe5ef}
[data-theme=club] .tile:nth-child(4n+2){background:#eee2fb}
[data-theme=club] .tile:nth-child(4n+3){background:#ffeadb}
[data-theme=club] .tile:nth-child(4n){background:#e1f1e6}
[data-theme=club] .tile.selected{border-color:#85539e;box-shadow:0 0 0 3px #bb8fca55,0 5px 0 #cbb4d3}

/* Overhead: a working loading dock, concrete desk, timber, and metal housings. */
[data-theme=overhead] .inspection-bay{border:5px solid transparent;border-image:repeating-linear-gradient(45deg,#dcb846 0 9px,#495044 9px 18px) 5;background:linear-gradient(#89978033,#89978033),url('assets/concrete.svg');background-size:100%,208px;border-radius:0;box-shadow:inset 0 0 0 3px #ece5cd,0 3px 0 #858870}
[data-theme=overhead] .drafting-area{background-color:#d9d7c8;background-image:url('assets/concrete.svg');background-size:416px;border-top:4px solid #d3af47;box-shadow:inset 0 2px #f5edce}
[data-theme=overhead] .rack-tool{border:1px solid #7b806e;background:linear-gradient(#f4eacb 0 12%,#dadac7 12% 88%,#b4b9a2 88%);border-radius:4px;box-shadow:0 2px 0 #8b8f78}
[data-theme=overhead] .rack-tool.active{background:linear-gradient(#ebc95d 0 12%,#f0dfaa 12% 88%,#b9a260 88%)}
[data-theme=overhead] .tool-sprite:not([data-toy]){border-radius:4px;border-color:#717b68;background:#dce0cf;box-shadow:0 3px 0 #858b74}
[data-theme=overhead] .attached-tools{border:1px solid #7b806e;background:#e5d196;color:#414a36}
[data-theme=overhead] #loadTable th{border-color:#9ba58a;background:#cbd4bc;box-shadow:inset 0 2px #f2eedb}
[data-theme=overhead] .map-node-dot{box-shadow:0 3px 0 #929b83}
[data-theme=overhead] .map-node-dot{background-image:url('assets/pallet.svg');background-size:100% 100%}
[data-theme=overhead] :is(.home-mode,.continue-card,.home-extra){border-color:#a4aa95;box-shadow:inset 0 3px #ddd4ae}

/* WIP Cart: asphalt circuit, painted curbs, racing number plates, and a pit desk. */
[data-theme=wip-cart] .stage,[data-theme=wip-cart] .theme-mini{background-color:var(--bench);background-image:url('assets/pack-racing-floor.svg');background-size:416px 416px}
[data-theme=wip-cart] .tile,[data-theme=wip-cart] .draft-notes,[data-theme=wip-cart] .mini-piece:not(.empty):not(.second){background-color:#f5edd7;background-image:url('assets/pack-racing-tile.svg');background-size:100% 100%;border:1px solid #8c4a41;box-shadow:0 3px 0 #5b3633,0 5px 8px #17282b38}
[data-theme=wip-cart] .tile:nth-child(3n+2){background-image:linear-gradient(#80ada124,#80ada124),url('assets/pack-racing-tile.svg')}
[data-theme=wip-cart] .tile:nth-child(3n){background-image:linear-gradient(#e8c04a18,#e8c04a18),url('assets/pack-racing-tile.svg')}
[data-theme=wip-cart] .tile.selected{border:2px solid #e8b650;box-shadow:0 0 0 3px #f9d27666,0 3px 0 #5b3633}
[data-theme=wip-cart] .tile-number{color:#263d44;font-style:italic}
[data-theme=wip-cart] .board{border:0;outline:3px solid #f5df9a;box-shadow:0 0 0 7px #c05045}
[data-theme=wip-cart] .board-label,[data-theme=wip-cart] .stage-label{color:#f2ead4}
[data-theme=wip-cart] .inspection-bay{background:#657c7a;border:4px solid #f3dfab;border-radius:5px;box-shadow:inset 0 0 0 4px #b9493f,0 3px 0 #253d43;color:#fff1ce}
[data-theme=wip-cart] .drafting-area{background-color:#e7e7d3;background-image:repeating-linear-gradient(90deg,#c55447 0 20px,#fff2d8 20px 40px);background-size:100% 8px;background-repeat:no-repeat;border-top:3px solid #324b51}
[data-theme=wip-cart] .draft-caption>strong{background:#fff6dd;padding:2px 5px;border-left:3px solid #b53c34;border-radius:2px}
[data-theme=wip-cart] .rack-tool{background:#f0e8d3;border:1px solid #70888a;box-shadow:0 3px 0 #8fa4a0;border-radius:5px}
[data-theme=wip-cart] .rack-tool.active{background:#f6d2b9;border-color:#b53c34}
[data-theme=wip-cart] .attached-tools{background:#e5c35e;color:#263d44;border:1px solid #9b8037}
[data-theme=wip-cart] .tool-sprite:not([data-toy]){background:#dae3d7;border-radius:5px;border-color:#436267;box-shadow:0 3px 0 #708a88}
[data-theme=wip-cart] #loadTable th{background:#d0e0dc;border-color:#93ada8;box-shadow:inset 0 3px #f0c56e}
[data-theme=wip-cart] .map-node-dot{box-shadow:0 3px 0 #7e5045;background-image:url('assets/pack-racing-tile.svg');background-size:100% 100%}
[data-theme=wip-cart] :is(.home-mode,.continue-card,.home-extra){border-color:#99aaa2;box-shadow:inset 0 4px #bf5647}
[data-theme=wip-cart] .home-paper span{background-image:url('assets/pack-racing-tile.svg');background-size:100% 100%}

/* Lunch Break: edible pieces, picnic napkin, red enamel tray, and a sandwich helper. */
[data-theme=lunch-break] .stage,[data-theme=lunch-break] .theme-mini{background-color:var(--bench);background-image:url('assets/pack-picnic-floor.svg');background-size:416px 416px}
[data-theme=lunch-break] .tile,[data-theme=lunch-break] .draft-notes,[data-theme=lunch-break] .mini-piece:not(.empty):not(.second){background-color:#fff0c5;background-image:url('assets/pack-sandwich-tile.svg');background-size:100% 100%;border:1px solid #ba8244;box-shadow:0 3px 0 #ad7c40,0 5px 8px #9b694f25}
[data-theme=lunch-break] .tile:nth-child(3n+2),[data-theme=lunch-break] .mini-piece:nth-child(3n+2){background-image:url('assets/pack-waffle-tile.svg')}
[data-theme=lunch-break] .tile:nth-child(3n),[data-theme=lunch-break] .mini-piece:nth-child(3n){background-image:url('assets/pack-cookie-tile.svg')}
[data-theme=lunch-break] .tile.selected{border:2px solid #a74736;box-shadow:0 0 0 3px #a7473638,0 3px 0 #ad7c40}
[data-theme=lunch-break] .tile-number{color:#68472e}
[data-theme=lunch-break] .board{border:0;outline:3px solid #7e9259;box-shadow:0 0 0 6px #fff2d1}
[data-theme=lunch-break] .inspection-bay{background:#f4d8a1;border:4px solid #b74e3e;border-radius:20px;box-shadow:inset 0 0 0 4px #fff5d9,0 3px 0 #bb8570}
[data-theme=lunch-break] .drafting-area{background-color:#b84f41;background-image:linear-gradient(#fff6d9e8,#fff6d9e8),url('assets/pack-picnic-floor.svg');background-size:100%,208px;border-top:7px solid #d78169;box-shadow:inset 0 3px #fff4d2}
[data-theme=lunch-break] .draft-caption>strong{background:#fff1bf;padding:3px 7px;border-radius:3px;box-shadow:1px 2px 0 #b5915266}
[data-theme=lunch-break] .draft-center,[data-theme=wip-cart] .draft-center{background:transparent}
[data-theme=lunch-break] .rack-tool{background:#fff1c9;border:2px solid #cb9a62;border-radius:12px;box-shadow:0 3px 0 #caac76}
[data-theme=lunch-break] .rack-tool.active{background:#dbe5b8;border-color:#657f47}
[data-theme=lunch-break] .attached-tools{background:#f3d795;color:#62442f;border:1px solid #bd914e;border-radius:6px}
[data-theme=lunch-break] .tool-sprite:not([data-toy]){background:#e2e7ba;border:2px solid #7e9456;border-radius:11px;box-shadow:0 3px 0 #abb779}
[data-theme=lunch-break] #loadTable th{background:#dbe5b5;border-color:#a9ba7c;box-shadow:inset 0 3px #f3dba0}
[data-theme=lunch-break] .map-node-dot{box-shadow:0 3px 0 #b59055;background-image:url('assets/pack-sandwich-tile.svg');background-size:100% 100%}
[data-theme=lunch-break] :is(.home-mode,.continue-card,.home-extra){border-color:#cdb188;box-shadow:inset 0 4px #b74e3e}
[data-theme=lunch-break] .home-paper span{background-image:url('assets/pack-waffle-tile.svg');background-size:100% 100%}

/* Every physical toy keeps the same silhouette and interaction bounds across packs. */
[data-theme=overhead] .tool-sprite[data-toy=ramps]{background:repeating-linear-gradient(90deg,#dad8ba 0 8px,#53674e 8px 10px);border-color:#657458}
[data-theme=lunch-break] .tool-sprite[data-toy=ramps]{background:repeating-linear-gradient(90deg,#f7d990 0 8px,#bc8b47 8px 10px);border-color:#97703b}
[data-theme=wip-cart] .tool-sprite[data-toy=ramps]{background:repeating-linear-gradient(90deg,#dfd2a9 0 8px,#c14e41 8px 10px);border-color:#324c53}
[data-theme=overhead] .tool-sprite[data-toy=portals]{border-color:#536f54;background:#e7dbb4;box-shadow:0 0 0 3px #f4edce}
[data-theme=lunch-break] .tool-sprite[data-toy=portals]{border-color:#a74736;background:#f4db9a;box-shadow:0 0 0 3px #fff4ca}
[data-theme=wip-cart] .tool-sprite[data-toy=portals]{border-color:#b53c34;background:#d4e0d9;box-shadow:0 0 0 3px #efdca6}
.map-complete .map-node-dot{background-image:none}
.map-available .map-node-dot{box-shadow:0 0 0 5px var(--select-halo),0 3px 0 var(--tile-edge)}
@media(prefers-reduced-motion:reduce){.character img,.rack-tool,.tile,.drafting-area{animation:none!important;transition:none!important}}
