/* Keep the account additions usable alongside the existing site controls. */
/* First-visit guidance is independent of drafts, geometry and saved finishes. */
.builder-help-button{font:inherit!important;min-height:44px!important;padding:8px 13px!important;border:1px solid var(--line)!important;border-radius:8px!important;background:var(--panel)!important;color:var(--text)!important;white-space:nowrap;cursor:pointer}.builder-help-dialog{box-sizing:border-box;width:min(740px,calc(100% - 24px));max-width:none;max-height:calc(100dvh - 24px);overflow:auto;padding:28px;border:1px solid var(--line);border-radius:16px;background:var(--bg);color:var(--text);font:inherit;line-height:1.6;box-shadow:0 20px 80px #0008}.builder-help-dialog *{box-sizing:border-box}.builder-help-dialog::backdrop{background:#080c0cc7;backdrop-filter:blur(4px)}.builder-help-top{display:flex;justify-content:space-between;align-items:center;gap:16px;position:sticky;top:-28px;padding:10px 0;background:var(--bg);z-index:2}.builder-help-top>span{font-size:.72rem;text-transform:uppercase;letter-spacing:.09em;color:var(--muted)}.builder-help-dialog h2{font-size:clamp(1.6rem,4vw,2rem);line-height:1.2;margin:22px 0 14px;letter-spacing:-.03em}.builder-help-dialog p{font-size:.95rem;margin:12px 0 20px}.builder-help-dialog button{font:inherit;min-height:44px;padding:10px 15px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--text);cursor:pointer}.builder-help-actions{display:flex;gap:12px;flex-wrap:wrap;margin:24px 0}.builder-help-dialog .help-primary{background:var(--text);color:var(--bg);font-weight:650}.builder-help-dialog .help-small{font-size:.8rem;color:var(--muted)}.builder-help-dialog .help-text-link{background:transparent;text-decoration:underline;border:0;padding-inline:0}.builder-help-topics details{border-top:1px solid var(--line);padding:14px 0}.builder-help-topics summary{cursor:pointer;min-height:44px;align-content:center;font-weight:650;font-size:1rem}.builder-help-topics h3{font-size:1rem;margin:12px 0 0}.builder-tour-target{outline:3px solid var(--accent)!important;outline-offset:5px;scroll-margin:24px}.builder-tour{box-sizing:border-box;position:fixed;z-index:2500;padding:20px;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:14px;box-shadow:0 14px 60px #0006;max-height:calc(100dvh - 24px);overflow:auto;font-family:inherit;font-size:14px;line-height:1.5}.builder-tour[hidden]{display:none}.builder-tour-top{display:flex;justify-content:space-between;align-items:center;gap:12px}.builder-tour-top>span{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted)}.builder-tour button{font:inherit;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:var(--surface);color:var(--text);cursor:pointer}.builder-tour-top button{width:44px;font-size:22px;line-height:1}.builder-tour h2{font-size:21px;line-height:1.2;margin:12px 0}.builder-tour p{font-size:14px;line-height:1.6;margin:0 0 18px}.builder-tour-actions{display:flex;gap:8px}.builder-tour-actions button{flex:1;font-size:12px;padding-inline:8px;white-space:nowrap}.builder-tour-actions .tour-next{background:var(--text);color:var(--bg);font-weight:650}.builder-tour button:disabled{opacity:.45;cursor:default}.builder-tour :is(button,a):focus-visible,.builder-help-dialog :is(button,summary):focus-visible{outline:3px solid var(--accent);outline-offset:3px}.compartment-overview{display:grid;grid-template-columns:.85fr 1.15fr;gap:48px;align-items:center}.compartment-overview h2{font-size:clamp(30px,4vw,46px);line-height:1.12;margin:14px 0 22px}.compartment-overview .motion-figure{margin:0 0 12px}.compact-hero .hero-copy>.hero-smart-note{font-size:15px!important;line-height:1.65;color:var(--muted);margin-top:16px!important}.compact-hero .hero-note{max-width:440px;line-height:1.6}
@media(max-width:800px){.compartment-overview{grid-template-columns:1fr;gap:24px}.builder-help-dialog{padding:20px}.builder-help-top{top:-20px}.builder-help-actions>*{flex:1}.builder-tour{padding:16px}}
/* On phones/tablets, advertise themes on the trigger without covering copy. */
@media(max-width:1000px){.site-header .theme-control .theme-hint{display:none}.site-header .theme-control:has(.theme-hint) .theme-trigger::after{content:'6';display:inline-grid;place-items:center;min-width:18px;height:18px;border:1px solid currentColor;border-radius:50%;font-size:10px;line-height:1}}
.motion-figure figcaption a{text-decoration:underline;text-underline-offset:3px}.motion-figure figcaption{flex-wrap:wrap}
.layer-view,.layer-view .layer-pictures,.layer-view .layer-caption{background:#171b1e;color:#f5f3ec}
.layer-view .layer-caption{border-top:1px solid #53605b}
.layer-view .reset-layers{background:#29312d;color:#f5f3ec;border-color:#6c7b72}
.site-header nav a,.site-header .header-actions{white-space:nowrap}
@media(min-width:801px) and (max-width:1350px){
 .site-header nav{display:none;position:absolute;top:87px;left:0;right:0;margin:0;padding:20px;background:var(--bg);border-bottom:1px solid var(--line);gap:8px;box-shadow:0 12px 20px #0001}
 .site-header nav.open{display:flex;flex-direction:column}
 .site-header nav a{padding:13px 8px;font-size:16px;min-height:48px}
 .site-header .menu-toggle{display:grid}
}
@media(max-width:360px){
 .site-header{height:auto;min-height:76px;display:grid;grid-template-columns:24px minmax(0,1fr) auto auto;padding-block:10px;gap:8px}
 .site-header .brand{grid-row:1;grid-column:1}
 .site-header .header-actions{display:contents}
 .site-header #accountLink{grid-row:1;grid-column:2 / 4}
 .site-header #menuToggle{grid-row:1;grid-column:4;justify-self:end}
 .site-header .theme-control{grid-row:2;grid-column:1 / 4}
 .site-header .header-actions>.button{grid-row:2;grid-column:4}
 .site-header nav{top:100%}
}
#accountSaveDialog{width:min(480px,calc(100% - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:24px;border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--text)}
#accountSaveDialog::backdrop{background:#000a}
#accountSaveDialog h2{font-size:26px;line-height:1.2;margin:0 0 14px}
#accountSaveDialog p{margin:12px 0}
#accountSaveDialog label{display:block;margin:18px 0 6px}
#accountSaveDialog input{width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:7px;background:var(--surface);color:inherit;font:inherit}
#accountSaveDialog .dialog-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
#accountSaveDialog button{min-height:44px;padding:10px 14px;border:1px solid var(--line);border-radius:7px;background:var(--surface);color:inherit;font:inherit}
#accountSaveDialog button.primary{background:var(--accent);color:var(--inverse)}
#accountSaveDialog input:focus-visible,#accountSaveDialog button:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
#accountSaveDialog form>button{margin-top:16px}

/* One compact entry point advertises every theme without crowding the header. */
.theme-control{position:relative;flex:none;line-height:1.4;white-space:normal}
.theme-control [hidden]{display:none!important}
.theme-control button{font:inherit;cursor:pointer;color:inherit;min-height:44px;border:1px solid var(--line);background:var(--surface);border-radius:8px}
.theme-control .theme-trigger{display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:9px 11px;font-size:13px;white-space:nowrap;background:var(--panel);color:var(--text)}
.theme-symbol{font-size:20px;line-height:1}
.theme-control .theme-panel,.theme-control .theme-hint{position:fixed;z-index:2000;box-sizing:border-box;padding:20px;border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--text);box-shadow:0 14px 40px #0003;text-align:left;max-height:calc(100dvh - 24px);overflow:auto;font-size:14px;line-height:1.5;white-space:normal}
.theme-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.theme-panel-heading strong,.theme-hint>strong{font-size:20px;letter-spacing:-.4px;display:block}
.theme-panel p,.theme-hint p{font-size:14px;color:var(--muted);margin:8px 0 16px;line-height:1.5}
.theme-control .theme-close{display:grid;place-items:center;padding:0;width:44px;flex:none;font-size:25px;background:transparent}
.theme-hint>.theme-close{float:right;margin:-10px -10px 0 6px}
.theme-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.theme-control .theme-choices button{display:flex;align-items:center;gap:8px;padding:10px;font-size:14px;text-align:left;background:var(--panel);color:var(--text)}
.theme-control .theme-choices button[aria-pressed=true]{border:2px solid var(--text);padding:9px;background:var(--surface)}
.theme-check{margin-left:auto;visibility:hidden;font-size:16px}
[aria-pressed=true]>.theme-check{visibility:visible}
.theme-swatch{display:block;width:22px;height:22px;border-radius:50%;flex:none;border:1px solid #8888}
.theme-swatch-light{background:linear-gradient(90deg,#eeeae2 50%,#a7aaa4 50%)}
.theme-swatch-dark{background:linear-gradient(90deg,#202020 50%,#939b92 50%)}
.theme-swatch-pink{background:linear-gradient(90deg,#f0b8cf 50%,#eeeae5 50%)}
.theme-swatch-violet{background:linear-gradient(90deg,#c5b6e8 50%,#eeeae5 50%)}
.theme-swatch-ocean{background:linear-gradient(90deg,#9bc7de 50%,#eeeae5 50%)}
.theme-swatch-forest{background:linear-gradient(90deg,#aec5a0 50%,#eeeae5 50%)}
.theme-panel .theme-accent{margin-top:16px;border-top:1px solid var(--line);padding-top:12px}
.theme-panel .theme-accent summary{display:block;font-size:13px;padding:10px;min-height:44px}
.theme-panel .theme-accent>div{position:static;width:auto;padding:12px 0 0;box-shadow:none;border:0;background:transparent}
.theme-panel .theme-accent input{height:44px}
.theme-control .theme-explore{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;padding:10px 14px;font-weight:600;background:var(--text);color:var(--bg);border-color:var(--text)}
.theme-control button:focus-visible,.theme-control summary:focus-visible,.theme-control input:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
@media(max-width:500px){.theme-control .theme-trigger{padding:9px 8px;gap:5px}.theme-symbol{font-size:18px}}
/* A single compact toolbar, with the canvas using the removed footer space. */
body:has(.workspace) main{height:calc(100dvh - var(--builder-header-height,72px));min-height:0}
.workspace .workspace-toolbar{padding:8px 12px;gap:8px;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;min-width:0;max-width:100%;z-index:4}
.workspace .workspace-toolbar .stage-heading{display:block;position:static;padding:0;margin:0 8px 0 0;flex:0 0 auto;pointer-events:auto;order:0}
.workspace .workspace-toolbar .stage-heading :is(.eyebrow,p){display:none}
.workspace .workspace-toolbar .stage-heading h1{margin:0;font-size:19px;white-space:nowrap;max-width:none}
.workspace .workspace-toolbar :is(.environment-control,.editor-tools,.history,.builder-help-controls){display:flex;align-items:center;flex-wrap:nowrap;gap:4px;position:static;inset:auto;flex:0 0 auto;width:auto;min-width:0;max-width:none;margin:0;padding:0;border:0;background:none;order:0}
.workspace .workspace-toolbar .editor-tools{flex-basis:auto}
.workspace .workspace-toolbar .environment-control{gap:6px;font-size:11px}
.workspace .workspace-toolbar .environment-control select{max-width:130px;min-height:40px;padding:4px;font-size:12px}
.workspace .workspace-toolbar button{min-height:40px;padding:6px 8px;font-size:12px;white-space:nowrap;flex:0 0 auto}
.workspace .workspace-toolbar .history button{width:36px;min-width:36px;padding:6px}
.workspace .workspace-toolbar .builder-help-controls{margin-left:auto}
.builder-tour-shade{display:none;position:fixed;inset:0;width:100vw;height:100dvh;z-index:2490;pointer-events:none;fill:rgba(12,13,15,.76)}
body.builder-tour-active .builder-tour-shade{display:block}
.builder-tour-active .builder-tour-target{outline-offset:2px;scroll-margin-top:16px;scroll-margin-bottom:310px}
.builder-tour{position:fixed!important;margin:0!important;z-index:2500}
.builder-tour h2:focus{outline:none}
@media(max-width:720px){body:has(.workspace){overflow:auto}body:has(.workspace) main{height:auto;min-height:0}.workspace{height:60dvh;min-height:360px;max-height:560px}.workspace .workspace-toolbar{gap:6px;padding:6px 8px}.workspace .workspace-toolbar .stage-heading h1{font-size:16px}.workspace .workspace-toolbar button{min-height:44px}.workspace .workspace-toolbar .environment-control select{min-height:44px}.builder-tour{padding:12px}.builder-tour h2{font-size:18px;margin:8px 0}.builder-tour p{font-size:13px;line-height:1.45;margin-bottom:12px}.builder-tour-actions button{min-height:44px}.builder-tour-target{scroll-margin-top:16px}}
body.builder-tour-active #toast{opacity:0!important;pointer-events:none!important}
.module-picker{display:grid;gap:6px;margin:10px 0;font-size:12px}.module-picker select{width:100%;min-width:0;max-width:100%;min-height:40px;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:6px;padding:6px}
@media(max-width:800px){html:has(body.builder-tour-active){scroll-padding-bottom:46dvh}.builder-tour-active .panel-scroll{padding-bottom:46dvh;scroll-padding-bottom:46dvh}.builder-tour-active :is(button,input,select,summary){scroll-margin-bottom:46dvh}}
@media(max-width:800px){.workspace .workspace-toolbar .stage-heading{order:-3}.workspace .workspace-toolbar .builder-help-controls{order:-2;margin-left:0}}
/* Temporary tutorial state never becomes the user's array. */
.practice-session .selected-actions,.practice-session .position-controls,.practice-session #assembly,.practice-session .builder-footer,.practice-session [data-library=nonframes]{display:none!important}
.builder-tour-top [data-tour-restart]{width:auto;font-size:12px;min-height:36px;padding:6px 10px}
body:has(#heroTrailer) .compact-hero{max-width:none;width:100%;padding:40px clamp(20px,3vw,56px) 56px;grid-template-columns:minmax(280px,.55fr) minmax(0,1.45fr);gap:clamp(24px,3vw,48px)}
.compact-hero .hero-copy{max-width:430px}.compact-hero h1{font-size:clamp(40px,3.6vw,70px)}
body:has(#heroTrailer) .overview-section{max-width:none;padding-inline:clamp(20px,3vw,56px)}
.overview-section>.section-heading>p{max-width:65ch}.trailer-transcript{max-width:74ch}.trailer-transcript [data-mobile-transcript]{display:none}
@media(max-width:1000px){body:has(#heroTrailer) .compact-hero{grid-template-columns:1fr;gap:28px}.compact-hero .hero-copy{max-width:760px}.compact-hero .hero-copy>p:not(.eyebrow):not(.hero-note){max-width:65ch!important}.hero-trailer{max-width:none}}
@media(max-width:600px){body:has(#heroTrailer) .compact-hero{padding:28px 16px 40px}.hero-trailer{width:100%;max-width:none}.hero-trailer video{aspect-ratio:9/16}.trailer-transcript [data-mobile-transcript]{display:block}.trailer-transcript [data-desktop-transcript]{display:none}.compact-hero h1{font-size:clamp(36px,9vw,50px)}body:has(#heroTrailer) .overview-section{padding-inline:16px}}
body.practice-session #toast{visibility:hidden!important;transition:none!important}
/* Theme discovery stays visible without covering the enlarged film. */
.site-header .theme-control .theme-hint{display:none}
.site-header .theme-control:has(.theme-hint) .theme-trigger::after{content:'6';display:inline-grid;place-items:center;min-width:18px;height:18px;border:1px solid currentColor;border-radius:50%;font-size:10px;line-height:1}

/* Separate power and rail prices remain readable on narrow screens. */
.compact-prices{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:800px){.compact-prices{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:420px){.compact-prices{grid-template-columns:1fr}}

/* A real resizable parts pane; all available part cards share one wrapping grid. */
body:has(.workspace) main{--builder-width:380px}
.builder{position:relative;min-width:0;container-type:inline-size}
.builder-top{padding:16px 16px 10px;flex-shrink:0;gap:10px}
.builder-top h2{font-size:20px;margin:0}
.builder-navigation{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px 12px;flex-shrink:0;border-bottom:1px solid var(--line)}
.builder-navigation button{min-height:36px;padding:7px 12px;border:1px solid var(--line);border-radius:7px;background:var(--surface);font:inherit;font-size:12px;color:var(--text);white-space:nowrap}
.builder-navigation .history{display:flex!important;position:static!important;inset:auto!important;margin:0;gap:6px}
.builder-navigation .history button{width:auto;min-width:56px;height:auto;font-size:12px}
.builder-navigation button:disabled{opacity:.4;cursor:default}
.builder .panel-scroll{padding:16px;min-width:0}
.builder .steps{padding-inline:16px}
.builder .selected-info{margin:12px 16px 0}
#builderResize{position:absolute;z-index:25;left:-5px;top:0;bottom:0;width:10px;cursor:col-resize;touch-action:none;outline-offset:-2px}
#builderResize:after{content:'';position:absolute;left:4px;top:0;bottom:0;width:2px;background:var(--line);transition:background .15s}
#builderResize:hover:after,#builderResize:focus-visible:after,body.resizing-builder #builderResize:after{width:3px;background:var(--accent)}
body.resizing-builder{cursor:col-resize;user-select:none}
body.resizing-builder canvas{pointer-events:none}
.builder .parts-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,155px),1fr));gap:10px;align-content:start}
.builder .parts-grid>.part-card,.builder .parts-grid>.attachment-card{margin:0;min-width:0;max-width:100%;height:100%}
.builder .parts-grid>.part-card,.builder .attachment-card>.part-card{display:flex;flex-direction:column;align-items:stretch;text-align:left;padding:10px;gap:8px}
.builder .parts-grid>.part-card img,.builder .attachment-card>.part-card img{width:100%;height:112px;background:var(--bg);object-fit:contain;flex-shrink:0}
.builder .parts-grid>.part-card .part-copy{width:100%;min-width:0}
.builder .parts-grid>.part-card .check,.builder .attachment-card .check{position:absolute;top:8px;right:8px}
.builder .parts-grid>.part-card strong{font-size:13px;line-height:1.35;overflow-wrap:anywhere}
.builder .parts-grid>.part-card small{font-size:11px;line-height:1.45}
.builder .parts-grid>:not(.part-card):not(.attachment-card){grid-column:1/-1;min-width:0}
.builder .attachment-card{padding:0;border:0;background:none}
.builder .attachment-card>.part-card{height:100%;cursor:grab;touch-action:none}
.builder .attachment-card>.part-card:active{cursor:grabbing}
.builder .attachment-group{margin-bottom:20px}
.builder .attachment-group h3{margin:0 0 4px;font-size:14px}
.builder .attachment-card .part-copy small{display:none}
.builder .attachment-card .tag{font-size:11px;color:var(--muted)}
.builder .attachment-card:focus-within{outline:2px solid var(--accent);outline-offset:2px}
.attachment-hint{font-size:12px;line-height:1.5;color:var(--muted);margin:10px 0}
#assembly{display:none!important}
@media(min-width:901px){body:has(.workspace) main{display:grid;grid-template-columns:minmax(0,1fr) var(--builder-width)!important}}
@media(max-width:900px){body:has(.workspace){overflow:auto}body:has(.workspace) main{display:flex;flex-direction:column;height:auto;min-height:0}.workspace{height:58dvh;min-height:320px;max-height:600px;flex-shrink:0}.builder{border-left:0;border-top:1px solid var(--line);min-height:560px;overflow:visible}.builder .panel-scroll{overflow:visible}.builder-navigation{position:sticky;top:0;background:var(--panel);z-index:6;padding-top:8px}#builderResize{display:none}.builder .parts-grid{grid-template-columns:repeat(auto-fill,minmax(min(100%,150px),1fr))}}

.construction-switch{display:flex;gap:4px;margin-top:10px;padding:3px;background:var(--bg);border-radius:7px;max-width:240px}
.construction-switch button{flex:1;min-height:32px;padding:6px 14px;border-radius:5px;font:inherit;font-size:12px;color:var(--muted)}
.construction-switch button[aria-pressed=true]{background:var(--surface);color:var(--text);box-shadow:0 1px 3px #0003}

/* Keep the full tray unit visible while one tray is edited. */
#trayEditor .tray-overview{height:160px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:10px 24px;overflow:hidden}
#trayEditor .tray-overview button{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:96px auto auto;align-content:center;text-align:center;padding:4px 10px;min-width:0;color:var(--text);background:var(--panel);border:1px solid var(--line);border-radius:10px}
#trayEditor .tray-overview button:only-child{grid-column:1/-1;max-width:360px;justify-self:center;width:100%}
#trayEditor .tray-overview button img{width:100%;height:96px;object-fit:contain;min-width:0;pointer-events:none}
#trayEditor .tray-overview button span{font-size:13px;font-weight:600;line-height:1.3}
#trayEditor .tray-overview button small{font-size:11px;margin:3px 0;opacity:1;color:var(--muted)}
#trayEditor .tray-overview button[aria-pressed=true]{background:var(--tint);border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
#trayEditor .tray-overview button:focus-visible{outline:3px solid var(--accent);outline-offset:-3px}
#trayEditor .tray-editor-header{height:76px;padding:14px 24px}
#trayEditor .tray-workbench{padding-top:14px}
#trayEditor .tray-live-stage{min-height:230px;flex-basis:230px}
.holder-example{font-size:11px!important;line-height:1.4;color:var(--muted);font-weight:400}
/* The real front assembly is the thumbnail, with the customer's finishes. */
.bin-front-choices{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr));gap:12px;width:100%}
.builder .bin-front-choices>.part-card{display:flex;flex-direction:column;align-items:stretch;padding:12px;margin:0;position:relative;gap:10px;text-align:left}
.builder .bin-front-choices>.part-card img{width:100%;height:160px;object-fit:contain;background:var(--bg);border-radius:8px}
.builder .bin-front-choices>.part-card strong{font-size:14px;line-height:1.4}
.builder .bin-front-choices>.part-card small{font-size:12px;line-height:1.5}
.builder .bin-front-choices>.part-card .check{position:absolute;top:9px;right:9px}
.hardware-help{font-size:12px;line-height:1.5;color:var(--muted)}
.bom-row.hardware-row{width:100%;text-align:left;font:inherit;color:var(--text);background:transparent;border:0;border-bottom:1px solid var(--line);border-radius:0;cursor:pointer;padding:14px 8px}
.bom-row.hardware-row:hover,.bom-row.hardware-row[aria-pressed=true]{background:var(--tint);box-shadow:inset 3px 0 var(--accent)}
.bom-row.hardware-row:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
@media(max-width:720px){
 #trayEditor .tray-overview{height:132px;padding:8px 12px;gap:6px}
 #trayEditor .tray-overview button{grid-template-rows:74px auto auto;padding:2px 3px}
 #trayEditor .tray-overview button img{height:74px}
 #trayEditor .tray-overview button span{font-size:12px}
 #trayEditor .tray-overview button small{font-size:10px}
 #trayEditor .tray-editor-header{height:70px;padding:12px}
 #trayEditor .tray-live-stage{height:280px;min-height:280px}
}

#trayEditor #trayEditorTabs[hidden]{display:none!important}#trayEditor .tray-live-stage{min-height:380px;flex-basis:380px}@media(max-width:720px){#trayEditor .tray-live-stage{height:440px;min-height:440px}}

/* Three clear media choices; pack size stays secondary. */
.card-media-switch{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-bottom:14px}.card-media-switch button{min-height:44px;font-size:14px;font-weight:600}

/* Library surfaces scroll; only the grip starts a touch drag. */
.builder [data-drag-frame],.builder [data-drag-nonframe]{touch-action:pan-y!important}
.builder .drag-grip{touch-action:none;display:grid;place-items:center;min-width:44px;min-height:44px;border-radius:6px;cursor:grab}

.fps-counter{position:absolute;right:10px;bottom:10px;z-index:5;padding:5px 8px;border:1px solid var(--line);border-radius:5px;background:var(--bg);color:var(--muted);font:11px/1.2 ui-monospace,monospace;font-variant-numeric:tabular-nums;pointer-events:none;opacity:.85}

/* Build Studio: keep choices prominent on short screens. */
.builder-top,.builder-footer{display:none!important}
.builder-navigation{padding:8px 12px;gap:6px;flex-wrap:nowrap}
.builder-navigation .history{margin-left:auto;gap:4px}
.builder-navigation .history button{min-width:44px}
.builder-utilities{display:flex;gap:4px;align-items:center}
.builder-navigation #duplicate{padding-inline:6px;font-size:11px}
.builder-navigation #remove{padding:6px;min-width:36px}
.builder .steps{flex-shrink:0;overflow:visible;padding:8px 12px 0;gap:8px;min-height:66px}
.step-cell{min-width:0;display:flex;align-items:stretch;gap:3px}
.step-cell>button[data-step]{flex:1;min-width:0;padding:3px 0 10px;line-height:1.3}
.step-cell #addFrame{align-self:center;flex-shrink:0;width:32px;height:36px;font-size:20px;margin-bottom:7px}
.builder .panel-scroll{min-height:0;padding:12px;scroll-padding-top:12px;overflow-anchor:none}
.builder .panel-scroll .selected-info{margin:0 0 12px;padding:9px 11px}
.workspace-toolbar>.stage-heading,#stageHeading{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap}
.environment-control>span{display:none!important}
.finish-unit{display:block;width:100%;margin-top:16px;min-height:44px;padding:12px;border-radius:7px}
@media(max-width:900px){.builder .panel-scroll{scroll-margin-top:8px}.builder-navigation{padding-block:7px}.step-cell #addFrame{width:32px}}
.step-cell #addFrame{min-width:32px!important;min-height:36px!important;width:32px!important;height:36px!important;padding:0!important;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:8px}
.workspace .workspace-toolbar .environment-control{font-size:0!important;gap:0}
.step-cell #addFrame span{display:inline-flex!important;align-items:center;justify-content:center}

/* R172/173: compact depth placement and consistent explanatory spacing. */
.depth-position{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.depth-position label{display:flex;flex:1 1 150px;flex-direction:column;gap:6px;font-size:12px}
.depth-position select{width:100%;min-height:36px}.depth-position button{min-height:36px;font-size:11px}
#catalog>.section-description,#catalog>.divider-options,#catalog>.completed-note{margin-top:14px;margin-bottom:14px;line-height:1.55}
#catalog>.bin-front-choices+.section-description{margin-top:16px}
#catalog .part-copy{display:flex;flex-direction:column;gap:6px;padding:0}
#catalog .part-copy small{line-height:1.5}#catalog .section-head{margin-block:14px 10px}
#catalogHeader>.section-description{margin-block:10px 14px;line-height:1.55}

/* Full-panel colour editor, with persistent company/range filtering. */
.builder.colour-editor .builder-utilities{display:none}
.builder.colour-editor #catalogHeader .section-head{font-size:19px;margin-bottom:10px}
.builder.colour-editor #finish{border:0;padding:0;margin-top:18px}
.colour-picker-inline{border:0!important;background:none!important;margin:14px 0}
.colour-picker-inline>#colourPickerToggle{display:flex;align-items:center;gap:10px;padding:10px;background:var(--surface);border:1px solid var(--line);border-radius:8px}
.colour-picker-inline>#colourPickerToggle b{display:none}
.colour-picker-inline>#colourPickerToggle i{width:32px;height:32px;border-radius:50%;flex:none}
.colour-picker-inline>#colourPickerToggle span{display:flex;flex-direction:column;gap:3px}
.colour-picker-inline .colour-menu{padding:12px 0}
.colour-picker-inline .colour-menu-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:7px;max-height:none;overflow:visible;scrollbar-gutter:auto}
.colour-picker-inline .colour-menu-row{border:1px solid var(--line);border-radius:8px;min-height:94px;padding:10px;align-items:flex-start}
.colour-picker-inline .colour-menu-row span{overflow-wrap:anywhere}
.colour-picker-inline .colour-menu-row i{width:23px;height:23px}
.filament-filters{display:grid;gap:10px;margin-bottom:14px;padding-bottom:12px;border-bottom:1px solid var(--line)}
.filament-filters>label{display:flex;flex-direction:column;gap:5px;font-size:12px}
.filament-filters select{min-height:36px;width:100%}
.filament-presets{display:flex;flex-wrap:wrap;gap:6px}.filament-presets button{font-size:12px;min-height:36px}
.filament-filters fieldset{min-width:0;margin:0;padding:8px;border:1px solid var(--line);border-radius:7px}
.filament-filters legend{font-size:12px;padding:0 4px}.filament-range-options{display:flex;flex-wrap:wrap;gap:8px 12px}
.filament-range-options label{display:flex;align-items:center;gap:5px;font-size:12px;min-height:28px}
.filament-filters small{font-size:11px;color:var(--muted)}
.colour-targets button:focus-visible,.colour-targets button:hover{outline:2px solid #6ce8ff;outline-offset:-2px}

.selected-unit-filament{padding:3px 0;font-size:11px;line-height:1.2;color:var(--text);font-weight:600;max-width:230px;white-space:nowrap;}

/* Compact batch controls retain room for the model and colour choices. */
.filament-filters{grid-template-columns:minmax(120px,1fr) minmax(150px,1.25fr) minmax(120px,1fr);align-items:end;gap:8px}
.filament-filters .filament-presets,.filament-filters>small{grid-column:1/-1}
.filament-filters fieldset{padding:5px 8px;min-height:40px}.filament-filters select{min-height:40px}
@container (max-width:480px){.filament-filters{grid-template-columns:1fr}.filament-filters .filament-presets,.filament-filters>small{grid-column:auto}}
.colour-picker-inline{container-type:inline-size}
@media(max-width:720px){.filament-filters{grid-template-columns:1fr}}
.workspace .array-summary{height:56px!important;padding:4px 12px!important;gap:14px;overflow:visible;flex-wrap:nowrap;box-sizing:border-box}
.workspace #stage{bottom:56px!important}.array-summary>div{flex:0 0 auto}.array-summary strong{font-size:14px}.array-summary #selectedUnitFilament{font-size:10px;padding:0;line-height:1.2}
@media(max-width:720px){.workspace .array-summary{height:76px!important;flex-wrap:wrap;gap:3px 12px}.workspace #stage{bottom:76px!important}.array-summary strong{font-size:12px}}

.filament-filters{grid-template-columns:minmax(100px,1fr) minmax(150px,1.2fr) minmax(100px,1fr);grid-template-areas:'presets presets presets' 'company ranges sort' 'note note note'}
.filament-filters .filament-presets{grid-area:presets}.filament-filters>label:has(#colourBrand){grid-area:company}.filament-filters>label:has(#colourSort){grid-area:sort}.filament-filters>fieldset{grid-area:ranges}.filament-filters>small{grid-area:note}
@container(max-width:520px){.filament-filters{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:'presets presets' 'company sort' 'ranges ranges' 'note note'}}
@media(max-width:720px){.filament-filters{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-areas:'presets presets' 'company sort' 'ranges ranges' 'note note';}.filament-filters select{min-height:44px}}

.workspace{container-type:inline-size}
.workspace .array-summary{display:flex!important;flex:0 0 56px!important;min-height:0!important;max-height:none!important;height:56px!important;overflow:hidden!important}
.workspace #stage{bottom:auto!important}
@container(max-width:560px){.workspace .array-summary{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);flex:0 0 auto!important;min-height:76px!important;height:auto!important;gap:3px 10px;padding:6px 10px!important;overflow:visible!important}.array-summary #selectedUnitFilament{white-space:normal;font-size:10px}.array-summary strong{font-size:12px}}
@media(max-width:720px){.workspace .array-summary{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr);flex:0 0 auto!important;min-height:76px!important;height:auto!important;gap:3px 10px;padding:6px 10px!important;overflow:visible!important}.array-summary #selectedUnitFilament{white-space:normal;font-size:10px}}

.bom-filament-row{cursor:pointer;padding:14px 8px}
.bom-filament-row:hover,.bom-filament-row[aria-pressed=true]{background:var(--tint);box-shadow:inset 3px 0 var(--accent)}
.bom-filament-row:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}

.booth-vent-status{padding:12px;margin:14px 0;border:1px solid var(--line);border-radius:8px;background:var(--tint)}
.booth-vent-missing{border-left:4px solid var(--accent)}
.booth-vent-status p{margin:8px 0 0}.booth-vent-option{padding:12px 0;border-top:1px solid var(--line)}
.booth-option-buttons{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}.booth-option-buttons button{min-height:44px;white-space:normal;flex:1 1 160px}.booth-vent-option small{display:block;line-height:1.5}

.inventory-board{position:relative;display:grid;grid-template-columns:repeat(var(--cols),1fr);grid-template-rows:repeat(var(--rows),1fr);aspect-ratio:var(--cols)/var(--rows);width:min(100%,540px);margin:16px auto;background:#14191d;border:2px solid #6b777f;isolation:isolate}
.inventory-square{min-width:0!important;min-height:0!important;padding:0!important;border:1px solid #343e46!important;border-radius:0!important;background:transparent!important}
.inventory-square[aria-pressed=true]{background:#43535e!important;box-shadow:inset 0 0 0 2px #e3e9ed}
.inventory-block{position:absolute;padding:3px!important;border:1px solid #76818b!important;border-radius:3px!important;background:#303941!important;touch-action:none;min-width:0!important;min-height:0!important;overflow:hidden;cursor:grab}
.inventory-block[aria-pressed=true]{outline:2px solid white;outline-offset:-3px;z-index:2}
.inventory-block img{width:100%;height:100%;object-fit:contain;pointer-events:none}.inventory-block span{position:absolute;bottom:2px;right:3px;font-size:10px;background:#161c22dd;color:#fff;border-radius:3px;padding:1px 3px;pointer-events:none}
.inventory-drop-preview{position:absolute;pointer-events:none;background:#94c9ad66;outline:2px solid #bdebd1;outline-offset:-2px;z-index:5}.inventory-drop-preview[hidden]{display:none}.inventory-board.invalid-drop{border-color:#d77b7b}
.inventory-tool{touch-action:none}.inventory-grid-caption{text-align:center;color:#aebbc5;font-size:12px}.inventory-tray-select{display:flex;align-items:center;gap:12px;margin:12px 0}.inventory-tray-select select{flex:1}
@media(max-width:700px){.inventory-board{max-width:400px}.inventory-workspace .inventory-tools{grid-template-columns:repeat(2,minmax(0,1fr))}}

@media(max-width:700px){.inventory-board{width:min(100%,calc(320px * var(--cols) / var(--rows)))}.inventory-workspace .tray-live-help{font-size:12px}}

/* Inventory editor: keep the plan and its controls visible together. */
.inventory-selection-actions{display:flex;gap:8px;flex-wrap:wrap}
.inventory-board{width:min(100%,calc(max(192px,100dvh - 520px) * var(--cols) / var(--rows)));border-radius:8px;overflow:hidden}
.inventory-board:focus-visible{outline:2px solid var(--accent);outline-offset:4px}
.inventory-tools .tool-card{cursor:grab}
.inventory-block:active,.inventory-tools .tool-card:active{cursor:grabbing}
.inventory-feedback{min-height:2.8em;line-height:1.4}
.inventory-workspace .holder-search{position:sticky;top:0;background:var(--surface,#222);z-index:4;padding:8px 0}
@media(max-width:700px){.inventory-board{width:min(100%,calc(320px * var(--cols) / var(--rows)))}.inventory-selection-actions button{min-height:44px}}

.inventory-workspace .tray-choice-header,.inventory-workspace .holder-search{position:static}

.build-research-notice{box-sizing:border-box;position:fixed;z-index:60;left:max(12px,env(safe-area-inset-left));bottom:max(12px,env(safe-area-inset-bottom));width:min(330px,calc(100vw - max(12px,env(safe-area-inset-left)) - max(12px,env(safe-area-inset-right))));padding:12px 14px 8px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--text);box-shadow:0 8px 24px #0003;font-size:13px;line-height:1.45}
.build-research-notice[hidden],.builder-tour-active .build-research-notice,body:has(dialog:modal) .build-research-notice{display:none}
.build-research-notice h2{font-size:15px;line-height:1.2;margin:0 0 5px}
.build-research-notice p{margin:0;color:var(--muted)}
.build-research-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:4px}
.build-research-actions a,.help-privacy-link{color:var(--text);text-decoration:underline;text-underline-offset:3px}
.build-research-actions a{display:inline-flex;align-items:center;min-height:44px}
.build-research-actions button{font:inherit;font-weight:650;min-height:44px;padding:4px 14px;border:1px solid var(--line);border-radius:8px;background:var(--text);color:var(--bg);cursor:pointer}
.build-research-actions :is(a,button):focus-visible,.help-privacy-link:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.help-privacy-link{display:inline-flex;align-items:center;min-height:44px;font-size:.85rem}
.owner-research-status{position:fixed;z-index:70;bottom:16px;left:16px;max-width:calc(100vw - 32px);padding:10px 14px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text);font-size:14px}
.tray-rack-settings select{min-height:36px;max-width:100%;box-sizing:border-box}
.tray-rack-divider{display:grid;gap:5px;margin-top:8px}
.tray-rack-columns{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,233px),1fr));gap:8px}
.tray-rack-column{box-sizing:border-box;min-width:0;margin:0;padding:6px 8px;border:1px solid var(--line);border-radius:8px}
.tray-rack-row{display:grid;grid-template-columns:minmax(44px,1fr) minmax(90px,1.5fr) auto;gap:5px;align-items:center;padding:3px 0;font-size:12px}
.tray-rack-row button{min-height:36px;margin:0}
@media(max-width:440px){.tray-rack-settings select,.tray-rack-row button{min-height:42px}}
.workshop-airflow{margin:12px 0 0;padding:10px;border:1px solid var(--line);border-radius:8px;min-width:0}
.workshop-airflow>div{display:grid;grid-template-columns:repeat(auto-fit,minmax(138px,1fr));gap:8px}
.workshop-airflow label{display:grid;gap:4px;min-width:0}
.workshop-airflow select{width:100%;min-height:44px}
.workshop-airflow small{display:block;margin-top:8px;line-height:1.45}
