.chest-gallery{min-width:0;align-self:start;position:static!important}
.gallery-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;margin-bottom:20px}
.chest-gallery .gallery-heading h1{margin:0}
.gallery-copy{display:inline-flex;align-items:center;gap:10px;min-height:44px;padding:8px 12px;border:1px solid #cbd2ca;border-radius:8px;background:#fff;color:#35453b;font:inherit;font-size:14px;cursor:pointer;white-space:nowrap}
.gallery-copy [data-example-code]{font-weight:700;letter-spacing:.04em}
.gallery-copy:focus-visible{outline:3px solid #71856a;outline-offset:3px}
.gallery-copy:hover{background:#f2f5ef}
.gallery-copy-status:not(.gallery-sr-only){margin:0 0 10px;font-size:14px;line-height:1.5;color:#435348;user-select:text}
.gallery-thumb-code{display:block;font-size:12px;font-weight:600;letter-spacing:.04em;color:#64715f}
.gallery-stage{position:relative;touch-action:pan-y}
.chest-gallery .example-picture{display:block;width:100%;aspect-ratio:3/2;overflow:hidden;padding:0;background:#faf8f3}
.chest-gallery .example-picture img{display:block;width:100%;height:100%;object-fit:contain}
.gallery-arrow{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:44px;border:1px solid #dedfd9;border-radius:50%;background:#fffffff0;color:#26312b;font:30px/1 sans-serif;cursor:pointer;box-shadow:0 2px 8px #00000008}
.gallery-prev{left:12px}.gallery-next{right:12px}
.gallery-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.gallery-thumbs{display:flex;gap:10px;margin-top:12px;padding:3px 3px 6px;overflow-x:auto;overscroll-behavior-x:contain;scroll-behavior:auto;touch-action:pan-x pan-y pinch-zoom;scrollbar-width:thin;scrollbar-color:#c9cec6 transparent;user-select:none;cursor:grab}
.gallery-thumbs button{flex:0 0 112px;padding:0 0 7px;border:1px solid transparent;border-radius:9px;background:transparent;color:#535e55;cursor:grab;font:inherit;min-width:0}
.gallery-thumbs.is-dragging,.gallery-thumbs.is-dragging *{cursor:grabbing}
.gallery-thumbs img{-webkit-user-drag:none}
.gallery-thumbs img{display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:contain;border-radius:7px}
.gallery-thumbs span{display:block;margin-top:6px;font-size:13px;line-height:1.4}
.gallery-thumbs .gallery-title-part{display:inline-block;margin:0;font:inherit;white-space:nowrap}
.gallery-thumbs button[aria-pressed=true]{border-color:#59665a;background:#fafbf8;color:#26312b}
.gallery-thumbs button:focus-visible,.gallery-arrow:focus-visible{outline:3px solid #71856a;outline-offset:3px}
@media(hover:hover){.gallery-thumbs button:hover{background:#f2f5ef}.gallery-arrow:hover{background:#fff}}
.chest-gallery .b1-reference{margin-top:16px;font-size:14px;line-height:1.8}
@media(max-width:600px){.gallery-thumbs{gap:8px;margin-top:10px}.gallery-thumbs button{flex-basis:88px;padding:0 0 6px}.gallery-thumbs span{font-size:13px}.gallery-prev{left:6px}.gallery-next{right:6px}.chest-gallery .b1-reference{font-size:13px}}

/* Existing content controls, with supporting copy inline instead of extra rows. */
.b1-content-inline.b1-content-study .b1-group-heading{justify-content:flex-start;align-items:baseline;flex-wrap:wrap;gap:4px 14px;margin-bottom:12px}
.b1-content-inline.b1-content-study .b1-content-intro{margin:0;line-height:1.5}
.b1-content-inline.b1-content-study .b1-group-items{row-gap:12px}
.b1-content-inline.b1-content-study .minimal-upload-row{display:flex;align-items:center;flex-wrap:wrap;gap:6px 12px;margin:0}
.b1-content-inline.b1-content-study .minimal-upload-row .b1-hint{margin:0;line-height:1.5;color:#435348;font-weight:500}
/* New local arrangements do not inherit B1 tax/price claims. */
[data-preview-unpriced] .estimate-unit small{display:none}

/* Accepted B1 polish, shared by all entrances: four sections, no extra content rows. */
html[data-b1-polish]{--b1-control-ease:cubic-bezier(.23,1,.32,1)}
html[data-b1-polish] .gallery-heading{margin-bottom:16px}
html[data-b1-polish] .gallery-copy{gap:8px;transition:background-color 160ms var(--b1-control-ease),border-color 160ms var(--b1-control-ease),transform 120ms var(--b1-control-ease)}
html[data-b1-polish] .gallery-copy [data-copy-label]{min-width:4em;text-align:center}
html[data-b1-polish] .gallery-copy[data-copy-state=success]{background:#edf3ed;border-color:#78917c;color:#2d5139}
html[data-b1-polish] .gallery-arrow{display:grid;place-items:center;padding:0;background:#fffffff5;border-color:#cbd2ca;transition:background-color 160ms var(--b1-control-ease),color 160ms var(--b1-control-ease),border-color 160ms var(--b1-control-ease)}
html[data-b1-polish] :is(.gallery-arrow,.gallery-rail-nav) svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
html[data-b1-polish] .b1-zoom{width:44px;height:44px;display:grid;place-items:center;transition:background-color 160ms var(--b1-control-ease),color 160ms var(--b1-control-ease)}
html[data-b1-polish] .gallery-rail{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:2px;margin-top:8px}
html[data-b1-polish] .gallery-rail .gallery-thumbs{margin:0;padding:4px 3px 6px}
html[data-b1-polish] .gallery-rail-nav{display:grid;place-items:center;align-self:start;margin-top:18px;width:44px;min-width:44px;height:44px;min-height:44px;padding:0;border:1px solid transparent;border-radius:50%;background:transparent;color:#35453b;cursor:pointer;transition:background-color 160ms var(--b1-control-ease),color 160ms var(--b1-control-ease)}
html[data-b1-polish] .gallery-rail-nav[aria-disabled=true]{color:#c1c8c0;cursor:default}
html[data-b1-polish] .gallery-rail[data-overflow=false]{grid-template-columns:minmax(0,1fr)}
html[data-b1-polish] .gallery-rail[data-overflow=false] .gallery-rail-nav{display:none}
html[data-b1-polish] .gallery-thumbs button{transition:background-color 160ms var(--b1-control-ease),border-color 160ms var(--b1-control-ease)}
html[data-b1-polish] .gallery-thumbs button[aria-pressed=true]{background:#f0f3ed;border-color:#4c6253;box-shadow:inset 0 0 0 1px #4c6253}
html[data-b1-polish] .chest-gallery .b1-reference{margin-top:12px}
html[data-b1-polish] .b1-builder-preview .b1-layout-canvas{gap:16px}
html[data-b1-polish] .b1-builder-preview .b1-layout-group{padding-top:16px}
html[data-b1-polish] .b1-builder-preview .b1-layout-group:first-child{padding-top:0}
html[data-b1-polish] .b1-builder-preview [data-layout-group=clothes]>.b1-group-heading{margin-bottom:14px}
html[data-b1-polish] .b1-builder-preview [data-layout-group=clothes]>.b1-group-items{gap:16px}
html[data-b1-polish] .b1-garment-tools{border-bottom:0;padding:10px 0 0}
html[data-b1-polish] .b1-builder-preview .estimate-materials .b1-garment-option{transition:background-color 160ms var(--b1-control-ease),border-color 160ms var(--b1-control-ease),box-shadow 160ms var(--b1-control-ease)}
html[data-b1-polish] .b1-builder-preview .estimate-materials .b1-garment-option[aria-pressed=true]{background:#f2f5ef}
html[data-b1-polish] .b1-builder-preview .b1-content-field #minimal-upload{min-height:44px}
html[data-b1-polish] .b1-builder-preview :is(.estimate-scope,.b1-calm-disclosure)>summary{min-height:44px;box-sizing:border-box;align-items:center}
html[data-b1-polish] .b1-builder-preview .estimate-scope>summary{padding-block:10px}
html[data-b1-polish] .b1-builder-preview .b1-garment-tools .b1-reference-trigger{border-radius:8px;transition:background-color 160ms var(--b1-control-ease),color 160ms var(--b1-control-ease)}
html[data-b1-polish] :is(.gallery-copy,.gallery-arrow,.gallery-rail-nav,#enlarge-example,#b1-color-trigger,#minimal-upload,#minimal-submit,.b1-reference-trigger,summary):focus-visible{outline:2px solid #536f5f;outline-offset:3px}
html[data-b1-polish] :is(.gallery-copy,.gallery-arrow,.gallery-rail-nav,#b1-color-trigger,#minimal-upload,#minimal-submit,.b1-reference-trigger){touch-action:manipulation}
html[data-b1-polish] :is(.gallery-copy,.gallery-arrow,.gallery-rail-nav,.gallery-thumbs button,#enlarge-example){-webkit-tap-highlight-color:transparent}
html[data-b1-polish] .gallery-thumbs button:active{background:#e7eee3}
html[data-b1-polish] :is(.gallery-arrow,.gallery-rail-nav):active:not([aria-disabled=true]){background:#dfe8de;color:#263d2b}
html[data-b1-polish] .gallery-copy:active{transform:scale(.98)}
html[data-b1-polish] .b1-builder-preview :is(#minimal-upload,#minimal-submit,#b1-color-trigger,.b1-reference-trigger):active:not(:disabled){box-shadow:inset 0 0 0 1px #617769}
@media(hover:hover) and (pointer:fine){
 html[data-b1-polish] .gallery-arrow:hover{background:#283e30;border-color:#283e30;color:#fff}
 html[data-b1-polish] .gallery-rail-nav:hover:not([aria-disabled=true]){background:#edf2eb;color:#263d2b}
 html[data-b1-polish] #enlarge-example:hover .b1-zoom{background:#283e30;color:#fff}
 html[data-b1-polish] .b1-builder-preview .b1-garment-tools .b1-reference-trigger:hover{background:#f0f3ee;color:#283e30}
}
@media(max-width:800px){
 html[data-b1-polish] .b1-builder-preview .estimate-materials .b1-garment-option{min-height:98px;padding-block:12px}
}
@media(max-width:600px){
 html[data-b1-polish] .gallery-rail-nav{margin-top:10px}
 html[data-b1-polish] .gallery-rail{column-gap:0}
}
@media(prefers-reduced-motion:reduce){
 html[data-b1-polish] :is(.gallery-copy,.gallery-arrow,.gallery-rail-nav,.b1-zoom,.gallery-thumbs button,.b1-garment-option,.b1-reference-trigger){transition:none}
 html[data-b1-polish] .gallery-copy:active{transform:none}
}

/* A quiet outlined label distinguishes the current garment from the dialog title. */
:is(#b1-garment-dialog,#b1-size-dialog) .b1-palette-copy{display:flex;align-items:baseline;flex-wrap:wrap;gap:4px 16px}
:is(#b1-garment-dialog,#b1-size-dialog) .b1-palette-title{flex-shrink:0}
:is(#b1-garment-dialog,#b1-size-dialog) .b1-palette-meta{margin:0;padding:3px 10px;border:1px solid var(--garment-line,#d4ddd0);border-radius:7px;background:var(--garment-soft,#eef2e9);font-size:18px;line-height:1.4;font-weight:600;color:var(--garment-ink,#253329);white-space:nowrap}

/* Accepted B1 refinement, shared by every gallery; keep existing controls, assets and form. */
html[data-b1-polish] body[data-gallery-refinement] .gallery-thumbs span{font-weight:600}
html[data-b1-polish] body[data-gallery-refinement] .gallery-thumb-code{font-weight:400}
html[data-b1-polish] body[data-gallery-refinement] .b1-builder-preview .estimate-materials .b1-garment-option[aria-pressed=true]{background:var(--garment-soft,#f2f5ef);border-color:#354137;box-shadow:inset 0 0 0 1px #354137}
html[data-b1-polish] body[data-gallery-refinement] .b1-builder-preview .estimate-materials .b1-garment-option[aria-pressed=false]{background:var(--garment-wash,#fff);border-color:var(--garment-line,#dce1da)}
@media(hover:hover) and (pointer:fine){
 html[data-b1-polish] body[data-gallery-refinement] .b1-builder-preview .estimate-materials .b1-garment-option[aria-pressed=false]:hover{background:var(--garment-soft,#fff);border-color:var(--garment-ink,#7f8f82)}
 html[data-b1-polish] body[data-gallery-refinement] .b1-builder-preview .estimate-materials .b1-garment-option[aria-pressed=true]:hover{background:var(--garment-soft,#f2f5ef);border-color:#354137}
}
html[data-b1-polish] body[data-gallery-refinement] .b1-builder-preview .estimate-materials .b1-garment-option[aria-pressed=false]:active{background:var(--garment-soft,#f5f7f3);border-color:var(--garment-ink,#7f8f82)}
html[data-b1-polish] body[data-gallery-refinement] .b1-builder-preview .estimate-materials .b1-garment-option[aria-pressed=true]:active{background:var(--garment-soft,#e7eee3)}
@media(max-width:600px){
 /* Use the existing 20px page gutters; arrows retain separate 44px hit areas. */
 html[data-b1-polish] body[data-gallery-refinement] .gallery-rail[data-overflow=true]{grid-template-columns:24px minmax(0,1fr) 24px}
 html[data-b1-polish] body[data-gallery-refinement] .gallery-rail-nav:first-child{justify-self:end}
 html[data-b1-polish] body[data-gallery-refinement] .gallery-rail-nav:last-child{justify-self:start}
 /* The shared focus selector contains IDs; keep only this edge offset local. */
 html[data-b1-polish] body[data-gallery-refinement] .gallery-rail-nav:focus-visible{outline-offset:-3px!important}
}

/* One identity palette per garment; garment colours and selection checks keep their own roles. */
html[data-garment-identity=G001],.b1-garment-option[data-mitt-garment=G001]{--garment-wash:#f3f6f1;--garment-soft:#e9efe5;--garment-line:#cdd7c7;--garment-ink:#41543d;--garment-deep:#30422d}
html[data-garment-identity=G002],.b1-garment-option[data-mitt-garment=G002]{--garment-wash:#f0f5f8;--garment-soft:#e5eff4;--garment-line:#c9d9e2;--garment-ink:#34576a;--garment-deep:#264454}
html[data-garment-identity=G003],.b1-garment-option[data-mitt-garment=G003]{--garment-wash:#f8f4ea;--garment-soft:#eee5d2;--garment-line:#d4c09a;--garment-ink:#72572b;--garment-deep:#57411e}
html[data-b1-polish] .b1-garment-option :is(.b1-garment-name,.b1-upgrade-badge){color:var(--garment-ink)}
html[data-b1-polish] .b1-garment-option[data-mitt-garment=G003] .b1-upgrade-badge{background:#eee5d2;border-radius:4px;padding-inline:5px}
html[data-b1-polish] .b1-garment-option[aria-pressed=true] .b1-garment-check{background:#354137;border-color:#354137;color:#fff}
html[data-garment-identity] .b1-garment-context-heading{justify-content:flex-start;align-items:center;flex-wrap:wrap;gap:4px 12px}
.b1-garment-identity{display:inline-flex;align-items:center;margin:0;padding:1px 8px;border:1px solid var(--garment-line);border-radius:6px;background:var(--garment-soft);color:var(--garment-ink);font-size:14px;font-weight:600;line-height:1.4;white-space:nowrap}
.b1-garment-identity[hidden]{display:none}
html[data-garment-identity] #b1-palette-title{display:inline-block;padding:3px 10px;border:1px solid var(--garment-line);border-radius:7px;background:var(--garment-soft);color:var(--garment-ink)}
html[data-garment-identity] .b1-builder-preview :is(#b1-color-trigger,#b1-quantity-trigger){background:var(--garment-wash);border-color:var(--garment-line)}
html[data-garment-identity] .b1-builder-preview .b1-garment-tools .b1-reference-trigger{color:var(--garment-ink)}
html[data-garment-identity] .b1-builder-preview .qty-action,html[data-garment-identity] #b1-quantity-panel .b1-palette-meta{color:var(--garment-ink)}
html[data-garment-identity] .b1-builder-preview #minimal-submit{background:var(--garment-ink);border-color:var(--garment-ink);--mm-fill-color:var(--garment-deep);--mm-hover-ink:#fff}
html[data-garment-identity] #b1-quantity-panel #qty-apply{background:var(--garment-soft);border-color:var(--garment-line);color:var(--garment-ink)}
html[data-garment-identity] :is(#b1-size-dialog .b1-size-tab[aria-selected=true],#b1-quantity-panel input:focus-visible){border-color:var(--garment-ink)}
@media(hover:hover) and (pointer:fine){
 html[data-garment-identity] .b1-builder-preview :is(#b1-color-trigger,#b1-quantity-trigger):hover{background:var(--garment-soft);border-color:var(--garment-ink)}
 html[data-garment-identity] .b1-builder-preview .b1-garment-tools .b1-reference-trigger:hover{background:var(--garment-wash);color:var(--garment-ink)}
 html[data-garment-identity] #b1-quantity-panel #qty-apply:hover{background:var(--garment-wash)}
}
