/* The tray keeps its labels above the loose buttons, even when it is full. */
[data-exercise-id="button-box"] .start-copy h1 { font-family:Newsreader,Georgia,serif; font-weight:500; }
.exercise-page [data-exercise-id="button-box"] .play-scene {justify-content:center;gap:clamp(12px,3vh,30px)}
.exercise-page [data-exercise-id="button-box"] .button-field {flex:0 1 auto;width:100%;max-width:780px;align-self:center}
.sewing-scene {display:grid;justify-items:center;gap:clamp(16px,4vh,40px);width:100%;--piece:clamp(80px,10vw,115px)}
.supply {display:flex;align-items:center;justify-content:center;gap:24px;position:relative;min-height:var(--piece);width:100%}
.working-piece {display:grid;place-items:center;width:var(--piece);height:var(--piece);position:relative;flex:none;cursor:grab;touch-action:none;z-index:2}
.working-piece.in-hand {pointer-events:none;cursor:grabbing}
.working-piece img,.stock img,.pocket img {width:100%;height:100%;object-fit:contain;pointer-events:none}
.working-piece img {filter:drop-shadow(0 4px 2px color-mix(in srgb,var(--text) 17%,transparent))}
.stock {display:flex;align-items:center;gap:3px;padding:7px 10px;border-inline-start:1px solid var(--hair)}
.stock>span {width:clamp(26px,4vw,46px);aspect-ratio:1;display:block;transform:rotate(-6deg)}
.stock>span:nth-child(even){transform:rotate(8deg)}
.comparison {order:-1;color:var(--link);display:flex;align-items:center}
.comparison::after {content:'=';font-size:1.5rem;margin:0 4px 0 12px}
.sort-tray {position:relative;width:100%;display:grid;grid-template-columns:repeat(var(--compartments),minmax(0,1fr));gap:7px;padding:9px 9px 13px;background:var(--home-sand);border-radius:12px;box-shadow:inset 0 -4px 0 color-mix(in srgb,var(--home-ink) 24%,transparent),0 7px 12px -7px var(--hair)}
.compartment {appearance:none;display:flex;flex-direction:column;align-items:center;gap:14px;position:relative;color:var(--text);border:0;border-radius:4px;min-width:0;min-height:160px;padding:17px 6px 10px;background-color:var(--panel-right);background-image:url('../assets/images/linen.webp');box-shadow:inset 0 3px 5px color-mix(in srgb,var(--home-ink) 18%,transparent);cursor:pointer}
.compartment:focus-visible {outline:3px solid var(--link);outline-offset:2px;z-index:1}
.compartment[aria-disabled=true]{cursor:default}
.fabric-label {min-height:55px;display:flex;align-items:center;justify-content:center;gap:12px;padding:7px 16px;color:var(--text);background:var(--practice-surface,var(--bg));outline:1px dashed var(--practice-edge);outline-offset:-4px;border-radius:2px;font-size:1.05rem;font-weight:500}
.bin-sign {display:inline-block;width:35px;height:35px;flex:none}
.bin-sign.color {width:41px;height:29px;background:transparent url('../assets/images/swatch-blue.webp') center/contain no-repeat}
.bin-sign.gold {background-image:url('../assets/images/swatch-gold.webp')}
.bin-sign.shape {background:currentColor}
.bin-sign.circle {border-radius:100%}
.bin-sign.square {border-radius:3px}
.bin-sign.triangle {clip-path:polygon(50% 0,100% 97%,0 97%)}
.pocket {display:flex;flex-wrap:wrap;align-content:center;align-items:center;justify-content:center;min-height:60px;flex:1;width:100%;gap:1px}
.pocket>span {width:clamp(28px,4.6vw,56px);aspect-ratio:1;display:block}
.pocket:empty::after {content:'';width:clamp(32px,5vw,56px);height:clamp(32px,5vw,56px);border:2px dashed var(--practice-edge);border-radius:50%;opacity:.65}
.result-mark {position:absolute;right:5px;bottom:5px;color:var(--link)}
.compartment.sorted .result-mark .ui-symbol {width:25px;height:25px}
.compare-bin .fabric-label{outline:2px dashed var(--text);outline-offset:-4px}
.check-cue {display:grid;place-items:center;width:66px;height:66px;border:2px dashed var(--practice-edge);border-radius:18px;color:var(--link)}
[data-nowords=true] .fabric-label .child-word {display:none}
[data-theme=dim] .sort-tray {background:var(--home-dim-sand)}
@media (max-width:660px){.sewing-scene{--piece:82px}.sort-tray{gap:4px;padding:6px 6px 10px}.compartment{min-height:150px;padding:12px 3px 6px;gap:7px}.fabric-label{flex-direction:column;gap:3px;min-width:78%;padding:7px 5px;font-size:.9rem}.bin-sign{width:29px;height:29px}.supply{gap:10px}.stock{padding:5px}.comparison::after{margin:0 0 0 7px}.pocket>span{width:29px}}
@media(orientation:landscape) and (max-height:520px){.sewing-scene{--piece:66px;grid-template-columns:minmax(140px,.6fr) minmax(0,1.4fr);align-items:center;gap:12px}.supply{flex-wrap:wrap;gap:5px}.stock{flex-basis:100%;justify-content:center;border:0;padding:0}.stock>span{width:22px}.fabric-label{min-height:40px;flex-direction:row}.compartment{min-height:104px;padding:7px 3px 4px;gap:4px}.pocket{min-height:36px}.exercise-page [data-exercise-id="button-box"] .play-scene{gap:5px;padding:4px 0}.pocket>span{width:29px}.sort-tray{padding:5px 5px 9px}.bin-sign{width:24px;height:24px}.bin-sign.color{width:31px;height:22px}.sewing-scene .comparison::after{font-size:1rem}}
@media(max-height:520px) and (orientation:landscape){.exercise-page .child-ui.intro-shell .exercise-start {grid-template-columns:minmax(120px,.6fr) minmax(320px,1fr);width:100%;gap:10px}.child-ui.intro-shell .exercise-start .start-mark img{max-width:100%;min-width:0;width:100%;max-height:45dvh}.exercise-page .child-ui.intro-shell .start-copy{gap:2px}.exercise-page .child-ui.intro-shell .start-copy h1{font-size:1.85rem}.exercise-page .child-ui.intro-shell .intro-hint{display:none}.exercise-page .child-ui.intro-shell .level-choice .pill{min-height:56px;padding:3px}.exercise-page .child-ui.intro-shell .level-leaves{height:19px}.exercise-page .child-ui.intro-shell .level-preview{display:none}.exercise-page .child-ui.intro-shell .child-action{min-height:54px}}

/* Keep the drawer full-sized as its contents and labels change. */
.exercise-page .play-shell[data-exercise-id="button-box"] .play-scene{grid-template-columns:minmax(0,1fr);justify-content:stretch}
.exercise-page .play-shell[data-exercise-id="button-box"] .button-field{justify-self:center;width:min(94%,660px)}
.pocket:empty::after{width:45%;height:0;border:0;border-bottom:2px dashed var(--practice-edge);border-radius:0}
@media(max-width:660px){.exercise-page .play-shell[data-exercise-id="button-box"] .button-field{width:100%}}
