/* Original raster corners/rails surround proportionally cropped parchment artwork. */
.wine-card .so-label-window.fitted-label-window{display:flex;align-items:center;justify-content:center;background:transparent;overflow:hidden}
.fitted-label-window .fitted-parchment{position:absolute;inset:0;width:100%;height:100%;isolation:isolate}
.fitted-label-window .fitted-parchment>img.parchment-art{display:none}
.fitted-label-window .fitted-label-zone{position:absolute;z-index:1;inset:4% 2%;display:flex;align-items:center;justify-content:center}
.fitted-label-window .fitted-label-zone>img.fitted-label-art{position:static;display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;transform:none;filter:none;opacity:1;background:none}

.fitted-label-window .fitted-parchment::before{content:none}
.fitted-label-window .fitted-label-zone{transform:translateY(-2%)}
.fitted-label-window .fitted-parchment--silver-oak .fitted-label-zone{inset:7% 3%}

.wine-card:has(.fitted-label-window) .ca-background-image{left:0;width:100%}
.wine-card:has(.fitted-label-window) .so-scene::before{left:0}
.wine-card:has(.fitted-label-window) .so-scene::after{left:0}

/* Source units:640x800. Remove only outer transparent margins15/11/15/18.
   A96px source corner preserves the entire leaf (which extends past64px).
   Every corner has the same uniform source scale; only plain rail strips stretch. */
