.editor.with-live-preview{width:min(980px,96vw);padding:0;max-height:92svh;background:#f5f5f5;overflow:auto}
.editor.with-live-preview[open]{display:grid;grid-template-columns:minmax(290px,1fr) minmax(300px,1fr);align-items:start}
.with-live-preview #settings{padding:30px;max-height:90svh;overflow:auto;min-width:0}
.live-preview{padding:28px 24px;display:flex;flex-direction:column;align-items:center;background:#e8e8e8;min-height:100%;position:sticky;top:0;--paper-width:290px;--paper-height:435px}
.live-heading{font-size:11px;letter-spacing:2px;color:#777;margin:0 0 20px}
#live-letter.letter{position:relative;left:auto;top:auto;transform:none!important;width:var(--paper-width);height:var(--paper-height);margin:0;cursor:default;touch-action:auto;will-change:auto}
#live-letter::after{content:"";position:absolute;inset:0;z-index:5;pointer-events:none;opacity:.4;mix-blend-mode:multiply;background-image:var(--live-grain);background-size:170px 170px}
.live-photo{margin:20px 0 0;width:90px;padding:6px;background:#fafafa;box-shadow:0 2px 7px #0002}
.live-photo img{display:block;width:100%;height:85px;object-fit:contain;background:#eee}.live-photo figcaption{text-align:center;font-size:9px;color:#777;margin-top:5px}
.stamp-picker{border-top:1px solid #ddd;border-bottom:1px solid #ddd;margin:22px 0 16px;padding:8px 0}
.stamp-picker summary{display:flex;align-items:center;gap:12px;cursor:pointer;list-style:none;font-size:12px}.stamp-picker summary::-webkit-details-marker{display:none}
.stamp-picker #sealPreview{width:48px;height:48px;flex:none}.stamp-summary-text{flex:1}.stamp-disclosure{font-size:10px;color:#777}.stamp-disclosure::after{content:' ＋'}.stamp-picker[open] .stamp-disclosure::after{content:' −'}
.stamp-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding:14px 0 4px}
.stamp-options button{border:1px solid transparent;background:#ededed;padding:7px 3px;border-radius:4px;display:flex;align-items:center;flex-direction:column;gap:5px;min-width:0}
.stamp-options button[aria-pressed=true]{border-color:#777;background:#e0e0e0}.stamp-options svg{width:100%;max-width:66px;height:auto}.stamp-options span{font-size:10px;white-space:nowrap}.stamp-picker .seal-choice{padding-bottom:12px}
@media(max-width:700px){.editor.with-live-preview[open]{display:flex;flex-direction:column}.with-live-preview #settings{order:2;width:100%;padding:20px;max-height:none;overflow:visible}.live-preview{order:1;width:100%;min-height:0;padding:12px;z-index:10;--paper-width:138px;--paper-height:207px;box-shadow:0 3px 10px #0001}.live-heading{margin-bottom:8px;font-size:9px}#live-letter .to,#live-letter .message{font-size:6px;letter-spacing:.3px}#live-letter .to{margin:4px 0}#live-letter .from{font-size:6px;margin:4px 0}#live-letter .brand{font-size:4px;padding-top:3px}.live-photo{position:absolute;right:18px;bottom:15px;width:52px;padding:4px;margin:0}.live-photo img{height:48px}.live-photo figcaption{font-size:7px}}
.live-paper-slot{flex:none}.editor input:focus-visible,.editor textarea:focus-visible,.editor select:focus-visible{outline:1px solid #777;outline-offset:2px}
@media(max-width:700px){.live-preview{flex:0 0 auto}.with-live-preview #settings{flex:0 0 auto}}

.stamp-picker .seal-choice{display:block}
.seal-letter-options{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;margin:10px 0 4px}
.seal-letter-options button{width:100%;max-width:42px;aspect-ratio:1;border:1px solid #d4d4d4;border-radius:50%;background:#ededed;color:#656565;padding:0;justify-self:center;display:grid;place-items:center;font-family:Futura,'Century Gothic',sans-serif;font-size:13px;line-height:1;transition:background .15s,color .15s,border-color .15s}
.seal-letter-options button:hover{background:#dedede;border-color:#aaa}
.seal-letter-options button[aria-checked=true]{background:#505050;border-color:#505050;color:#fff}
.seal-letter-options button:focus-visible{outline:2px solid #777;outline-offset:3px}

/* Keep artwork and writing on the same inner paper edges. */
.letter{padding:calc(var(--paper-width) * .04)}
.letter .flowers{width:100%;height:auto;aspect-ratio:auto;max-height:none;object-fit:contain;margin:0 0 calc(var(--paper-width) * .055)}
.letter .to,#live-letter .to{margin-top:0}

.letter-picker{border-bottom:1px solid #ddd;margin:0 0 20px;padding:0 0 10px}
.letter-picker summary{display:flex;align-items:center;gap:12px;cursor:pointer;list-style:none;font-size:12px;min-height:44px}
.letter-picker summary::-webkit-details-marker{display:none}
.selected-letter{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:#505050;color:#fff;font:12px Futura,'Century Gothic',sans-serif}
.letter-disclosure{margin-left:auto;font-size:10px;color:#777}.letter-disclosure::after{content:' ＋'}.letter-picker[open] .letter-disclosure::after{content:' −'}
.letter-picker .seal-choice{display:block;padding-bottom:4px}
.extra-card-settings{margin:18px 0}.add-extra-card{width:100%;border:1px solid #ccc;border-radius:4px;background:#ededed;padding:14px;font-size:12px;text-align:left}
.extra-kind-buttons{display:grid;grid-template-columns:1fr 1fr;gap:8px}.extra-kind-buttons button{border:1px solid #ddd;border-radius:4px;background:#eee;padding:12px;font-size:12px}.extra-kind-buttons button[aria-pressed=true]{background:#555;color:#fff;border-color:#555}
.extra-card-status{font-size:11px;color:#555}.extra-photo-fields #removePhoto{display:none}
.extra-written-card{flex:1;min-height:0;white-space:pre-wrap;overflow-wrap:anywhere;font-family:'Songti TC','Noto Serif TC',serif;font-size:calc(var(--paper-width) * .043);line-height:1.9;color:#484848;overflow:hidden}
.photo-card.is-text-card{padding:calc(var(--paper-width) * .08);background-color:#f9f9f9}
.live-preview-tabs{display:flex;gap:6px;margin:0 0 14px}.live-preview-tabs button{border:0;border-radius:3px;background:transparent;color:#777;padding:6px 12px;font-size:11px}.live-preview-tabs button[aria-pressed=true]{background:#d4d4d4;color:#333}
.live-extra-card{position:relative;width:var(--paper-width);height:var(--paper-height);background-color:#f9f9f9;padding:calc(var(--paper-width) * .055);box-shadow:0 2px 3px #52525221,0 9px 18px #5252521c;display:flex;flex-direction:column}
.live-extra-card.is-text-card{padding:calc(var(--paper-width) * .08)}.live-extra-card>img{width:100%;height:100%;object-fit:contain;background:#eee}.live-extra-placeholder{font-size:12px;color:#888;margin:auto}
@media(max-width:700px){.live-preview-tabs{margin-bottom:8px}.live-preview-tabs button{font-size:9px;padding:3px 10px}.live-extra-card .extra-written-card{font-size:6px}.live-extra-placeholder{font-size:9px}}
.editor footer{flex-wrap:wrap}.editor .primary{display:inline-flex;align-items:center;justify-content:center;gap:8px}
.gift-result{width:min(470px,92vw);border:1px solid #ddd;border-radius:5px;padding:28px;background:#f5f5f5;color:#484848}.gift-result::backdrop{background:#3338;backdrop-filter:blur(4px)}.gift-result h2{font-size:21px;font-weight:400;display:flex;align-items:center;gap:10px}.gift-result-status{font-size:13px;line-height:1.8}.gift-result label{font-size:12px;display:block;margin:18px 0 8px}.gift-result input{width:100%;border:1px solid #ccc;border-radius:3px;padding:11px;background:#fff;color:#555;font:12px Arial}.share-privacy-note,.local-link-note{font-size:11px;line-height:1.8;color:#777}.gift-result-actions{display:flex;align-items:center;gap:18px;margin-top:18px}.gift-result a{color:inherit;font-size:12px}
/* Localized labels can wrap without changing the card or envelope proportions. */
.stamp-picker summary,.letter-picker summary{min-width:0}
.stamp-picker summary>*,.letter-picker summary>*{min-width:0}
.gift-result-actions{flex-wrap:wrap}
.gift-result-actions button,.gift-result-actions a,.editor-actions button{white-space:normal;overflow-wrap:anywhere}
.extra-kind-buttons button{min-width:0;white-space:normal}
