.fitting-scene-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0;}
.fitting-scene-controls button{display:flex;align-items:center;gap:8px;min-height:44px;padding:8px 12px;border:1px solid var(--line);background:transparent;color:var(--ink);font:inherit;font-size:13px;cursor:pointer;}
.fitting-scene-controls strong{font-weight:400;margin-right:auto;}
.fitting-scene-controls button>span:first-child{color:var(--ink-mid);font-size:11px;}
.fitting-scene-controls button:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}
.co-parts{margin-bottom:24px;}
.co-parts>summary{font-size:14px;letter-spacing:.1em;cursor:pointer;padding:12px 0;}
.co-palette{min-width:0;}
[data-background="sage"]{--fitting-background:var(--sage);}
[data-background="ivory"]{--fitting-background:var(--paper-3);}
[data-background="rose"]{--fitting-background:var(--accent);}
[data-background="brown"]{--fitting-background:var(--ink);}
#fitting3dRetry[hidden]{display:none;}
#fitting3d{position:relative;}
#fitting3d model-viewer{display:block;width:100%;height:clamp(260px,36vw,450px);max-height:calc(100svh - var(--navh) - 285px);min-height:220px;background:var(--fitting-background);--progress-bar-color:var(--accent);touch-action:pan-y;}
.fitting-3d-note{font-size:12px;line-height:1.65;color:var(--ink-mid);margin:8px 0 12px;}
.fitting-3d-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;}
.fitting-3d-tools button{font:inherit;font-size:12px;border:0;border-bottom:1px solid var(--ink-mid);padding:4px 0;background:none;color:var(--ink);cursor:pointer;}
.fitting-3d-tools span{font-size:12px;color:var(--ink-mid);}

@media(max-width:900px){
 .page-estimate .co{display:flex;flex-direction:column;align-items:stretch;gap:0;}
 .page-estimate .co>div{display:contents;}
 .page-estimate .co-sticky{order:0;align-self:stretch;}
 .co-palette{order:1;width:100%;max-width:100%;}
 .co-parts{order:2;margin:12px 0;}
 .co-actions{order:3;}
 .co-fitting-help{order:4;}
 .page-estimate .co-stage-title{display:none;}
 .fitting-scene-controls{gap:6px;margin:4px 0 6px;}
 .fitting-scene-controls button{font-size:12px;padding:6px 8px;gap:6px;}
 #fitting3d model-viewer{height:24svh;min-height:140px;max-height:210px;}
 .fitting-3d-note{font-size:11px;margin:0;}
 .fitting-3d-note:not(:empty){line-height:1.4;}
 .fitting-3d-tools{padding:0;min-height:30px;}
 .fitting-3d-tools button{min-height:36px;}
 .page-estimate .co-selection{padding:8px 12px;min-height:44px;}
 .page-estimate .co-next{min-height:40px;display:flex;align-items:center;}
 .page-estimate .co-palette .co-label{margin:8px 0 4px;font-size:12px;}
 .page-estimate .co-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:12px;margin:0 0 6px;padding:0;}
 .page-estimate .co-tab{flex:0 0 auto;min-height:40px;padding:8px 2px;font-size:12px;}
 .page-estimate .co-grid{grid-template-columns:repeat(3,minmax(0,1fr));max-height:34svh;min-height:150px;gap:8px;padding:2px;}
 .co-parts summary{min-height:44px;}
}

/* Swipe normally; only a long press starts a touch drag. */
.page-estimate .co-sw .im{touch-action:pan-y pinch-zoom;user-select:none;-webkit-user-drag:none;-webkit-touch-callout:none;cursor:grab;}
.page-estimate .co-sw .lb{touch-action:pan-y;}
.page-estimate .co-selection{display:block;}
.page-estimate .co-target{font-size:13px;line-height:1.6;}
.fabric-drag-ghost{position:fixed;z-index:9999;width:64px;height:64px;transform:translate(-50%,-110%);border:2px solid var(--ink);background:var(--paper);pointer-events:none;}
.fabric-drag-ghost .im{display:block;width:100%;height:100%;object-fit:cover;}
.fabric-drag-ghost.can-drop{border:3px solid var(--accent);}
.is-fabric-dragging,.is-fabric-dragging *{cursor:grabbing!important;user-select:none;}
@media(max-width:900px){
 .page-estimate .co-target{font-size:12px;margin:0;text-align:left;}
 .page-estimate .co-selection{min-height:40px;padding:6px 10px;}
}

.co-drag-touch-help{display:none;}
@media(pointer:coarse){.co-drag-touch-help{display:block;font-size:11px;color:var(--ink-mid);margin:0 0 6px;}}
