/* Deck navigation, printable guides and comparison surfaces. */
#stage-scroll{position:relative;overflow:auto;overscroll-behavior:contain;touch-action:none}
#stage-shell{padding:0!important;min-width:100%;width:max-content;min-height:100%;overflow:visible;display:flex;justify-content:center;align-items:center}
.deck-carousel{position:relative;width:100%;min-width:calc(var(--card-width) + 64px);flex:1;min-height:200px;overflow:hidden}
.deck-center{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:10;display:flex;flex-direction:column;align-items:center}
.deck-center .card-stage{z-index:2}
.deck-neighbor{position:absolute;top:50%;left:50%;width:var(--thumb-width);height:var(--thumb-height);transform:translate(calc(-50% + var(--shift)),-50%);opacity:var(--thumb-alpha);border:1px solid #ffffff48;border-radius:4px;padding:0;overflow:hidden;background:#1a2424;box-shadow:0 7px 16px #0006;transition:opacity .12s,filter .12s}
.deck-neighbor:hover,.deck-neighbor:focus-visible{opacity:.9!important;z-index:8;filter:brightness(1.2)}
.deck-neighbor img{display:block;width:100%;height:100%;object-fit:fill;pointer-events:none}
.deck-neighbor>span:last-child{position:absolute;bottom:0;right:0;background:#14191ace;color:#fff;padding:2px 5px;font-size:10px}
.deck-neighbor.row-hidden img{filter:grayscale(1)}
.deck-thumb-error{display:grid;place-items:center;width:100%;height:100%;color:var(--coral)}
.card-stage .handles{touch-action:none}
.canvas-grid{pointer-events:none;fill:url(#deck-grid);opacity:.55}
.crop-mode .hit[data-layer]{cursor:grab}
.crop-mode .hit[data-layer]:active{cursor:grabbing}
.zoom-help{color:var(--muted);font-size:10px}
.modal:has(.gallery-grid),.modal:has(.gallery-comparison){width:min(1180px,96vw);height:min(92dvh,1000px);max-height:none;display:flex;flex-direction:column}
.modal:has(.gallery-grid) .modal-body,.modal:has(.gallery-comparison) .modal-body{overflow:auto;flex:1;min-height:0}
.gallery-tools{display:flex;align-items:end;gap:10px;position:sticky;top:0;background:#292b2cf5;padding:10px 0;z-index:2}
.gallery-tools .field:first-child{flex:1}
.gallery-tools .field:nth-child(2){width:170px}
.gallery-tools button{height:32px;flex-shrink:0}
.gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(145px,1fr));gap:13px;margin:10px 0 20px}
.gallery-item{border:1px solid #4a5855;border-radius:7px;padding:8px;background:#202828;display:flex;flex-direction:column;gap:8px;min-width:0}
.gallery-item.has-error{border-color:#e8625288}
.gallery-image{height:180px;width:100%;display:flex;justify-content:center;align-items:center;padding:3px;background:#172020}
.gallery-image img{height:100%;width:100%;object-fit:contain}
.gallery-item-caption{display:flex;flex-direction:column;gap:3px;min-width:0}
.gallery-item-caption b{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.gallery-item-caption span{font-size:10px;color:#abb6b0}
.gallery-compare-button{border:1px solid #475a56;padding:5px}
.gallery-compare-button.active{color:var(--aqua);border-color:var(--aqua)}
.gallery-pager{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-bottom:6px}
.gallery-comparison{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.gallery-comparison>section{border:1px solid #50605a;background:#1a2524;border-radius:8px;padding:14px;min-width:0}
.gallery-comparison img{display:block;width:100%;max-height:65vh;object-fit:contain;margin:auto}
.gallery-comparison p{font-size:11px;line-height:1.6;overflow-wrap:anywhere}
.gallery-error{display:grid;place-items:center;width:100%;min-height:120px;color:var(--coral)}
.crop-fields{padding:9px 0;border-top:1px solid var(--line)}
.crop-fields .grid2{gap:6px}
.crop-fields .check{margin:7px 0}
.crop-fields .active{border-color:var(--aqua);color:var(--aqua)}
.print-settings{border:1px solid var(--line);padding:12px;border-radius:7px;margin-top:12px}
.print-settings .grid2{margin-top:8px}
.print-settings .check{margin:10px 0}
@media(max-width:760px){.deck-neighbor{opacity:calc(var(--thumb-alpha)*.65)}.gallery-comparison{grid-template-columns:1fr}.gallery-tools{flex-wrap:wrap}.gallery-tools .field:first-child{min-width:100%}}

.crop-mode-label{position:absolute;bottom:8px;left:8px;background:#222e;color:var(--aqua);font-size:10px;padding:4px 6px;pointer-events:none;border-radius:3px}
