/* DOUER L2 farewell · single-screen composition
   Based on supplied P01/P02 full-page mockups. Only applies after trial ends.
   All real data and export controls remain DOM, not baked into an image. */
html:has(#app[data-ended]),body:has(#app[data-ended]){
  width:100%;height:100%;margin:0;overflow:hidden!important;overscroll-behavior:none;
}
body:has(#app[data-ended]){background:#f6e9dc!important}
#app[data-ended]{height:100dvh;min-height:0!important;max-height:100dvh;overflow:hidden!important;padding:0!important;}
#app[data-ended] #view{
  height:100dvh;min-height:0!important;max-height:100dvh;overflow:hidden!important;
  padding:0!important;margin:0!important;display:block!important;
}
#app[data-ended] .fw-page{
  position:relative;isolation:isolate;height:100dvh;min-height:0;max-height:100dvh;
  overflow:hidden!important;background:#f6e9dc url('/farewell-desktop.webp') center center / 100% 100% no-repeat;
}
#app[data-ended] .fw-journal{
  position:absolute;z-index:0;top:auto;bottom:9%;left:6.5%;width:min(32vw,475px);
  filter:drop-shadow(0 12px 14px #67513933);
}
#app[data-ended] .fw-shell{
  height:100%;max-width:none;padding:clamp(14px,2.7vh,31px) clamp(34px,5vw,88px)!important;
  margin:0;display:flex!important;flex-direction:column;justify-content:center;
  align-items:flex-end;gap:clamp(5px,1.4vh,15px);position:relative;z-index:1;
}
#app[data-ended] .fw-brand{
  flex:none;grid-column:auto;display:flex;gap:11px;align-items:center;width:min(53%,710px);
  font-size:clamp(17px,2vw,24px);line-height:1.25;margin:0!important;
}
#app[data-ended] .fw-tier{font-size:14px;padding:2px 11px;}
#app[data-ended] .fw-content{
  position:static!important;grid-column:auto;grid-row:auto;flex:none;width:min(53%,710px);
  min-width:0;max-width:none;padding:0!important;margin:0!important;display:flex!important;
  flex-direction:column;gap:clamp(6px,1.4vh,16px);align-content:stretch;justify-content:flex-start;
}
#app[data-ended] .fw-hero{padding:0;margin:0;flex:none;}
#app[data-ended] .fw-kicker{font-size:10px;margin:0 0 3px;}
#app[data-ended] .fw-hero h2{
  font-size:clamp(28px,3.2vw,43px);line-height:1.2;letter-spacing:.03em;
  margin:0 0 5px;
}
#app[data-ended] .fw-hero h2:after{height:2px;margin-top:6px;width:100px;}
#app[data-ended] .fw-hero p{font-size:clamp(12px,1.2vw,15px);line-height:1.55;}
#app[data-ended] .fw-panel{border-radius:22px;box-shadow:0 6px 24px #61412a15;}
#app[data-ended] .fw-memories{padding:clamp(10px,1.4vh,20px) clamp(14px,1.8vw,26px);}
#app[data-ended] .fw-memories h3{font-size:clamp(16px,1.65vw,22px);padding-bottom:clamp(5px,.9vh,11px);}
#app[data-ended] .fw-stats{padding-top:clamp(6px,.95vh,12px);}
#app[data-ended] .fw-stat{gap:clamp(2px,.45vh,5px);padding:0 5px;}
#app[data-ended] .fw-stat .fw-icon{width:clamp(18px,1.9vw,26px);height:clamp(18px,1.9vw,26px);}
#app[data-ended] .fw-stat span{font-size:clamp(10px,.95vw,12px);}
#app[data-ended] .fw-stat strong{font-size:clamp(15px,1.65vw,20px);}
#app[data-ended] .fw-export-wrap{margin:0;flex:none;}
#app[data-ended] .fw-export{
  min-height:clamp(45px,6.5vh,65px);padding:7px 15px;
  font-size:clamp(14px,1.5vw,18px);box-shadow:0 5px 13px #40563722;
}
#app[data-ended] .fw-export .fw-icon{width:clamp(19px,2vw,25px);height:clamp(19px,2vw,25px);}
#app[data-ended] .fw-export-wrap p{font-size:11px;line-height:1.45;margin:clamp(3px,.55vh,7px) 0 0;}
#app[data-ended] .fw-purchase{padding:clamp(9px,1.3vh,18px) clamp(14px,1.8vw,25px);}
#app[data-ended] .fw-purchase>small{font-size:10px;line-height:1.3;margin-bottom:2px;}
#app[data-ended] .fw-purchase h3{font-size:clamp(16px,1.5vw,20px);margin-bottom:4px;line-height:1.35;}
#app[data-ended] .fw-purchase p{font-size:clamp(11px,1vw,13px);line-height:1.45;margin:0;}
#app[data-ended] .fw-prices{gap:clamp(10px,1.5vw,23px);margin-top:5px;font-size:clamp(11px,1.1vw,14px);}
#app[data-ended] .fw-prices b{font-size:clamp(14px,1.4vw,18px);}
#app[data-ended] .fw-purchase .fw-api-note{font-size:10px;margin-top:3px;line-height:1.45;}
#app[data-ended] .fw-actions{gap:3px;flex:none;margin:0;}
#app[data-ended] .fw-contact{min-height:clamp(40px,5.9vh,54px);font-size:clamp(14px,1.45vw,17px);}
#app[data-ended] .fw-actions small{font-size:11px;}
#app[data-ended] .fw-code{margin:0;flex:none;font-size:12px;}
#app[data-ended] .fw-code summary{min-height:23px;padding:2px 8px;}
#app[data-ended] .fw-sign{padding:0;margin:0;font-size:11px;flex:none;}
/* Show renewed-code input on demand: it may extend beyond the canvas, so let it scroll only then. */
html:has(#app[data-ended] .fw-code[open]),body:has(#app[data-ended] .fw-code[open]),
#app[data-ended]:has(.fw-code[open]),#app[data-ended]:has(.fw-code[open]) #view,
#app[data-ended] .fw-page:has(.fw-code[open]){overflow-y:auto!important;max-height:none!important;}
#app[data-ended] .fw-page:has(.fw-code[open]) .fw-shell{min-height:100dvh;height:auto;}

/* Tablet and mobile use one shared full-viewport illustration, compact overlay below it. */
@media(max-width:1120px){
  #app[data-ended] .fw-page{
    background:#f6e9dc url('/farewell-mobile.webp') center top / 100% 100% no-repeat;
  }
  #app[data-ended] .fw-journal{
    top:13%;bottom:auto;left:17%;width:min(56vw,455px);height:auto;
  }
  #app[data-ended] .fw-shell{
    display:block!important;position:relative;height:100%;width:100%;padding:0!important;
  }
  #app[data-ended] .fw-brand{
    position:absolute;z-index:2;top:clamp(9px,1.9vh,25px);left:max(14px,calc((100vw - 650px)/2));
    width:auto;display:inline-flex;gap:7px;font-size:16px;padding:5px 12px;
    background:#fffcf3d9;border-radius:999px;box-shadow:0 3px 10px #55443314;
  }
  #app[data-ended] .fw-brand small{display:none;}
  #app[data-ended] .fw-tier{font-size:12px;padding:2px 8px;}
  #app[data-ended] .fw-content{
    position:absolute!important;left:max(14px,calc((100vw - 650px)/2));right:max(14px,calc((100vw - 650px)/2));
    top:clamp(235px,38vh,475px);bottom:clamp(8px,1vh,15px);
    width:auto;max-width:none;display:flex!important;flex-direction:column;
    justify-content:space-between;gap:3px;margin:0!important;padding:0!important;
  }
  #app[data-ended] .fw-hero h2{font-size:clamp(24px,3.5vw,36px);margin-bottom:2px;line-height:1.18;}
  #app[data-ended] .fw-hero h2:after{margin-top:4px;width:75px;}
  #app[data-ended] .fw-kicker{font-size:9px;margin-bottom:2px;}
  #app[data-ended] .fw-hero p{font-size:clamp(11px,1.4vw,14px);line-height:1.45;}
  #app[data-ended] .fw-panel{border-radius:18px;}
  #app[data-ended] .fw-memories{padding:9px 12px 10px;}
  #app[data-ended] .fw-memories h3{font-size:17px;padding-bottom:5px;}
  #app[data-ended] .fw-stats{padding-top:6px;}
  #app[data-ended] .fw-stat{gap:2px;padding:0 3px;}
  #app[data-ended] .fw-stat .fw-icon{width:19px;height:19px;}
  #app[data-ended] .fw-stat span{font-size:10px;}
  #app[data-ended] .fw-stat strong{font-size:15px;line-height:1.2;}
  #app[data-ended] .fw-export{min-height:clamp(43px,5vh,55px);font-size:14px;padding:7px;}
  #app[data-ended] .fw-export .fw-icon{width:18px;height:18px;}
  #app[data-ended] .fw-export-wrap p{font-size:10px;margin:3px 0 0;line-height:1.3;}
  #app[data-ended] .fw-purchase{padding:9px 12px 10px;}
  #app[data-ended] .fw-purchase>small{font-size:10px;margin:0 0 2px;}
  #app[data-ended] .fw-purchase h3{font-size:16px;margin:0 0 3px;}
  #app[data-ended] .fw-purchase p{font-size:11px;line-height:1.3;}
  #app[data-ended] .fw-prices{font-size:11px;gap:12px;margin-top:3px;}
  #app[data-ended] .fw-prices b{font-size:15px;}
  #app[data-ended] .fw-purchase .fw-api-note{font-size:10px;margin-top:2px;}
  #app[data-ended] .fw-contact{min-height:40px;font-size:14px;}
  #app[data-ended] .fw-actions small{font-size:10px;}
  #app[data-ended] .fw-code{font-size:11px;}
  #app[data-ended] .fw-code summary{min-height:19px;padding:0 6px;}
  #app[data-ended] .fw-sign{font-size:10px;}
}
/* Short mobile screens: leave legibility rather than hiding the backup control. */
@media(max-width:420px){
  #app[data-ended] .fw-content{
    top:clamp(218px,36.3vh,315px);left:15px;right:15px;bottom:7px;
  }
  #app[data-ended] .fw-journal{top:15%;left:17%;width:53%;}
  #app[data-ended] .fw-hero h2{font-size:24px;}
  #app[data-ended] .fw-hero p{font-size:11.5px;}
  #app[data-ended] .fw-memories{padding:8px 9px;}
  #app[data-ended] .fw-memories h3{font-size:16px;padding-bottom:4px;}
  #app[data-ended] .fw-stat .fw-icon{width:18px;height:18px;}
  #app[data-ended] .fw-stat span{font-size:9px;}
  #app[data-ended] .fw-stat strong{font-size:14px;}
  #app[data-ended] .fw-export{min-height:42px;font-size:13px;}
  #app[data-ended] .fw-purchase{padding:8px 10px;}
  #app[data-ended] .fw-purchase h3{font-size:14px;}
  #app[data-ended] .fw-prices b{font-size:14px;}
  #app[data-ended] .fw-contact{min-height:38px;}
}
/* Extremely short viewports / zoom: let users reach controls instead of clipping data export. */
@media(max-height:650px){
  html:has(#app[data-ended]),body:has(#app[data-ended]),
  #app[data-ended],#app[data-ended] #view,#app[data-ended] .fw-page{overflow-y:auto!important;max-height:none!important;}
  #app[data-ended] .fw-page{min-height:100dvh;height:auto;}
  #app[data-ended] .fw-shell{min-height:100dvh;height:auto;}
  #app[data-ended] .fw-content{position:relative!important;top:auto;bottom:auto;margin-top:35vh!important;padding-bottom:16px!important;}
}
@media(prefers-reduced-motion:reduce){#app[data-ended] *{animation:none!important;transition:none!important;}}

/* Thank-you offer + WeChat contact (compact, inside the existing purchase card). */
#app[data-ended] .fw-prices s{opacity:.55;font-size:.88em;}
#app[data-ended] .fw-offer{gap:4px 14px;}
#app[data-ended] .fw-purchase .fw-offer-note{font-size:clamp(10px,.95vw,12px);color:#607f5d;margin-top:3px;line-height:1.4;}
#app[data-ended] .fw-voucher{letter-spacing:.06em;user-select:all;white-space:nowrap;}
#app[data-ended] button.fw-contact{width:100%;font:inherit;font-weight:600;cursor:pointer;}
@media(max-width:420px){
  #app[data-ended] .fw-content:has(.fw-offer){top:clamp(196px,32.5vh,300px);}
  #app[data-ended] .fw-purchase:has(.fw-offer) h3{display:none;}
  #app[data-ended] .fw-purchase:has(.fw-offer)>small{font-size:12px;font-weight:600;color:#607f5d;}
  #app[data-ended] .fw-offer{font-size:11px;}
  #app[data-ended] .fw-purchase .fw-offer-note{font-size:10.5px;margin-top:2px;}
}
