/* V19: original classic v17 surfaces; pink ONLY page and tree background. */
html,body{background:#EBD8D2}
#gift-opening-notice{position:absolute;left:16px;right:16px;top:calc(50% + 280px);font-size:18px;color:#8A6965;text-align:center;pointer-events:none}html:not([data-gift-phase=closed]) #gift-opening-notice{display:none}
:focus-visible{outline:3px solid #40534A!important;outline-offset:3px}
@media(max-width:750px){#gift-opening-notice{top:calc(50% + 190px);font-size:16px}}
/* Existing joined book, with an accessible expanded view of its LEFT inside face. */
#gift-stage .gift-inside-art,.gift-calendar-lid::after{display:none!important}
#tree-navigation{display:none;position:absolute;top:14px;left:128px;z-index:10;gap:8px}
html[data-gift-phase=unfolded] #tree-navigation{display:flex}
#tree-navigation button{min-width:100px;min-height:44px;border:1px solid #C99F87;border-radius:24px;background:#F7EDE7;color:#40534A;padding:8px 18px}
#tree-tab[aria-expanded=true],#calendar-tab[aria-pressed=true]{background:#40534A;color:#F7EDE7}
#tree-panel{position:relative;display:flex;flex-direction:column;align-items:stretch;height:100%;min-height:0;padding:18px 18px 12px;color:#40534A;transform:translateZ(2px);text-align:left}
#tree-panel header{display:flex;justify-content:space-between;align-items:center;gap:8px}#tree-title{font-size:24px;margin:0}#tree-count{font-size:13px;color:#8A6965;white-space:nowrap}
#tree-help,#tree-empty,#tree-status{font-size:12px;line-height:1.45;margin:6px 0;color:#8A6965}#tree-collection-title{font-size:15px;margin:8px 0 5px}
#tree-board{position:relative;aspect-ratio:360/440;max-height:420px;min-height:180px;width:100%;flex:1;align-self:center;max-width:340px;overflow:visible;touch-action:pan-y}
#tree-board>svg{position:absolute;inset:0;width:100%;height:100%}#tree-ornaments{position:absolute;inset:0;pointer-events:none}
#tree-board [data-placed-day]{position:absolute;width:clamp(44px,15%,56px);height:44px;padding:3px;border:0;background:transparent;transform:translate(-50%,-50%);pointer-events:auto;touch-action:none;border-radius:12px;cursor:grab;filter:drop-shadow(0 2px 1px #40534A33)}
#tree-board img{display:block;object-fit:contain;width:100%;height:100%;pointer-events:none;user-select:none;filter:drop-shadow(1px 0 #F7EDE7) drop-shadow(-1px 0 #F7EDE7) drop-shadow(0 1px #F7EDE7)}
#tree-board [aria-pressed=true]{outline:2px dashed #C99F87;outline-offset:2px}#tree-board.has-selection{cursor:crosshair}
#tree-collection{display:flex;gap:7px;flex-wrap:wrap;max-height:110px;overflow:auto;min-height:0;padding:3px}
#tree-collection button{width:50px;height:50px;min-height:44px;flex:none;background:#F7EDE7;border:1px solid #C99F87;border-radius:12px;padding:5px}
#tree-collection button[aria-pressed=true]{background:#C99F87;outline:2px solid #40534A;outline-offset:1px}#tree-collection img{width:100%;height:100%;object-fit:contain;pointer-events:none}
html:is([data-gift-phase=unfolded],[data-gift-phase=unfolding],[data-gift-phase=closing]) #gift-stage #gift-book-spread{width:min(1220px,calc(100vw - 64px),calc((100dvh - 215px)*1.20));padding-top:0;transition:grid-template-columns .35s ease;grid-template-columns:minmax(0,1fr) minmax(0,4fr);align-items:stretch}
html[data-gift-phase=unfolded] #gift-stage .gift-calendar-lid{pointer-events:auto;background:#EBD8D2;border-color:#C99F87;box-shadow:inset -4px 0 8px #8A696522,-4px 6px 0 #8A696533;overflow:hidden;min-height:0}
html[data-gift-phase=unfolded][data-gift-pane=tree] #gift-stage #gift-book-spread{grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);width:min(1220px,calc(100vw - 64px));max-height:calc(100dvh - 150px);height:min(690px,calc(100dvh - 150px));grid-template-rows:minmax(0,1fr)}
html[data-gift-phase=unfolded][data-gift-pane=tree] #gift-stage .gift-calendar-lid{transform:none;transition:transform .35s ease}
html[data-gift-phase=unfolded][data-gift-pane=tree] #gift-stage .calendar-section{align-self:stretch;display:flex!important;flex-direction:column;justify-content:center}
html[data-gift-pane=calendar] #tree-panel{padding:8px;justify-content:center;pointer-events:none}
html[data-gift-pane=calendar] #tree-panel>:not(#tree-board){display:none}
html[data-gift-pane=calendar] #tree-board{min-height:100px;max-height:280px;flex:none}
html[data-gift-pane=calendar] #tree-ornaments button{pointer-events:none}
#gift-stage #doors .door{min-width:44px;min-height:44px}
@media(max-width:900px) and (min-width:651px){#tree-panel{padding:12px}#tree-title{font-size:20px}#tree-help,#tree-status{font-size:11px}html[data-gift-phase=unfolded][data-gift-pane=tree] #gift-stage #gift-book-spread{width:calc(100vw - 32px)}#gift-stage .calendar-section{padding:8px 6px}#gift-stage #doors{gap:4px}}
@media(max-width:650px){
 #tree-navigation{left:12px;top:68px;gap:6px}#tree-navigation button{min-width:92px;padding:8px 12px;font-size:13px}
 html[data-gift-phase=unfolded] #gift-stage #gift-book-spread{width:calc(100vw - 24px);padding-top:42px;display:block!important}
 html[data-gift-phase=unfolded] #gift-stage .gift-calendar-lid{height:42px;position:absolute;top:0;width:40%;transform:rotateX(-45deg)}
 html[data-gift-pane=calendar] #tree-panel{visibility:hidden}
 html[data-gift-phase=unfolded][data-gift-pane=tree] #gift-stage #gift-book-spread{width:calc(100vw - 24px);padding-top:0;max-height:calc(100dvh - 134px)}
 html[data-gift-phase=unfolded][data-gift-pane=tree] #gift-stage .gift-calendar-lid{position:relative;width:100%;height:min(670px,calc(100dvh - 146px));transform:none;border-radius:8px}
 html[data-gift-phase=unfolded][data-gift-pane=tree] #gift-stage .calendar-section{display:none!important}
 #tree-panel{padding:12px 16px}#tree-title{font-size:22px}#tree-board{max-width:290px;max-height:360px}#tree-help{font-size:12px}#tree-status{font-size:11px}
 #gift-stage #doors .door-date{font-size:13px}
}
.toast{bottom:86px;background:#40534A;color:#F7EDE7}
#gift-stage #doors .done-mark{transform:none;left:2px;right:2px;background:#F7EDE7;color:#40534A;border-color:#C99F87}
@media(prefers-reduced-motion:reduce){#gift-book-spread,.gift-calendar-lid{transition:none!important}}

