/* V22: editorial stationery, finite animations and responsive media. */
#modal .panel,#welcome .panel{width:min(100%,520px);max-height:94vh;max-height:94dvh;padding:32px clamp(19px,5vw,37px) 26px;border-radius:22px;overscroll-behavior:contain;scrollbar-gutter:stable}
#modal .panel:before,#welcome .panel:before{inset:8px;border-radius:16px}
#modal .close{z-index:5;width:44px;height:44px;border-radius:50%;background:#fff8eb;color:#75475b;box-shadow:0 2px 9px #56334413}
#modal .close:hover{background:#f0dfd0}
#modal .gg-v22-art{width:min(240px,70%);height:auto;margin:0 auto 5px;color:var(--gg-accent)}
#modal .gg-v22-art svg{width:100%;height:auto;overflow:visible}
.gg-v22-paper{transform:translateY(-7px)}
.gg-v22-frontflap,.gg-v22-wax{opacity:0}
.gg-v22-backflap{transform-origin:120px 56px}
.gg-v22-meta{color:#8a6857;font:600 10px/1.5 system-ui;letter-spacing:1.4px;text-transform:uppercase;margin:5px 0 10px}
#modal .seal{width:42px;height:42px;font-size:23px;margin:9px auto 10px}
#modal #kicker{font:600 10px/1.5 system-ui;letter-spacing:2px}
#modal #letterTitle{font-size:clamp(29px,7vw,39px);line-height:1.14;text-wrap:balance;margin:12px 0 21px}
#modal .letter-text{font-size:clamp(16px,4vw,18px);line-height:1.8;letter-spacing:.05px}
#modal[data-gg-available=true] .letter-text:first-letter{float:left;font-size:2.7em;line-height:.92;margin:6px 5px 0 0;color:var(--gg-accent)}
#modal .extra{padding:16px 17px;border-radius:11px;font-size:15px;line-height:1.65}
#modal .signature{padding-top:6px;margin:20px 0}
.gg-v22-actions{display:grid;gap:8px;margin-top:12px}
.gg-v22-actions .btn{margin:0;border-radius:12px;min-height:48px}
#modal[data-gg-entry=true].show .panel,#welcome[data-gg-entry=true].show .panel{animation:gg22Panel .36s cubic-bezier(.18,.75,.2,1) both}
#modal[data-gg-opening=true].show .gg-v22-envelope{animation:gg22Envelope .7s cubic-bezier(.18,.75,.2,1) both}
#modal[data-gg-opening=true].show .gg-v22-frontflap{animation:gg22Flap .56s .12s ease-in-out both;transform-origin:120px 56px}
#modal[data-gg-opening=true].show .gg-v22-wax{animation:gg22Wax .34s .08s ease-out both;transform-origin:120px 104px}
#modal[data-gg-opening=true].show .gg-v22-paper{animation:gg22Paper .65s .28s cubic-bezier(.18,.8,.25,1) both}
#modal[data-gg-opening=true].show .gg-v22-sparkles{animation:gg22Sparkle .8s .3s ease-out both}
#modal[data-gg-opening=true].show :is(.gg-v22-meta,#symbol,#kicker,#letterTitle,#message,#extra,#sign){animation:gg22Text .42s ease-out both}
#modal[data-gg-opening=true].show :is(#symbol,#kicker){animation-delay:.13s}
#modal[data-gg-opening=true].show #letterTitle{animation-delay:.22s}
#modal[data-gg-opening=true].show #message{animation-delay:.31s}
#modal[data-gg-opening=true].show #extra{animation-delay:.38s}
@keyframes gg22Panel{from{opacity:0;transform:translateY(12px) scale(.985)}to{opacity:1;transform:none}}
@keyframes gg22Envelope{from{opacity:0;transform:translateY(10px) rotate(-3deg)}to{opacity:1;transform:none}}
@keyframes gg22Flap{0%{opacity:1;transform:scaleY(1)}55%{opacity:.9;transform:scaleY(.08)}100%{opacity:0;transform:scaleY(.08)}}
@keyframes gg22Wax{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:translateY(7px) scale(.4)}}
@keyframes gg22Paper{from{transform:translateY(36px)}to{transform:translateY(-7px)}}
@keyframes gg22Sparkle{0%{opacity:0}55%{opacity:1}100%{opacity:.7}}
@keyframes gg22Text{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
.gg-v22-welcome .panel{background:radial-gradient(ellipse at 50% 0,#fffdf3,#f7e6d5);padding-top:34px}
.gg-v22-welcome-stamp{width:86px;height:86px;border:1px solid #bb8a79;outline:1px dashed #d1ac8c;outline-offset:5px;border-radius:50%;display:grid;place-content:center;grid-auto-flow:column;gap:6px;margin:10px auto 26px;color:#986073;font:24px Georgia,serif}
.gg-v22-welcome-stamp span{color:#b66b82}
#welcome[data-gg-entry=true].show .gg-v22-welcome-stamp{animation:gg22Panel .6s ease-out both}
#welcome .panel h2{text-wrap:balance;font-size:clamp(31px,7vw,41px)}
#welcome .panel p{max-width:32ch;margin:12px auto 20px}
#modal .experience{padding:18px 13px;border-radius:17px}
#modal .v6-stage{border:1px solid #d4a88d66}
#modal .xp-choice{min-height:46px;line-height:1.4}
#modal .xp-choice:focus-visible,#modal .btn:focus-visible,#modal .close:focus-visible{outline:2px solid #94667a;outline-offset:3px}
#modal .media-zone{gap:15px}
#modal .gg-v22-photo{background:#fffdf7;border-radius:13px;padding:9px 9px 13px;overflow:hidden}
#modal .gg-v22-photo img{max-height:440px;object-fit:contain;border-radius:8px;background:#f2e8df}
#modal .gg-v22-photo[data-error=true]::before{content:'Este recuerdo no pudo cargarse.';display:block;padding:18px;color:#815f6a;font:13px system-ui}
#modal .gg-v22-photo figcaption{font:italic 15px/1.5 Georgia,serif;padding:12px 5px 2px}
#modal .grace-video-card{padding:15px;text-align:left;background:#f8ebdf;border-radius:13px}
.gg-v22-media-label{font:600 9px/1.5 system-ui;letter-spacing:1.6px;color:#9a6c61}
#modal .grace-video-card figcaption{font-size:17px;padding:5px 0 10px}
#modal .grace-video-card video{width:100%;max-height:65dvh;border-radius:9px;background:#302731;object-fit:contain}
#modal .grace-video-card [hidden]{display:none!important}
#modal .gg-v22-video-play{background:#694158;color:#fff7e9}
#modal .voice-note{position:relative;padding:15px;background:#f1e3dc;border-color:#dfc0b1;border-radius:13px}
.gg-v22-voice-icon{float:left;margin-right:10px;width:32px;height:32px;display:grid;place-items:center;border-radius:50%;background:#a66d82;color:#fff4e4;font-size:20px}
#modal .voice-note strong{font-size:13px;margin:2px 0 4px}
.gg-v22-media-note{font:12px/1.4 system-ui;color:#805f69;margin:0 0 14px}
#modal .voice-note audio{clear:both}
#modal .gg-v22-song{border:1px solid #e0c6b5;border-radius:12px}
.gg-v22-chapter{background:radial-gradient(ellipse at 50% 30%,#93677b,#49334e);padding:0;overflow:hidden}
.gg-v22-chapter svg{max-width:none;width:100%;height:auto}
.gg-v22-chapter[data-theme="26"],.gg-v22-chapter[data-theme="28"],.gg-v22-chapter[data-theme="30"]{background:linear-gradient(145deg,#efc8b7,#f7e7c6)}
.gg-v22-chapter[data-theme="29"]{background:linear-gradient(#34384f,#75657d)}
.gg22-reveal,.gg22-lantern,.gg22-bus,.gg22-person-a,.gg22-person-b,.gg22-hug-heart,.gg22-fireworks{transform-box:fill-box;transform-origin:center}
.gg22-hug-heart{opacity:.15}
.gg-mini-on .gg22-reveal{animation:gg22Reveal .8s ease-out both}
.gg-mini-on .gg22-lantern{animation:gg22Lantern 1.2s ease-out both}
.gg-mini-on .gg22-bus{animation:gg22Bus 2.1s cubic-bezier(.2,.65,.25,1) both}
.gg-mini-on .gg22-wheel{transform-box:fill-box;transform-origin:center;animation:gg22Wheel 2.1s linear both}
.gg-mini-on .gg22-person-a{animation:gg22HugA .9s ease-out both}
.gg-mini-on .gg22-person-b{animation:gg22HugB .9s ease-out both}
.gg-mini-on .gg22-hug-heart{animation:gg22Heart .7s .55s ease-out both}
.gg-mini-on .gg22-fireworks{animation:gg22Reveal .8s ease-out 2}
@keyframes gg22Reveal{0%{opacity:.55;scale:.85}55%{opacity:1;scale:1.1}100%{opacity:1;scale:1}}
@keyframes gg22Lantern{from{translate:0 0}to{translate:0 -25px}}
@keyframes gg22Bus{from{translate:0 0}to{translate:105px 0}}
@keyframes gg22Wheel{to{rotate:540deg}}
@keyframes gg22HugA{from{translate:0 0;rotate:0deg}to{translate:34px 0;rotate:5deg}}
@keyframes gg22HugB{from{translate:0 0;rotate:0deg}to{translate:-34px 0;rotate:-5deg}}
@keyframes gg22Heart{from{opacity:.15;scale:.8}to{opacity:1;scale:1.18}}
.gg-mini-on .gg22-lantern{translate:0 -25px}
.gg-mini-on .gg22-bus{translate:105px 0}
.gg-mini-on .gg22-person-a{translate:34px 0;rotate:5deg}
.gg-mini-on .gg22-person-b{translate:-34px 0;rotate:-5deg}
.gg-mini-on .gg22-hug-heart{opacity:1}
.gg-v22-recap{border-top:1px solid #dfc7b5;margin-top:18px;padding-top:12px}
.gg-v22-recap-days{display:grid;grid-template-columns:repeat(auto-fit,minmax(44px,1fr));gap:6px}
.gg-v22-recap-day{background:#fff7ea;border:1px solid #d9b6a6;color:#7b4157;min-height:44px;border-radius:9px}
#modal .panel [hidden],#welcome .panel [hidden]{display:none!important}
body.sleeping #modal *,body.sleeping #welcome *{animation-play-state:paused!important}
body[data-gg-motion=soft] #modal .gg-v22-art *,body[data-gg-motion=soft] #modal[data-gg-opening=true].show :is(#message,#extra,#letterTitle){animation-duration:.25s!important;animation-delay:0s!important}
@media(max-width:480px){#modal,#welcome{padding:9px}#modal .panel,#welcome .panel{max-height:96vh;max-height:96dvh;padding-top:30px}#modal .gg-v22-art{width:190px;max-width:65%}#modal .letter-text{line-height:1.73}#modal .experience{padding:15px 10px}}
@media(prefers-reduced-motion:reduce){#modal *,#welcome *{animation:none!important;transition:none!important}}

#modal .v6-stage[data-gg-steps]::after{content:attr(data-gg-done) " / " attr(data-gg-steps);position:absolute;right:8px;bottom:8px;background:#392839cc;color:#fff4e3;border-radius:12px;padding:4px 8px;font:10px system-ui;pointer-events:none}
.gg-v22-chapter[data-step="1"] .gg22-reveal{animation:gg22Reveal .45s ease-out both}
