/* A message contains absolutely positioned text. Give its page a definite
   box on desktop, mobile and in the dialog; the dock scales the whole page. */
 .editor-preview:not(.fp-journey-preview) .preview-desk.showing-message{display:block;min-height:300px;max-height:none;height:auto}
 .editor-preview:not(.fp-journey-preview) .booklet-message-preview{display:block;width:var(--desktop-message-width,100%);max-width:100%;min-width:0;margin-inline:auto}
 .editor-preview:not(.fp-journey-preview) .booklet-message-preview>.booklet-page-message{display:block;width:100%;height:var(--desktop-message-height,auto);min-height:0;max-height:none}
#floating-preview-host[hidden],#floating-preview-dialog:not([open]){display:none!important}
.floating-preview-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 0 12px}
.floating-preview-heading>span{font:10px/1.4 var(--sans);letter-spacing:.09em;text-transform:uppercase;color:var(--muted)}
.floating-preview-heading button{padding:9px 14px;min-height:38px;border:1px solid #cbb58c;border-radius:22px;background:#fffcf5;color:#304939;font:11px/1.3 var(--sans);white-space:nowrap}
.preview-attachments{font:10px/1.5 var(--sans);color:#69705f;margin-top:10px;overflow-wrap:anywhere}
.floating-preview-footer{font:11px/1.5 var(--sans);margin-top:12px}
.preview-faces{max-width:100%;flex-wrap:wrap}
.preview-faces button{min-width:0}
/* A real envelope face, sharing the same draft colors and lettering. */
.preview-envelope-stage{position:relative;isolation:isolate;width:min(94%,400px);aspect-ratio:1.5;filter:drop-shadow(0 13px 13px #3f2c1c29);transform:rotate(-3deg)}
.preview-envelope-stage>.envelope{position:absolute;inset:0;width:100%;height:100%;max-width:none;max-height:none;min-width:0;min-height:0;bottom:auto;aspect-ratio:auto;margin:0;padding:0;transform:none;box-shadow:none;cursor:default}
.preview-envelope-stage .env-back{position:absolute;inset:0;background:linear-gradient(135deg,color-mix(in srgb,var(--env) 84%,white),var(--env));border-radius:3px;box-shadow:inset 0 0 0 1px #ffffff26}
.preview-envelope-stage .env-front{position:absolute;inset:0;background:linear-gradient(35deg,color-mix(in srgb,var(--env) 83%,black),var(--env));clip-path:polygon(0 0,50% 56%,100% 0,100% 100%,0 100%);z-index:2}
.preview-envelope-stage .env-flap{position:absolute;inset:0 0 42%;background:linear-gradient(155deg,color-mix(in srgb,var(--env) 88%,white),var(--env));clip-path:polygon(0 0,100% 0,50% 100%);filter:drop-shadow(0 2px 2px #0003);z-index:3}
.preview-envelope-stage .env-seal{position:absolute;left:50%;top:51%;transform:translate(-50%,-50%);z-index:4;display:grid;place-items:center;width:49px;height:49px;border-radius:50%;background:radial-gradient(circle at 35% 24%,#f2dba5,#b38c47 68%,#92703c);border:2px solid #b6975e;box-shadow:0 2px 4px #3624154d,inset 0 0 0 2px #f4dba966;font:13px/1 var(--serif);color:#554021}
.preview-envelope-stage .env-address{position:absolute;z-index:5;left:8%;right:8%;bottom:10%;font:20px/1.2 var(--cardfont,var(--serif));text-align:center;color:var(--envelope-lettering,#fff3d9);overflow-wrap:anywhere}
.preview-added-items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;width:100%;max-height:430px;overflow:auto;align-content:start;scrollbar-width:thin}
.preview-added-item{min-width:0;margin:0;display:grid;place-items:center;gap:8px;padding:10px;border:1px solid #d3c7b1;border-radius:9px;background:#fffcf2;color:var(--ink);text-align:center;font:11px/1.4 var(--sans)}
.preview-added-item :is(img,video,canvas){display:block;width:100%;max-width:100%;max-height:195px;object-fit:contain;border-radius:4px}
.preview-added-item canvas{aspect-ratio:1.1;height:auto}
.preview-added-item :is(strong,figcaption,span){max-width:100%;overflow-wrap:anywhere}
.editor-preview .preview-desk.showing-attachments{padding:22px;min-height:220px}
/* The enlarged preview uses the original aside and original photo controls. */
#floating-preview-dialog{width:min(760px,calc(100vw - 30px));max-width:calc(100vw - 20px);max-height:calc(var(--floating-preview-vv-height,100dvh) - 24px);margin:auto;padding:0;border:1px solid #c7af7e;border-radius:15px;background:#f8f5ed;color:var(--ink);box-shadow:0 24px 70px #0005;overflow:auto;overscroll-behavior:contain}
#floating-preview-dialog::backdrop{background:#0d1d16b8;backdrop-filter:blur(5px)}
.floating-preview-dialog-heading{position:sticky;top:0;z-index:8;display:flex;align-items:center;justify-content:space-between;gap:14px;padding:15px 20px;border-bottom:1px solid #dfd4be;background:#f8f5edf5}
.floating-preview-dialog-heading h2{margin:0;font:29px/1.1 var(--serif)}
.floating-preview-close{flex:none;min-height:42px;padding:9px 17px;border:1px solid #bba47c;border-radius:25px;background:#fffcf3;color:#304939;font:12px/1.3 var(--sans)}
.floating-preview-dialog-body{padding:19px}
#floating-preview-dialog .editor-preview{position:static;top:auto;min-width:0;display:block;margin:0;padding:0;max-height:none}
#floating-preview-dialog .floating-preview-heading{display:none}
#floating-preview-dialog .preview-faces{width:100%;margin:0 0 15px;min-width:0}
#floating-preview-dialog .preview-faces button{min-height:42px;min-width:0;padding:8px 9px;font-size:12px}
:is(#floating-preview-dialog,#floating-preview-host) .preview-desk{min-height:290px;max-height:none;padding:27px 18px}
:is(#floating-preview-dialog,#floating-preview-host) .preview-desk>.miniature[data-styled]{width:min(92%,430px);max-width:100%;height:auto;min-height:0;max-height:none;--title-base:35px;padding:28px}
:is(#floating-preview-dialog,#floating-preview-host) .preview-desk>.miniature.card-square{width:min(84%,340px);aspect-ratio:1}
:is(#floating-preview-dialog,#floating-preview-host) .preview-desk>.miniature.card-portrait{width:min(70%,290px);aspect-ratio:.72}
:is(#floating-preview-dialog,#floating-preview-host) .message-preview-scroll{max-height:none;overflow:visible}
:is(#floating-preview-dialog,#floating-preview-host) .showing-message{display:block;padding:14px}
:is(#floating-preview-dialog,#floating-preview-host) .recipient-letter.editor-letter-sample{padding:24px 21px}
:is(#floating-preview-dialog,#floating-preview-host) .preview-added-items{max-height:none;overflow:visible}
#floating-preview-dialog .preview-under{display:flex;margin-top:15px}
#floating-preview-dialog .price-box{display:flex}
body.floating-preview-dialog-open{overflow:hidden}
@media(max-width:760px){
 html.has-floating-preview{scroll-padding-top:calc(var(--floating-preview-top,136px) + var(--floating-preview-height,154px) + 16px)}
 body.has-floating-preview #main{padding-top:var(--floating-preview-space,196px)}
 body.has-floating-preview #main :is(input,textarea,select,button,summary,[tabindex]){scroll-margin-top:calc(var(--floating-preview-top,136px) + var(--floating-preview-height,154px) + 16px);scroll-margin-bottom:25px}
 body.has-floating-preview #atelier-header-context:not([hidden]){position:fixed;top:calc(var(--floating-preview-header,94px) + var(--floating-preview-offset,0px));left:0;right:0;height:42px;min-height:42px;z-index:38;padding:4px 13px;display:flex;gap:12px;background:#f5efdf}
 body.has-floating-preview #atelier-header-context .atelier-header-title{display:none}
 body.has-floating-preview #atelier-header-context .atelier-return{font-size:10px;min-height:32px}
 body.has-floating-preview #atelier-header-context .atelier-save{margin-left:auto}
 body.has-floating-preview #atelier-header-context .atelier-save>span{display:none}
 body.has-floating-preview #atelier-header-context .atelier-save button{font-size:10px;padding:5px 10px;min-height:30px}
 body.has-floating-preview #atelier-header-context .atelier-header-price{font-size:20px}
 #floating-preview-host{position:fixed;left:0;right:0;top:var(--floating-preview-top,136px);z-index:37;padding:8px 13px 10px;border-bottom:1px solid #cebc98;background:linear-gradient(125deg,#fffcf4,#f0e8d7);box-shadow:0 9px 25px #283c2920;isolation:isolate;contain:layout}
 #floating-preview-host .editor-preview{position:static;top:auto;display:grid;grid-template-columns:minmax(105px,150px) minmax(0,1fr);grid-template-rows:28px minmax(68px,auto) auto;column-gap:13px;row-gap:5px;min-width:0;margin:0;padding:0}
 #floating-preview-host .floating-preview-heading{grid-column:1/-1;grid-row:1;min-width:0;margin:0;gap:8px}
 #floating-preview-host .floating-preview-heading>span{font-size:9px;color:#586552}
 #floating-preview-host .floating-preview-heading button{min-height:28px;padding:5px 12px;font-size:10px;line-height:1.3}
 #floating-preview-host .preview-faces{grid-column:2;grid-row:2;align-self:start;display:grid;grid-template-columns:1fr 1fr;gap:3px;min-width:0;width:100%;max-width:100%;margin:0;padding:3px;border-radius:12px}
 #floating-preview-host .preview-faces button{width:100%;min-width:0;min-height:31px;padding:5px 3px;font-size:10px;line-height:1.2;border-radius:8px;white-space:normal}
 #floating-preview-host .preview-attachments{grid-column:2;grid-row:3;margin:0;align-self:start;font-size:9px;line-height:1.4}
 #floating-preview-host :is(.preview-under,.price-box,.floating-preview-footer){display:none}
 #floating-preview-dialog{width:calc(100vw - 18px);max-width:calc(100vw - 18px);max-height:calc(var(--floating-preview-vv-height,100dvh) - 16px);border-radius:12px}
 .floating-preview-dialog-heading{padding:11px 12px}
 .floating-preview-dialog-heading h2{font-size:25px}
 .floating-preview-dialog-body{padding:12px}
 #floating-preview-dialog .preview-faces{display:grid;grid-template-columns:1fr 1fr;border-radius:13px}
 #floating-preview-dialog .preview-faces button{min-height:39px;border-radius:9px}
 :is(#floating-preview-dialog,#floating-preview-host) .preview-desk{min-height:220px;padding:20px 10px}
 :is(#floating-preview-dialog,#floating-preview-host) .preview-desk>.miniature[data-styled]{padding:21px;--title-base:30px}
 :is(#floating-preview-dialog,#floating-preview-host) .preview-added-items{gap:8px}
 #floating-preview-dialog .preview-added-item{padding:7px;font-size:10px}
}
@media(prefers-reduced-motion:reduce){#floating-preview-host,#floating-preview-dialog,#floating-preview-host *{scroll-behavior:auto;animation:none!important;transition:none!important}}
.reduced-motion #floating-preview-host,.reduced-motion #floating-preview-dialog,.reduced-motion #floating-preview-host *{scroll-behavior:auto;animation:none!important;transition:none!important}

.floating-preview-viewbutton{display:none}
@media(max-width:760px){#floating-preview-host .preview-desk{position:relative}#floating-preview-host .floating-preview-viewbutton{display:block;position:absolute;inset:0;z-index:10;width:100%;height:100%;border:0;padding:0;border-radius:6px;background:transparent;cursor:zoom-in}#floating-preview-host .floating-preview-viewbutton:focus-visible{outline:2px solid #9a763d;outline-offset:-3px}}

/* The small view is the enlarged desk scaled as one surface. No type is reflowed. */
@media(max-width:760px){
 #floating-preview-host{padding:7px 13px 9px}
 #floating-preview-host .editor-preview{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:28px 164px 34px;row-gap:5px;column-gap:0}
 #floating-preview-host .floating-preview-heading{grid-column:1;grid-row:1}
 #floating-preview-host .preview-faces{grid-column:1;grid-row:3;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;padding:2px;margin:0;width:100%;align-self:stretch}
 #floating-preview-host .preview-faces button{min-height:29px;padding:4px 2px;font-size:10px;white-space:nowrap}
 #floating-preview-host .preview-attachments{display:none}
 #floating-preview-host .floating-preview-viewport{grid-column:1;grid-row:2;position:relative;width:100%;height:164px;min-width:0;overflow:hidden;border-radius:8px}
 #floating-preview-host .floating-preview-viewport>.preview-desk{position:absolute;left:50%;top:50%;width:var(--floating-reference-width,calc(100vw - 44px));max-width:none;height:auto;margin:0;transform:translate(-50%,-50%) scale(var(--floating-surface-scale,.6));transform-origin:50% 50%;overflow:hidden}
 #floating-preview-host .floating-preview-viewport>.showing-message,#floating-preview-host .floating-preview-viewport>.showing-attachments{height:260px;max-height:260px;overflow:hidden}
 #floating-preview-host .floating-preview-viewport .preview-added-item video{pointer-events:none}
 #floating-preview-host .floating-preview-viewport .preview-added-item video::-webkit-media-controls{display:none!important}
}

/* Keep the page geometry stable while Safari positions its keyboard and caret. */
@media(max-width:760px){
 body.floating-preview-typing #floating-preview-host,
 body.floating-preview-typing #atelier-header-context,
 body.floating-preview-typing #site-header{visibility:hidden!important;pointer-events:none!important}
 html.floating-preview-typing{scroll-padding-top:12px;scroll-behavior:auto}
 body.floating-preview-typing #main :is(input,textarea,select,button,summary,[tabindex]){scroll-margin-top:12px;scroll-margin-bottom:12px}
 body.floating-preview-typing .editor-actions.guided-actions{position:static;backdrop-filter:none}
}

/* The preview follows the five creation steps; invitation is inside Couverture. */
.editor-preview .preview-faces{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));width:100%;min-width:0;border-radius:14px}
.editor-preview .preview-faces button{min-width:0;padding:8px 3px;white-space:normal;line-height:1.3}
.preview-subfaces{display:flex;justify-content:center;gap:8px;margin:0 0 10px}
.preview-subfaces button{padding:7px 16px;min-height:36px;border:1px solid #d3c2a2;border-radius:99px;background:transparent;color:#5b6555;font:11px/1.3 var(--sans,Arial,sans-serif)}
.preview-subfaces button[aria-pressed=true]{background:#eee5d3;border-color:#ad8b51;color:#294233}
.preview-subfaces button:focus-visible{outline:2px solid #9a763d;outline-offset:3px}
@media(max-width:760px){
 #floating-preview-host .preview-faces button{font-size:9px;white-space:normal;line-height:1.15}
 #floating-preview-host .preview-subfaces{grid-column:1;grid-row:4;margin:0}
 #floating-preview-host .preview-subfaces button{padding:4px 16px;min-height:30px;font-size:10px}
 #floating-preview-dialog .preview-faces{grid-template-columns:repeat(5,minmax(0,1fr))}
 #floating-preview-dialog .preview-faces button{font-size:10px;padding:7px 2px}
}
