/* Optical polish across the finite engines. Editing tokens still win. */
/* Edge decoration lives outside the copy, so long cards keep a clear center. */
.invitation:has(>.invite-theme-border){position:relative;isolation:isolate;outline:1px solid color-mix(in srgb,var(--theme-secondary) 35%,transparent);outline-offset:-10px}
.invite-theme-border{position:absolute;inset:0;z-index:2;pointer-events:none;overflow:hidden;border-radius:inherit}
.theme-border-top,.theme-border-bottom{position:absolute;left:0;width:100%;line-height:0}
.theme-border-top{top:0}.theme-border-bottom{bottom:0;transform:rotate(180deg)}
.invite-theme-border svg{display:block;width:100%;height:auto}
.invitation:has(>.invite-theme-border)>.invite-copy{position:relative;z-index:3;padding-top:max(62px,10cqw)!important;padding-bottom:max(62px,10cqw)!important}
.invitation:has(>.invite-theme-border)>.invite-art,.invitation:has(>.invite-theme-border)>.invite-description,.invitation:has(>.invite-theme-border)>.invite-extra{position:relative;z-index:1}
.invitation:has(>.invite-theme-border)>.invite-symbol{display:none}
.birthday-theme-controls{margin:18px 0 24px}
.invitation .invite-title {text-wrap:balance;overflow-wrap:break-word}
.invitation .invite-honoree {text-wrap:pretty}
.invitation .invite-meta {font-variant-numeric:tabular-nums;line-height:1.6}
.invitation.custom-theme .invite-eyebrow {letter-spacing:.19em;line-height:1.6}
.invitation[class*="layer-titleTypeface-"]:not(.layer-titleTypeface-layout) .invite-eyebrow {font-size:11px!important;font-weight:650}
.invitation.layer-heroVisibility-none .invite-copy {padding:clamp(32px,7cqw,64px)}
.invitation.layer-heroVisibility-none .invite-copy::before {content:"";display:block;width:42px;height:1px;background:var(--theme-accent);margin:0 auto 24px;opacity:.7}
.invitation.layer-heroVisibility-none.layer-textAlign-left .invite-copy::before {margin-left:0}
.invitation.layer-heroVisibility-none.layer-textAlign-right .invite-copy::before {margin-right:0}
.invitation.layout-type-led .invite-title {max-width:14ch;margin-inline:auto}
.invitation.layout-statement-poster .invite-eyebrow {border-bottom:1px solid var(--theme-secondary);padding-bottom:14px}
.invitation.layout-gallery-column .invite-copy {border-top:1px solid var(--theme-secondary)}
.invitation.layout-arched-card.layer-imagePosition-layout .invite-art img {object-position:center}
.invitation.layout-classic-card .invite-meta {border-top:1px solid var(--theme-secondary);padding-top:18px}
.invitation.layout-feature-story .invite-eyebrow {font-family:Georgia,serif;text-transform:none;letter-spacing:.06em;font-style:italic}

/* Themed envelope atmosphere is decorative and never intercepts controls. */
.envelope-atmosphere {position:absolute;inset:0;overflow:hidden;pointer-events:none}
.envelope-atmosphere span {position:absolute;left:var(--position);top:calc(12% + var(--particle)*5%);font-size:clamp(14px,3vw,32px);color:var(--opening-spark,#b4a078);opacity:.5;transform:rotate(calc(var(--particle)*27deg))}
.envelope-overlay.opening .envelope-atmosphere span {animation:envelope-flourish 1.4s ease-out both;animation-delay:calc(var(--particle)*.025s)}
@keyframes envelope-flourish {0%{opacity:.5}55%{opacity:.9;transform:translateY(-45px) rotate(35deg) scale(1.25)}100%{opacity:0;transform:translateY(85px) rotate(70deg)}}
.envelope-style-evergreen {background:radial-gradient(ellipse at center,#254f3e,#0d2b23);--opening-spark:#f9d596}
.envelope-style-evergreen .envelope-intro,.envelope-style-evergreen .envelope-hint,.envelope-style-starlight .envelope-intro,.envelope-style-starlight .envelope-hint {color:#fff2d6}
.envelope-style-evergreen .envelope-back {background:#163d30;border-color:#bf9f67}
.envelope-style-evergreen .envelope-front {background:linear-gradient(148deg,transparent 49.8%,#285840 50%) 0 0/50% 100% no-repeat,linear-gradient(212deg,transparent 49.8%,#204c38 50%) 100% 0/50% 100% no-repeat}
.envelope-style-evergreen .envelope-flap {background:#38634a}
.envelope-style-evergreen .envelope-address {color:#fff2d6}
.envelope-style-evergreen .envelope-skip,.envelope-style-starlight .envelope-skip {color:#fff2d6}
.envelope-style-evergreen .envelope-seal {background:#b2925e;color:#182b20;border-color:#f2d491}
.envelope-tree {position:absolute;bottom:-10px;width:clamp(110px,24vw,280px);height:45%;background:linear-gradient(#588366,#163e2e);clip-path:polygon(50% 0,75% 30%,65% 30%,90% 65%,75% 65%,100% 95%,57% 95%,57% 100%,43% 100%,43% 95%,0 95%,25% 65%,10% 65%,35% 30%,25% 30%);opacity:.6}
.tree-left {left:2%}.tree-right {right:2%;height:33%}
.envelope-light-string {position:absolute;left:-5%;right:-5%;top:8%;height:12%;border-bottom:2px dotted #f6dfa4;border-radius:0 0 50% 50%;filter:drop-shadow(0 0 6px #fbd178)}
.envelope-style-snowfall {background:radial-gradient(ellipse at center,#e9f1f4,#9db6ca);--opening-spark:#fff}
.envelope-style-snowfall .envelope-back {background:#ccdae2;border-color:#99b2c5}
.envelope-style-snowfall .envelope-flap {background:#eff7fa}
.envelope-style-botanical {background:radial-gradient(ellipse at center,#f5f2e5,#c6d9c0);--opening-spark:#61866a}
.envelope-style-botanical .envelope-back {background:#dfe8d8;border-color:#97b09a}
.envelope-style-botanical .envelope-flap {background:#eff2e4}
.envelope-style-botanical .envelope-seal {background:#47745a;border-color:#6b8c6d;color:#fff7e5}
.envelope-style-celebration {background:radial-gradient(ellipse at center,#fff2d5,#f3c4b4);--opening-spark:#bb5168}
.envelope-style-celebration .envelope-back {background:#f6d8cc;border-color:#d4a295}
.envelope-style-celebration .envelope-flap {background:#fff0df}
.envelope-style-starlight {background:radial-gradient(ellipse at center,#334150,#101e2b);--opening-spark:#ecd58d}
.envelope-style-starlight .envelope-back {background:#35434d;border-color:#b59e63}
.envelope-style-starlight .envelope-front {background:linear-gradient(148deg,transparent 49.8%,#35434d 50%) 0 0/50% 100% no-repeat,linear-gradient(212deg,transparent 49.8%,#2b3b46 50%) 100% 0/50% 100% no-repeat}
.envelope-style-starlight .envelope-flap {background:#4d5b63}
.envelope-style-starlight .envelope-address {color:#fff2d6}
.envelope-style-starlight .envelope-seal {background:#e1c27a;color:#223645;border-color:#fff0b9}
@media(prefers-reduced-motion:reduce) {.envelope-atmosphere span{animation:none!important}.envelope-atmosphere{display:none}}