.fitted-paper-slices{--paper-corner:clamp(10px,2cqw,20px);--pcw:calc(var(--paper-corner)*1.265625);--pct:calc(var(--paper-corner)*1.328125);--pcb:calc(var(--paper-corner)*1.21875);--prw:calc(var(--paper-corner)*.265625);--prt:calc(var(--paper-corner)*.328125);--prb:calc(var(--paper-corner)*.21875);position:absolute;inset:0;display:block;pointer-events:none;overflow:hidden}
.fitted-paper-piece{position:absolute;display:block;overflow:hidden}
.fitted-paper-piece>svg{position:absolute;inset:0;width:100%;height:100%;display:block;overflow:hidden}
.fitted-paper-center{inset:0;clip-path:none;-webkit-mask-image:radial-gradient(ellipse calc(var(--paper-corner)*.609375) calc(var(--paper-corner)*.609375) at 0 0,transparent 98%,#000 100%),radial-gradient(ellipse calc(var(--paper-corner)*.609375) calc(var(--paper-corner)*.609375) at 100% 0,transparent 98%,#000 100%),radial-gradient(ellipse calc(var(--paper-corner)*.609375) calc(var(--paper-corner)*.71875) at 0 100%,transparent 98%,#000 100%),radial-gradient(ellipse calc(var(--paper-corner)*.609375) calc(var(--paper-corner)*.71875) at 100% 100%,transparent 98%,#000 100%);mask-image:radial-gradient(ellipse calc(var(--paper-corner)*.609375) calc(var(--paper-corner)*.609375) at 0 0,transparent 98%,#000 100%),radial-gradient(ellipse calc(var(--paper-corner)*.609375) calc(var(--paper-corner)*.609375) at 100% 0,transparent 98%,#000 100%),radial-gradient(ellipse calc(var(--paper-corner)*.609375) calc(var(--paper-corner)*.71875) at 0 100%,transparent 98%,#000 100%),radial-gradient(ellipse calc(var(--paper-corner)*.609375) calc(var(--paper-corner)*.71875) at 100% 100%,transparent 98%,#000 100%);-webkit-mask-composite:source-in;mask-composite:intersect}
.fitted-paper-tl{left:0;top:0;width:var(--pcw);height:var(--pct)}
.fitted-paper-tr{right:0;top:0;width:var(--pcw);height:var(--pct)}
.fitted-paper-bl{left:0;bottom:0;width:var(--pcw);height:var(--pcb)}
.fitted-paper-br{right:0;bottom:0;width:var(--pcw);height:var(--pcb)}
.fitted-paper-top{left:var(--pcw);right:var(--pcw);top:0;height:var(--prt)}
.fitted-paper-bottom{left:var(--pcw);right:var(--pcw);bottom:0;height:var(--prb)}
.fitted-paper-left{left:0;top:var(--pct);bottom:var(--pcb);width:var(--prw)}
.fitted-paper-right{right:0;top:var(--pct);bottom:var(--pcb);width:var(--prw)}

/* Match the fitted frame's muted aged gold; retain original source artwork. */
.fitted-paper-border{filter:saturate(.48) brightness(.94)}

/* The world badge follows the visible framed label, including short/wide labels. */
.fitted-label-zone{container-type:size;--fitted-image-height:min(calc(100cqh - 10px),calc(100cqw * var(--fitted-ratio)))}
.fitted-label-window .fitted-label-zone>img.fitted-label-art{height:var(--fitted-image-height)}
.silver-oak-ornate .so-label-window .label-world-badge{position:absolute;z-index:2;left:50%;bottom:3%;transform:translateX(-50%);float:none;margin:0;white-space:nowrap;box-sizing:border-box;max-width:96%;font-size:clamp(8px,1.8vw,15px)!important;letter-spacing:.07em!important;padding:.16em .42em!important;border:.75px solid transparent!important;border-radius:999px!important;background:linear-gradient(#311b15,#21110f) padding-box,linear-gradient(145deg,#756042 0%,#ead3a1 20%,#a38454 42%,#f0dcaf 58%,#806440 82%,#ceaf78 100%) border-box!important;box-shadow:inset 0 1px 1px #f8e2b833,0 1px 2px #100a0799!important}
.silver-oak-ornate .fitted-label-zone .label-world-badge{top:calc(50% + var(--fitted-image-height)/2 - 1px);bottom:auto}
.california-cabernet-card .so-label-window:not(.fitted-label-window) .ca-label-stage{bottom:24px;height:auto}

.fitted-label-window .fitted-label-zone:has(.label-world-badge){transform:translateY(-6%)}
.silver-oak-ornate .so-label-window .label-world-badge{display:flex!important;align-items:center;justify-content:center;text-align:center;line-height:1!important;padding:.2em .42em!important}
/* Restore recessed parchment shading beneath the separate framed label. */
.fitted-paper-center::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,#24130999,transparent 24%,transparent 76%,#24130999),linear-gradient(180deg,#24130988,transparent 20%,transparent 80%,#24130988);box-shadow:inset 0 0 calc(var(--paper-corner)*1.2) #28160b88}
/* Stronger cast shadows keep the label assembly and world badge above the paper. */
.fitted-label-window .fitted-label-zone>img.fitted-label-art{filter:drop-shadow(0 3px 2.5px #160c07b8)}
.silver-oak-ornate .so-label-window .label-world-badge{box-shadow:inset 0 1px 1px #f8e2b833,0 2px 3px #120906c4!important}

/* Consistent parchment footer, independent of label proportions. */
.silver-oak-ornate .so-label-window .label-location-badges{position:absolute;z-index:3;left:3%;right:3%;bottom:1.5cqw;display:flex;flex-direction:column-reverse;align-items:center;gap:.65cqw}
.silver-oak-ornate .so-label-window .label-location-badges .label-world-badge{position:static;transform:none;top:auto;bottom:auto;max-width:100%;width:max-content;font-size:clamp(7px,1.62cqw,13.5px)!important;font-family:Georgia,serif;font-weight:700}
.fitted-label-window .fitted-label-zone{transform:translateY(-6%)}
.silver-oak-ornate .so-label-window:has(.cooler-pill) .ca-label-stage{bottom:16%}

.silver-oak-ornate .so-label-window .label-location-badges .label-world-badge{align-self:center!important;min-height:0!important;height:auto!important}

/* Extend only the header paint beneath the parchment's cut-out corner. */
.silver-oak-ornate .so-header::before{content:"";position:absolute;right:100%;top:0;bottom:-1px;width:3cqw;background:linear-gradient(180deg,#48091d,#310812 70%,#28090f);border-bottom:1px solid #ac8149;pointer-events:none;z-index:-1}

.wine-label-star{position:absolute;z-index:4;left:50%;top:.8cqw;transform:translateX(-50%);width:3cqw;height:3cqw;min-width:12px;min-height:12px;background:url('../assets/wine-card/metallic-star.svg') center/contain no-repeat;filter:drop-shadow(0 0 2px #ffe2a1) drop-shadow(0 0 5px #d89e3da8);pointer-events:none}
.fitted-label-zone .wine-label-star{top:max(0px,calc(50% - var(--fitted-image-height)/2 - 1.5cqw));transform:translate(-50%,-50%)}
.so-label-window:has(>.wine-label-star) .ca-label-stage{top:3.6cqw}
/* Reserve a small crown area only when a dataset star is present. */
.fitted-label-window .fitted-label-zone:has(.wine-label-star){top:14%;bottom:14%;transform:none}
.fitted-label-zone .wine-label-star{top:0;transform:translate(-50%,-65%)}

/* Fit within the real space above the footer, without upward translation.
   Match top and bottom clearance around the complete frame, not just label paper. */
.silver-oak-ornate .so-label-window{
 --location-rows:1;
 --location-font:clamp(7px,1.62cqw,13.5px);
 --location-height:calc(var(--location-rows) * (var(--location-font) * 1.4 + 1.5px) + (var(--location-rows) - 1) * .65cqw);
 --label-top-bound:clamp(4px,.8cqw,8px);
 --label-bottom-bound:calc(1.5cqw + var(--location-height));
}
.silver-oak-ornate .so-label-window:has(.label-location-badges>:nth-child(2)){--location-rows:2}
.fitted-label-window .fitted-label-zone,
.fitted-label-window .fitted-parchment--silver-oak .fitted-label-zone,
.fitted-label-window .fitted-label-zone:has(.wine-label-star){
 top:var(--label-top-bound);bottom:var(--label-bottom-bound);left:2%;right:2%;transform:none;
}
.fitted-label-window .fitted-label-zone:has(.wine-label-star){top:calc(var(--label-top-bound) + 2.5cqw)}
.fitted-label-zone .wine-label-star{top:0;transform:translate(-50%,-70%)}

.fitted-label-window .fitted-label-zone>img.fitted-label-art{width:calc(100% * var(--fitted-display-scale,1));height:calc(var(--fitted-image-height) * var(--fitted-display-scale,1))}
