/* Fit a Part: paired surfaces take priority; editing tools sit below the photo. */
#pocket-photo-dialog{
 --fit-ink:#273640;--fit-muted:#596975;--fit-line:#ccd4d7;
 --fit-work-height:clamp(280px,43dvh,430px);
 width:min(1200px,calc(100vw - 28px));max-height:calc(100dvh - 24px);
 color:var(--fit-ink);background:#fafaf8;scrollbar-gutter:stable;
}
#pocket-photo-dialog header{padding:9px clamp(10px,2vw,18px);background:#fafaf8}
#pocket-photo-dialog header strong{font:700 clamp(1.05rem,2vw,1.35rem)/1.2 var(--sans)}
#pocket-photo-dialog footer{position:sticky;bottom:0;z-index:6;justify-content:flex-end;
 padding:8px clamp(10px,2vw,18px) max(8px,env(safe-area-inset-bottom));border-top:1px solid var(--fit-line);background:#fafaf8}
#pocket-photo-dialog footer button:first-child:not([hidden]){margin-inline-end:auto}
#pocket-photo-dialog #full-insert-note{margin:8px clamp(10px,2vw,18px) 0;padding:6px 9px;color:var(--fit-muted);border-inline-start:2px solid var(--fit-line);font:500 12px/1.4 var(--sans)}
#pocket-photo-dialog .pocket-fit-workspace{
 grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;
 gap:clamp(8px,1.4vw,18px);margin:8px clamp(10px,2vw,18px) 14px;
}
#pocket-photo-dialog :is(.pocket-fit-input,.pocket-insert-preview){
 min-width:0;display:grid;align-content:start;grid-template-rows:auto auto auto;gap:8px;
}
#pocket-photo-dialog .pocket-insert-preview{margin:0;padding:0;border:0;border-radius:0;background:none;color:var(--fit-ink)}
#pocket-photo-dialog :is(.pocket-photo-tools,.pocket-insert-heading){
 display:flex;align-items:center;flex-wrap:wrap;gap:5px 8px;min-height:44px;margin:0;padding:0;
}
#pocket-photo-dialog .pocket-insert-heading{justify-content:space-between}
#pocket-photo-dialog .pocket-insert-heading strong{font:700 14px/1.15 var(--sans)}
#pocket-photo-dialog .pocket-insert-spec{min-height:0;max-width:100%;color:var(--fit-muted)}
#pocket-photo-dialog :is(#pocket-photo-photo,.pocket-insert-stage){
 position:relative;box-sizing:border-box;width:100%;margin:0;
 height:var(--fit-work-height);min-height:0;border:1px solid var(--fit-line);border-radius:10px;overflow:hidden;
}
#pocket-photo-dialog #pocket-photo-photo{background:#edf0ee}
#pocket-photo-dialog .pocket-insert-stage{background:radial-gradient(ellipse at 45% 34%,#f1f1ed,#e1e5e5 73%,#dbe1e2)}
#pocket-photo-dialog .pocket-fit-input:has(#pocket-photo-photo[data-empty=true]) #pocket-photo-pick{display:none}
#pocket-photo-dialog .pocket-fit-settings{display:grid;gap:7px;min-width:0}
#pocket-photo-dialog :is(#pocket-photo-wand,#pocket-photo-shape:not([hidden]),.pocket-photo-check,#pocket-photo-note){margin:0;padding:0}
#pocket-photo-dialog #pocket-photo-note{min-height:0;line-height:1.44;color:var(--fit-muted)}
#pocket-photo-dialog #pocket-photo-note:empty,#pocket-photo-dialog .pocket-photo-check:not(:has(:not([hidden]):not(:empty))){display:none}
#pocket-photo-dialog #pocket-photo-measures:not([hidden]){
 position:static;display:flex;flex-wrap:wrap;gap:6px;align-items:flex-end;pointer-events:auto;
}
#pocket-photo-dialog .pocket-photo-measure{
 position:static;transform:none;flex:1 1 70px;font-size:11px;min-width:0;padding:4px 7px;background:#fff;
}
#pocket-photo-dialog .pocket-photo-measure input{width:100%;min-height:44px;font-size:16px}
#pocket-photo-dialog #pocket-photo-reset{
 appearance:none;min-height:44px;border-color:transparent;background:transparent;font-weight:600;color:var(--fit-muted);
}
#pocket-photo-dialog #pocket-photo-reset:hover{border-color:var(--fit-line);background:#f2f4f2}
#pocket-photo-dialog .pocket-trace-more{justify-self:start;max-width:100%}
#pocket-photo-dialog .pocket-trace-more:not(:has(#pocket-photo-smooth-row:not([hidden]))){display:none}
#pocket-photo-dialog .pocket-trace-more summary{display:list-item;min-height:44px;padding:13px 4px;color:var(--fit-muted);cursor:pointer;font:600 12px/1.35 var(--sans)}
#pocket-photo-dialog .pocket-shape-options,#pocket-photo-dialog .pocket-wand-actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
#pocket-photo-dialog :is(.pocket-shape-options,.pocket-wand-actions) button{white-space:normal;overflow-wrap:anywhere;font-size:12px;padding:4px}
#pocket-photo-dialog .pocket-photo-tools label:has(input:focus-visible){box-shadow:inset 0 -3px #386984}
#pocket-photo-dialog #pocket-insert-instructions{margin:0;padding:0 2px;color:var(--fit-muted)}
#pocket-photo-dialog #pocket-insert-status{padding:8px 12px;color:var(--fit-muted)}
@supports(grid-template-rows:subgrid){
 @media(min-width:761px){
  #pocket-photo-dialog :is(.pocket-fit-input,.pocket-insert-preview){grid-row:span 3;grid-template-rows:subgrid}
 }
}
@media(max-width:760px){
 #pocket-photo-dialog{
  --fit-work-height:clamp(160px,36dvh,268px);
  width:calc(100vw - 14px);max-height:calc(100dvh - 14px);scrollbar-gutter:auto;
 }
 #pocket-photo-dialog .pocket-fit-workspace{grid-template-columns:minmax(0,1fr);gap:12px;margin-inline:9px}
 #pocket-photo-dialog .pocket-insert-heading{min-height:27px}
 #pocket-photo-dialog .pocket-photo-measure{min-width:72px}
 #pocket-photo-dialog #pocket-photo-reset{flex-basis:100%;text-align:start;justify-self:start}
}
@media(forced-colors:active){
 #pocket-photo-dialog :is(.pocket-photo-tools label,.pocket-photo-measure,.pocket-insert-stage,#pocket-photo-photo){border-color:CanvasText}
}

#pocket-photo-dialog #pocket-photo-smooth-row{
 display:flex;align-items:center;justify-content:space-between;gap:9px;
 justify-self:start;font:600 13px/1.3 var(--sans);color:var(--fit-muted);
}
#pocket-photo-dialog #pocket-photo-smooth{
 min-height:44px;max-width:100%;padding:5px 9px;border:0;border-radius:9px;
 font:650 16px/1.2 var(--sans);color:#203746;background:#e8eef0;
}
