@font-face{font-family:'Wings Letter';src:url('../assets/fonts/caveat/Caveat-variable.ttf') format('truetype');font-weight:400 700;font-display:swap}
.feature-dialog{color:var(--w-text);border:1px solid var(--w-border);border-radius:24px;padding:24px;width:min(640px,calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));max-width:none;max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow:hidden;box-sizing:border-box}
/* Size against the same fixed containing block as the insets. iOS standalone
   100vh can be taller; auto margins then turn negative and erase the top inset. */
.feature-dialog{--feature-top:max(16px,env(safe-area-inset-top));--feature-bottom:max(16px,env(safe-area-inset-bottom));--feature-viewport:100%;position:fixed;top:var(--feature-top);bottom:var(--feature-bottom);margin-block:auto;height:fit-content;max-height:calc(var(--feature-viewport) - var(--feature-top) - var(--feature-bottom))}
.feature-dialog[open]{display:flex;flex-direction:column}
.feature-dialog::backdrop{background:rgba(15,35,32,.36)}
.w-material .feature-dialog>.feature-close{position:absolute;top:8px;right:8px;width:48px;height:48px;padding:8px;font-size:32px;z-index:3;display:grid;place-items:center;border:0;box-shadow:none}
.feature-close svg{width:28px;height:28px}
.feature-dialog>.w-menu-heading{flex-shrink:0;padding-top:24px}
.feature-content{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:4px;scrollbar-width:thin}
.feature-status{flex-shrink:0;font-size:14px;margin:12px 4px 0;text-align:center}
.feature-status:empty{display:none}
.feature-subtitle{text-align:center;color:var(--w-muted);margin:0 0 20px}
.feature-empty{color:var(--w-muted);line-height:1.6;text-align:center;padding:12px 0}
.feature-photo{display:block;object-fit:contain;max-width:100%;width:144px;height:144px;margin-inline:auto}
.feature-photo[data-large]{width:220px;height:220px}
.feature-actions{display:flex;gap:12px;margin-top:20px}.feature-actions>*{flex:1}
.feature-content .w-button{min-height:48px}
.mail-list{display:grid;gap:12px}
.mail-envelope{position:relative;display:flex;align-items:center;gap:16px;text-align:left;width:100%;padding:24px 16px;color:var(--w-text);background:var(--w-surface);border:1px solid var(--w-border);border-radius:14px;box-shadow:0 2px 0 var(--w-lift)}
.mail-envelope:hover{background:var(--w-active-fill)}
.envelope-mark svg{width:36px;height:36px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.mail-envelope-words{display:grid;gap:6px;flex:1}.mail-envelope-words strong{font-family:var(--w-font-heading);font-weight:500;font-size:18px}.mail-envelope-words>span{font-size:14px;color:var(--w-muted)}
.unread-dot{width:9px;height:9px;flex-shrink:0;border-radius:50%;background:var(--w-text)}
.mail-badge{position:absolute;right:-6px;top:-6px;min-width:21px;height:21px;padding:0 4px;border-radius:12px;background:var(--w-primary);color:var(--w-on-primary);border:1px solid var(--w-border);font-size:12px;font-weight:800;line-height:19px;box-sizing:border-box;z-index:3}
.mail-badge[data-ready=true]{background:var(--w-selected);color:var(--w-text);border-color:var(--w-focus);box-shadow:0 0 0 1px var(--w-focus)}
.mail-envelope[data-ready=true]{background:var(--w-active-fill);border-color:var(--w-focus);box-shadow:inset 0 0 0 1px var(--w-focus),0 2px 0 var(--w-lift)}
.mail-envelope[data-ready=true] .envelope-mark{position:relative}
.mail-ready-mark{position:absolute;right:-4px;bottom:-2px;display:grid;place-items:center;width:18px;height:18px;border-radius:50%;background:var(--w-selected);border:1px solid var(--w-focus);color:var(--w-text);font:800 12px/1 var(--w-font-ui)}
.handwritten-letter{padding:16px 20px;margin:0 0 20px;border-bottom:1px solid var(--w-divider);font-family:'Wings Letter',cursive;font-size:26px;line-height:1.25}
.letter-address{font:12px/1.5 var(--w-font-ui);text-align:right;color:var(--w-muted);margin:0 0 24px}
.letter-greeting{margin:0 0 8px}.letter-body{margin:0}.letter-signature{white-space:pre-line;margin:20px 0 0}
.letter-polaroid{width:240px;max-width:100%;box-sizing:border-box;margin:24px auto;padding:10px 10px 14px;background:var(--w-surface);border:1px solid var(--w-divider);border-radius:3px;box-shadow:0 3px 5px var(--w-lift);transform:rotate(-2deg)}
.letter-polaroid img{width:200px;height:200px}.letter-polaroid figcaption{font-size:23px;line-height:1.2;text-align:center;margin-top:8px}
.letter-specimen{text-align:center;margin:20px}.letter-specimen svg{width:100px;height:140px;fill:var(--w-active-fill);stroke:var(--w-border);stroke-width:1.2;stroke-linecap:round;stroke-linejoin:round}.letter-specimen figcaption{font-size:20px}
.letter-actions{text-align:center;padding:0 8px 8px}.letter-actions>.w-button{min-width:200px;max-width:100%}.letter-reward{display:flex;align-items:center;justify-content:center;gap:8px;text-align:center;font-size:16px;margin:8px 0 16px}.letter-help{color:var(--w-muted);font-size:13px;line-height:1.45;margin:12px 0 0;text-align:center}
.request-candidate{margin-bottom:10px}.request-candidate .feature-photo{width:80px;height:80px;margin:0}
.feature-dialog button:disabled{opacity:.6;cursor:default}
.journal-breeds{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.journal-breed{color:inherit;display:flex;flex-direction:column;align-items:center;gap:6px;border:1px solid var(--w-border);border-radius:22px;padding:16px 12px}.journal-breed:hover{background-color:var(--w-active-fill)}.journal-breed strong{font:500 21px var(--w-font-heading)}.journal-breed span,.journal-breed small{font-size:13px;color:var(--w-muted)}.journal-breed :is(.feature-photo,.journal-mystery){width:112px;height:112px}.journal-breed progress{width:85%;height:5px;accent-color:var(--w-primary);margin:6px 0}
.journal-primary-list{display:grid;gap:8px}.journal-primary{min-height:56px}.journal-primary strong{flex:1}.journal-primary>span:last-child{font-size:13px;color:var(--w-muted)}.journal-swatch{width:24px;height:24px;border-radius:50%;border:1px solid var(--w-border);flex-shrink:0}
.journal-combinations{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.journal-combination{display:flex;flex-direction:column;align-items:center;gap:5px;padding:12px 6px;border:1px dashed var(--w-divider);border-radius:14px;text-align:center;min-width:0}.journal-combination.recorded{background:var(--w-surface);border-style:solid;border-color:var(--w-border)}.journal-combination strong{font-size:14px}.journal-combination small{font-size:12px;color:var(--w-muted)}.journal-combination .feature-photo,.journal-unseen{width:90px;height:90px}.journal-unseen{display:grid;place-items:center;color:var(--w-muted)}.journal-unseen svg{width:44px;height:44px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;opacity:.55}
#expedition-dialog{width:min(1180px,calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)))}
.expedition-layout{display:grid;grid-template-columns:minmax(0,1fr) 220px;gap:24px;align-items:start}.atlas-desk{padding:12px;border-radius:16px;background:var(--w-inset);border:1px solid var(--w-divider)}.expedition-map{width:100%;display:block;touch-action:pan-x pan-y;cursor:crosshair}.atlas-paper{fill:var(--w-canvas);stroke:var(--w-border);stroke-width:1}.atlas-land{fill:var(--w-selected);stroke:var(--w-border);stroke-width:2;stroke-linejoin:round}.atlas-graticule{stroke:var(--w-divider);stroke-width:1;fill:none;opacity:.65}.atlas-label{fill:var(--w-muted);text-anchor:middle;font:9px var(--w-font-ui);letter-spacing:1px;pointer-events:none}.atlas-rose{stroke:var(--w-muted);stroke-width:1;fill:none}.atlas-rose text{fill:var(--w-muted);stroke:none;text-anchor:middle;font:12px var(--w-font-heading)}.atlas-route{fill:none;stroke:var(--w-border);stroke-width:2.5;stroke-dasharray:5 6}.atlas-progress{fill:none;stroke:var(--w-focus);stroke-width:4}.atlas-stop circle{fill:var(--w-surface);stroke:var(--w-border);stroke-width:2}.atlas-stop text{fill:var(--w-text);text-anchor:middle;font:bold 12px var(--w-font-ui)}.atlas-home{fill:var(--w-primary);stroke:var(--w-text);stroke-width:1.5}.atlas-home-label{fill:var(--w-text);font:16px 'Wings Letter'}.atlas-vessel circle{fill:var(--w-primary);stroke:var(--w-text);stroke-width:1.5}.atlas-vessel path{fill:var(--w-text)}
.atlas-caption{text-align:center;font:22px 'Wings Letter';margin:12px 0}.atlas-hint{text-align:center;font-size:14px;line-height:1.4;color:var(--w-muted);margin:12px 8px}
.expedition-itinerary{display:flex;flex-direction:column;gap:12px}.expedition-itinerary h3{font:500 20px var(--w-font-heading);margin:4px 0 0}.expedition-stops{padding:0;list-style:none;counter-reset:stops;margin:0;display:grid;gap:10px}.expedition-stops li{counter-increment:stops;position:relative;padding-left:30px;display:grid;gap:3px}.expedition-stops li::before{content:counter(stops);position:absolute;left:0;top:0;width:22px;height:22px;text-align:center;font-size:13px;line-height:22px;border:1px solid var(--w-border);border-radius:50%}.expedition-stops strong{font-size:14px}.expedition-stops small{font-size:12px;color:var(--w-muted)}.route-edit{display:flex}.route-edit>*{width:100%}.expedition-total{display:flex;align-items:center;gap:8px;justify-content:space-between;margin:4px 0 0}.expedition-duration{font-size:13px;color:var(--w-muted);margin:0}.expedition-eta{font-size:16px;margin:8px 0;line-height:1.45}
/* Grow away from the corner, wrapping upward in portrait and left in landscape. */
body>.home-toolbar,.home-toolbar.decor-toolbar{display:flex;flex-direction:row-reverse;flex-wrap:wrap-reverse;align-content:flex-start;gap:6px;width:max-content;max-width:calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right));max-height:none;overflow:visible}
body>.home-toolbar .w-button,.decor-toolbar .w-button:not(#decor-cancel-placement){width:48px;height:48px;min-width:48px;min-height:48px;padding:12px;overflow:visible;flex-shrink:0}
body>.home-toolbar #home-actions:not([hidden]){display:contents;overflow:visible}
body>.home-toolbar #home-menu{order:-1}
#decor-done{order:0}#decor-transfer{order:1}#decor-rotate{order:2}#decor-move{order:3}#decor-sell{order:4}#decor-shop{order:5}
@media(orientation:landscape){
 body>.home-toolbar,.home-toolbar.decor-toolbar{flex-direction:column-reverse;max-height:calc(100dvh - 120px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
 body:has(#home-actions:not([hidden])) #debug-toggle{bottom:calc(16px + env(safe-area-inset-bottom))}
 body:has(#home-actions:not([hidden])) #debug-panel{bottom:calc(72px + env(safe-area-inset-bottom));max-height:calc(100dvh - 88px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
}
@media(orientation:portrait){
 body:has(#home-actions:not([hidden])) #debug-toggle{bottom:calc(32px + env(safe-area-inset-bottom) + var(--home-toolbar-height,102px))}
 body:has(#home-actions:not([hidden])) #debug-panel{bottom:calc(88px + env(safe-area-inset-bottom) + var(--home-toolbar-height,102px));max-height:calc(100dvh - 104px - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--home-toolbar-height,102px))}
}
@media(max-width:800px){.expedition-layout{grid-template-columns:1fr}.expedition-itinerary{padding:8px}.expedition-stops{grid-template-columns:repeat(2,minmax(0,1fr))}.expedition-map{min-height:150px}.atlas-desk{padding:4px}.atlas-caption{font-size:20px}}
@media(max-width:440px){.feature-dialog{padding:16px}.feature-dialog>.w-menu-heading{padding-inline:16px;padding-top:32px}.handwritten-letter{padding:12px 4px}.journal-breeds{gap:10px}.journal-breed{padding:14px 8px}.journal-combinations{grid-template-columns:repeat(2,minmax(0,1fr))}.mail-envelope{gap:12px;padding:20px 12px}}
/* Letter copy is handwritten; addresses and actions keep the shared UI face. */
@media(min-width:600px){.handwritten-letter{font-size:24px;line-height:1.2}.letter-polaroid{margin:16px auto;width:212px}.letter-polaroid img{width:176px;height:176px}.letter-polaroid figcaption{font-size:22px}.letter-signature{margin-top:16px}.letter-address{margin-bottom:16px}}
.feature-footer{flex-shrink:0}.feature-footer:empty{display:none}.feature-footer:not(:empty){border-top:1px solid var(--w-divider);padding-top:12px;margin-top:8px}.feature-footer .letter-actions{padding-bottom:0}.feature-footer .letter-reward{margin:0 0 10px}.feature-footer .letter-help{margin-top:8px}.handwritten-letter{border-bottom:none;margin-bottom:0}.feature-photo:not([src]){opacity:0}

.journal-breed progress{appearance:none;border:0;border-radius:4px;overflow:hidden;background:var(--w-divider)}.journal-breed progress::-webkit-progress-bar{background:var(--w-divider)}.journal-breed progress::-webkit-progress-value{background:var(--w-border);border-radius:4px}
@media(max-width:800px){.atlas-hint{margin:8px;font-size:13px}.atlas-caption{margin:8px 0}.expedition-layout{gap:12px}}
@media(orientation:landscape) and (max-height:500px){.feature-footer .letter-actions{display:grid;grid-template-columns:1fr 1fr;gap:4px 12px;align-items:center}.feature-footer .letter-actions>.w-button{min-width:0}.feature-footer .letter-help{grid-column:1/-1;margin:0}.feature-footer .letter-reward{margin:0}.feature-dialog>.w-menu-heading{padding-top:12px}}
/* A real, locally sourced atlas printed on quiet paper. */
#expedition-dialog{width:min(1420px,calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)))}
.atlas-desk{--atlas-water:#dce2da;--atlas-land:#c0c5a5;--atlas-ink:#52644f;--atlas-edge:#87977b;padding:12px;background:var(--w-inset)}
body[data-theme=dark] .atlas-desk{--atlas-water:#bdc9c4;--atlas-land:#acb698;--atlas-ink:#394f43;--atlas-edge:#778970}
.atlas-frame{border:1px solid var(--w-border);border-radius:16px;overflow:hidden;background:var(--atlas-water);box-shadow:inset 0 1px 4px var(--w-lift)}
.expedition-map{display:block;width:100%;height:auto;aspect-ratio:1000/540;min-height:0;touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none;outline-offset:-5px}
.expedition-map:active{cursor:grabbing}
.atlas-paper{fill:var(--atlas-water);stroke:none}.atlas-paper-grain{stroke:var(--atlas-ink);stroke-width:.25;opacity:.06}
.atlas-land{fill:var(--atlas-land);stroke:var(--atlas-edge);stroke-width:.65;stroke-linejoin:round}.atlas-coast-shadow{fill:none;stroke:var(--atlas-ink);stroke-width:3;opacity:.1}
.atlas-graticule{stroke:var(--atlas-ink);stroke-width:.5;opacity:.17;pointer-events:none}
.atlas-label{fill:var(--atlas-ink);font:600 11px var(--w-font-ui);letter-spacing:1.3px;paint-order:stroke;stroke:var(--atlas-land);stroke-width:2px;stroke-opacity:.55}
.atlas-ocean-label{font:italic 14px var(--w-font-heading);letter-spacing:1px;stroke:var(--atlas-water)}
.atlas-rose{stroke:var(--atlas-ink);opacity:.65}.atlas-rose text{fill:var(--atlas-ink)}
.atlas-route{stroke:var(--atlas-ink);stroke-width:2;stroke-dasharray:4 5}.atlas-progress{stroke:#9b5939;stroke-width:3}
.atlas-stop circle{fill:#f2ecd9;stroke:#687c60;stroke-width:1.3}.atlas-stop text{fill:#35483d}
.atlas-home{fill:#dfb18b;stroke:#52644f}.atlas-home-label{fill:#35483d;paint-order:stroke;stroke:var(--atlas-water);stroke-width:3px;stroke-linejoin:round}
.atlas-vessel circle{fill:#e4bb93;stroke:#52644f}.atlas-vessel path{fill:#35483d}
.atlas-discovery{pointer-events:none}.atlas-discovery circle{fill:#f2eedf;stroke:#87977b;stroke-width:1.2;filter:drop-shadow(0 2px 2px #35483d33)}
.atlas-keyboard-cursor{stroke:#35483d;stroke-width:1.5;display:none;pointer-events:none}body[data-focus-input=keyboard] .expedition-map:focus .atlas-keyboard-cursor{display:block}
.atlas-tools{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;margin-top:12px}.atlas-zoom{display:flex;gap:6px}.atlas-zoom .w-button{min-width:48px;padding:8px 12px;font-size:19px}.atlas-zoom .w-button:last-child{font-size:14px}
#expedition-discoveries{display:flex;align-items:center;gap:8px;font-size:14px;padding:8px 12px}#expedition-discoveries[aria-pressed=true]{background:var(--w-active-fill);border-color:var(--w-text)}#expedition-discoveries svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.atlas-discovery-hint{font-size:12px;line-height:1.5;text-align:center;color:var(--w-muted);margin:8px 0 0}
@media(max-width:650px){.atlas-desk{padding:8px}.expedition-map{height:260px;aspect-ratio:auto}.atlas-tools{justify-content:center}.atlas-caption{font-size:19px}.atlas-hint{font-size:13px}}

/* Pointer-opened feature menus focus the dialog itself, never highlight Close. */
.feature-dialog:focus{outline:none}

/* Expedition layout: an edge-to-edge portrait atlas, independent landscape notes. */
#expedition-dialog .expedition-notes{min-width:0;min-height:0;border:1px solid var(--w-border);border-radius:20px;overflow:hidden}
#expedition-dialog .expedition-itinerary{padding:20px;box-sizing:border-box}
#expedition-dialog .expedition-itinerary>*{flex-shrink:0}
@media(orientation:portrait){
 #expedition-dialog{width:100vw;max-width:100vw;padding:12px 0;border:0;border-radius:0}
 #expedition-dialog::after{display:none}
 #expedition-dialog>.w-menu-heading{padding:16px 64px}
 #expedition-dialog>.feature-content{padding:0}
 #expedition-dialog .expedition-layout{display:flex;flex-direction:column;gap:0;align-items:stretch}
 #expedition-dialog .atlas-desk{padding:0;border:0;border-radius:0;background:none}
 #expedition-dialog .atlas-frame{border-inline:0;border-radius:0}
 #expedition-dialog .expedition-map{height:clamp(240px,42dvh,460px);aspect-ratio:auto}
 #expedition-dialog .atlas-tools{margin:12px 16px 0;justify-content:space-between}
 #expedition-dialog .atlas-caption,#expedition-dialog .atlas-hint,#expedition-dialog .atlas-discovery-hint{margin-inline:20px}
 #expedition-dialog .expedition-notes{margin:16px}
 #expedition-dialog>.feature-status{margin-inline:20px}
}
@media(orientation:landscape){
 #expedition-dialog{height:min(820px,calc(var(--feature-viewport) - var(--feature-top) - var(--feature-bottom)));padding:16px}
 /* Keep the dialog's accessible name without spending a visual title row. */
 #expedition-dialog>.w-menu-heading{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 #expedition-dialog>.feature-content{flex:1;min-height:0;padding:0;overflow:hidden}
 #expedition-dialog .expedition-layout{height:100%;min-height:0;grid-template-columns:minmax(0,1fr) clamp(200px,28vw,300px);gap:16px;align-items:stretch}
 #expedition-dialog .atlas-desk{min-height:0;min-width:0;display:flex;flex-direction:column;padding:12px}
 #expedition-dialog .atlas-frame{flex:1;min-height:0}
 #expedition-dialog .expedition-map{height:100%;aspect-ratio:auto;min-height:0}
 #expedition-dialog .atlas-tools,#expedition-dialog .atlas-caption,#expedition-dialog .atlas-hint,#expedition-dialog .atlas-discovery-hint{flex-shrink:0}
 #expedition-dialog .expedition-notes{padding-top:44px;box-sizing:border-box}
 #expedition-dialog .expedition-itinerary{height:100%;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:16px}
 #expedition-dialog .expedition-itinerary>h3{margin-top:0}
 #expedition-dialog .expedition-stops{grid-template-columns:1fr}
 #expedition-dialog>.feature-close{top:16px;right:16px}
 #expedition-dialog .atlas-hint{margin:8px 0 0}
}
@media(orientation:landscape) and (max-height:600px){
 #expedition-dialog{padding:12px}
 #expedition-dialog .expedition-layout{gap:12px;grid-template-columns:minmax(0,1fr) 210px}
 #expedition-dialog .atlas-desk{padding:8px}
 #expedition-dialog .atlas-caption,#expedition-dialog .atlas-discovery-hint{display:none}
 #expedition-dialog .atlas-tools{margin-top:8px;gap:4px;flex-wrap:nowrap}
 #expedition-dialog #expedition-discoveries{width:48px;min-width:48px;justify-content:center;padding:8px}
 #expedition-dialog #expedition-discoveries span{display:none}
 #expedition-dialog .atlas-hint{font-size:12px;line-height:1.35}
 #expedition-dialog>.feature-close{top:12px;right:12px}
}

.atlas-vessel .atlas-compass-needle{stroke:#35483d;stroke-width:1;stroke-linejoin:round}
.atlas-vessel .atlas-compass-south{fill:#f2ecd9}

@media(orientation:portrait){#decor-status{bottom:calc(32px + env(safe-area-inset-bottom) + var(--decor-toolbar-height,48px))}}
@media(orientation:landscape){#decor-status{right:calc(32px + env(safe-area-inset-right) + var(--decor-toolbar-width,48px))}}

/* Landscape Home review: a compact header and unobstructed habitat navigation. */
@media(orientation:landscape) and (max-height:500px){
 body>header{padding:calc(max(12px,env(safe-area-inset-top)) + var(--home-top-inset,0px)) calc(16px + env(safe-area-inset-right)) 0 calc(16px + env(safe-area-inset-left));gap:16px}
 body>header .identity{flex-shrink:0;margin-right:auto}
 body>header .identity{--logo-width:112px}
 #habitat-heading{flex:0 1 440px;max-width:calc(100% - 128px)}
 #habitat-rename{min-height:48px;min-width:48px}
 #habitat-name{font-size:24px;line-height:1.17}
 #habitat-capacity{font-size:14px;line-height:20px;margin-top:0}
 #habitat-capacity svg{width:20px;height:20px}
 #coin-balance{font-size:15px;line-height:24px;margin-top:2px}
 #coin-balance .coin-icon{width:22px;height:22px}
 body>.home-toolbar{max-height:calc(100dvh - var(--home-header-bottom,104px) - 28px - env(safe-area-inset-bottom))}
 #habitat-previous{left:calc(16px + env(safe-area-inset-left))}
 #habitat-next{right:calc(16px + env(safe-area-inset-right))}
 .habitat-navigation button:not(:disabled){opacity:1}
 .habitat-navigation button:disabled{visibility:hidden}
}
/* In every landscape layout the open toolbar is a column at the right edge; keep the next-garden
   arrow beside it rather than under it (tall desktop windows and tablets too, not just phones). */
@media(orientation:landscape){body:has(#home-actions:not([hidden])) #habitat-next{right:calc(28px + env(safe-area-inset-right) + var(--home-toolbar-width,48px))}}

/* Decor review: keep feedback inside the same safe rectangle as the controls. */
#decor-editor:focus{outline:none}
#decor-heading{left:calc(16px + env(safe-area-inset-left));right:calc(16px + env(safe-area-inset-right));width:auto;max-width:480px;margin-inline:auto;transform:none}
.w-material #decor-heading{position:absolute;width:fit-content;padding:14px 24px;border:1px solid var(--w-border);border-radius:24px;max-width:min(480px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)))}
#decor-heading h1{margin:0;line-height:28px}
#decor-heading p{line-height:20px}
#decor-name{overflow-wrap:anywhere}
#decor-status{--decor-status-left:calc(16px + env(safe-area-inset-left));--decor-status-right:calc(16px + env(safe-area-inset-right));left:var(--decor-status-left);right:var(--decor-status-right)}
#decor-status:not(:empty){max-width:min(480px,calc(100% - var(--decor-status-left) - var(--decor-status-right)));overflow-wrap:anywhere}
@media(orientation:landscape){
 #decor-status{--decor-status-right:calc(32px + env(safe-area-inset-right) + var(--decor-toolbar-width,48px))}
}
@media(orientation:landscape) and (max-height:500px){
 #decor-heading{top:max(16px,env(safe-area-inset-top));max-width:420px}
 .w-material #decor-heading{padding:12px 20px;max-width:min(420px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)))}
 #decor-heading h1{font-size:20px;line-height:26px;margin:0}
 #decor-heading p{font-size:13px;line-height:18px;margin-top:6px}
 #decor-heading .decor-node-counts{gap:6px}
 #decor-heading .decor-node-counts svg{width:18px;height:18px}
 #decor-heading .decor-resale{font-size:13px;margin-left:4px}
 #decor-heading #decor-occupied{font-size:13px;line-height:18px;padding:6px 10px;max-width:380px;margin:8px auto 0}
 .home-toolbar.decor-toolbar{max-height:max(48px,calc(100dvh - max(100px,var(--decor-heading-bottom,100px)) - 32px - env(safe-area-inset-bottom)))}
 #decor-status:not(:empty){font-size:13px;line-height:18px;padding:8px 12px}
}

/* Mailbox folders stay put while letters scroll; detail routes keep their layout. */
#mailbox-dialog.mailbox-inbox {
 --mail-left:calc(16px + env(safe-area-inset-left));--mail-right:calc(16px + env(safe-area-inset-right));
 left:var(--mail-left);right:var(--mail-right);margin-inline:auto;
 width:min(640px,calc(100% - var(--mail-left) - var(--mail-right)));
 height:calc(var(--feature-viewport) - var(--feature-top) - var(--feature-bottom));
}
#mailbox-dialog.mailbox-inbox > .feature-content {flex:1;scrollbar-gutter:stable;padding:4px 12px 4px 4px;}
#mailbox-dialog .mail-envelope {-webkit-tap-highlight-color:transparent;}
#mailbox-dialog .mail-envelope-words {min-width:0;overflow-wrap:anywhere;}
#mailbox-dialog .envelope-mark {flex-shrink:0;}
#mailbox-dialog .unread-dot {flex:0 0 8px;}
#mailbox-dialog .mail-envelope[data-unread=true] strong {font-weight:700;}
@media(orientation:landscape) and (max-height:500px) {
 #mailbox-dialog.mailbox-inbox {width:min(920px,calc(100% - var(--mail-left) - var(--mail-right)));padding:12px;}
 #mailbox-dialog.mailbox-inbox > .w-menu-heading {padding:0 48px 8px;}
 #mailbox-dialog.mailbox-inbox .w-title-patch {font-size:22px;line-height:28px;padding:4px 16px;}
 #mailbox-dialog.mailbox-inbox .mail-list {grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:8px;align-content:start;}
 #mailbox-dialog.mailbox-inbox .mail-envelope {min-height:72px;padding:10px;gap:10px;}
 #mailbox-dialog.mailbox-inbox .envelope-mark svg {width:28px;height:28px;}
 #mailbox-dialog.mailbox-inbox .mail-envelope-words {gap:4px;}
 #mailbox-dialog.mailbox-inbox .mail-envelope-words strong {font-size:16px;line-height:20px;}
 #mailbox-dialog.mailbox-inbox .mail-envelope-words > span {font-size:13px;line-height:18px;}
 #mailbox-dialog.mailbox-inbox .feature-empty {font-size:14px;line-height:20px;padding:12px;}
}

/* Request letters keep the exact specimen visible beside the handwritten note. */
#mailbox-dialog.request-letter{
 --request-left:calc(16px + env(safe-area-inset-left));--request-right:calc(16px + env(safe-area-inset-right));
 left:var(--request-left);right:var(--request-right);margin-inline:auto;
 width:min(640px,calc(100% - var(--request-left) - var(--request-right)));
 height:calc(var(--feature-viewport) - var(--feature-top) - var(--feature-bottom));
}
#mailbox-dialog.request-letter > .feature-content{flex:1;scrollbar-gutter:stable;}
#mailbox-dialog.request-letter .letter-copy{min-width:0;overflow-wrap:anywhere;}
#mailbox-dialog.request-letter .letter-copy:focus-visible{outline-offset:-2px;}
#mailbox-dialog.request-letter .letter-actions > .w-button{min-height:48px;-webkit-tap-highlight-color:transparent;}
@media(orientation:landscape) and (max-height:500px){
 #mailbox-dialog.request-letter{width:min(920px,calc(100% - var(--request-left) - var(--request-right)));padding:12px;}
 #mailbox-dialog.request-letter > .w-menu-heading{padding:0 48px 8px;}
 #mailbox-dialog.request-letter .w-title-patch{font-size:22px;line-height:28px;padding:4px 16px;}
 #mailbox-dialog.request-letter > .feature-content{overflow:hidden;padding:4px;scrollbar-gutter:auto;}
 #mailbox-dialog.request-letter .handwritten-letter{display:grid;grid-template-columns:minmax(0,1fr) 200px;gap:20px;height:100%;padding:4px 8px;box-sizing:border-box;min-height:0;font-size:24px;line-height:1.2;}
 #mailbox-dialog.request-letter .letter-copy{overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-gutter:stable;padding:4px 12px 4px 4px;}
 #mailbox-dialog.request-letter .letter-address{font-size:13px;line-height:18px;margin-bottom:10px;}
 #mailbox-dialog.request-letter .letter-signature{margin-top:12px;}
 #mailbox-dialog.request-letter .letter-polaroid{display:flex;flex-direction:column;align-self:center;width:100%;height:min(100%,230px);min-height:0;max-height:100%;margin:0;padding:8px 8px 10px;transform:rotate(-1deg);}
 #mailbox-dialog.request-letter .letter-polaroid img{width:100%;height:0;min-height:0;flex:1;}
 #mailbox-dialog.request-letter .letter-polaroid figcaption{flex-shrink:0;font:700 14px/18px var(--w-font-ui);margin-top:4px;overflow-wrap:anywhere;}
 #mailbox-dialog.request-letter > .feature-footer{padding-top:8px;margin-top:8px;}
 #mailbox-dialog.request-letter .letter-actions{padding-inline:4px;}
 #mailbox-dialog.request-letter .letter-help{font-size:13px;line-height:18px;}
 #mailbox-dialog.request-letter .feature-status{font-size:13px;line-height:18px;margin-top:8px;}
}
@media(orientation:landscape) and (max-height:500px) and (max-width:740px){
 #mailbox-dialog.request-letter .handwritten-letter{grid-template-columns:minmax(0,1fr) 150px;gap:12px;padding-inline:0;}
 #mailbox-dialog.request-letter .letter-copy{padding-right:8px;}
 #mailbox-dialog.request-letter .letter-reward{font-size:14px;gap:4px;flex-wrap:wrap;}
}
/* Share a header row so Back remains centred on the title, even when it wraps. */
#mailbox-dialog.request-letter > .w-menu-heading{position:relative;display:flex;align-items:center;justify-content:center;min-height:48px;padding:0 48px;margin-bottom:12px;}
.w-material #mailbox-dialog.request-letter > .w-menu-heading > .feature-close{position:absolute;top:50%;right:0;transform:translateY(-50%);width:48px;height:48px;padding:8px;font-size:32px;z-index:3;display:grid;place-items:center;border:0;box-shadow:none;}
#mailbox-dialog.request-letter .w-title-patch{padding-inline:12px;}
@media(orientation:landscape) and (max-height:500px){#mailbox-dialog.request-letter > .w-menu-heading{min-height:36px;margin-bottom:8px;}}

/* Residents selection is optional; keep the ordinary browsing cards unchanged. */
.resident-selection-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-shrink:0;margin-bottom:6px}
.resident-selection-heading .habitat-dialog-subtitle{margin:0;min-width:0;font-size:14px}
#residents-select{min-height:48px;padding:8px 16px}
.resident-selection-actions{display:flex;align-items:center;gap:6px;flex-shrink:0;padding-top:8px}
.resident-selection-actions[hidden]{display:none}
.resident-selection-actions .selection-count{flex:1;font-size:13px;font-weight:700}
.resident-selection-actions .w-button{min-width:48px;min-height:48px;padding:8px 12px}
.resident-selection-actions .residents-favorite{display:grid;place-items:center;padding:8px;color:var(--w-favorite,#9b7949)}
.resident-selection-actions .residents-favorite svg.menu-emoji{display:block;width:22px;height:22px}
@media(max-width:360px){.resident-selection-actions{gap:3px}.resident-selection-actions .selection-count{font-size:12px}.resident-selection-actions .residents-favorite{min-width:44px}}
#residents-dialog.selecting-residents .butterfly-card{position:relative}
#residents-dialog.selecting-residents .butterfly-card::before{content:'';position:absolute;right:6px;top:6px;width:20px;height:20px;border:1px solid var(--w-border);border-radius:50%;background:var(--w-surface);z-index:1}
#residents-dialog.selecting-residents .butterfly-card[aria-pressed=true]{background:var(--w-selected);border-color:var(--w-text)}
#residents-dialog.selecting-residents .butterfly-card[aria-pressed=true]::before{content:'✓';font-size:15px;line-height:20px;color:var(--w-text);text-align:center}/* landscape rows are left-aligned; keep the check centred in its circle */
#resident-bulk-dialog .feature-footer{display:flex;gap:8px;justify-content:center;flex-shrink:0;padding-top:12px}
#resident-bulk-dialog .habitat-row{margin-bottom:8px}
#resident-bulk-dialog .feature-subtitle{font-size:15px;line-height:1.5}
@media(orientation:landscape) and (max-height:500px){
 #resident-bulk-dialog{padding:12px}
 #resident-bulk-dialog>.w-menu-heading{padding:0 48px 8px}
 #resident-bulk-dialog .w-title-patch{font-size:22px;line-height:28px;padding:4px 12px}
 #residents-dialog .resident-selection-heading{margin-top:-4px;margin-bottom:2px}
 #residents-dialog.selecting-residents h3{margin-block:4px}
 #resident-bulk-dialog .habitat-row{min-height:56px;padding:8px 12px}
}

/* Every visible feature heading shares its row with its quiet dismissal. */
.feature-dialog:not(#expedition-dialog)>.w-menu-heading{position:relative;display:flex;align-items:center;justify-content:center;min-height:48px;padding:0 48px;margin-bottom:12px;flex-shrink:0}
.w-material .feature-dialog>.w-menu-heading>.feature-close{position:absolute;top:50%;right:0;transform:translateY(-50%);width:48px;height:48px;min-height:48px;padding:8px;font-size:32px;z-index:3;display:grid;place-items:center;border:0;box-shadow:none}
.feature-footer{flex-shrink:0}
.specimen-destinations{display:grid;gap:8px}
#mailbox-dialog[data-mail-route=confirm] .feature-actions{margin-top:12px}
#mailbox-dialog[data-mail-route=confirm]>.feature-content>p:not(.feature-subtitle):not(.letter-reward){line-height:1.5}
#mailbox-dialog .letter-specimen{align-self:center;min-width:0}
#mailbox-dialog .letter-specimen figcaption{overflow-wrap:anywhere}
@media(orientation:landscape) and (max-height:500px){
 .feature-dialog:not(#expedition-dialog){padding:12px;width:min(920px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)))}
 .feature-dialog:not(#expedition-dialog)>.w-menu-heading{min-height:48px;margin-bottom:6px;padding:0 48px}
 .feature-dialog:not(#expedition-dialog) .w-title-patch{font-size:22px;line-height:28px;padding:4px 12px}
 .feature-subtitle{font-size:13px;line-height:18px;margin-bottom:10px}
 .feature-empty{font-size:14px;line-height:20px;margin:8px 0;padding:8px 0}
 #mailbox-dialog[data-mail-route=send],#mailbox-dialog[data-mail-route=place],#journal-dialog{height:calc(var(--feature-viewport) - var(--feature-top) - var(--feature-bottom))}
 #mailbox-dialog[data-mail-route=send]>.feature-content,#mailbox-dialog[data-mail-route=place]>.feature-content,#journal-dialog>.feature-content{flex:1;scrollbar-gutter:stable;padding-right:12px}
 .request-candidates,.specimen-destinations{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:8px}
 .request-candidate{margin:0;padding:8px;min-height:76px;gap:8px}
 .request-candidate .feature-photo{width:60px;height:60px;flex:0 0 60px}
 .request-candidate .resident-words{min-width:0}
 .request-candidate strong{font-size:14px;line-height:18px}
 .request-candidate small{font-size:13px;line-height:18px}
 .specimen-destinations .habitat-row{padding:8px 12px;min-height:56px}
 #mailbox-dialog[data-mail-route=confirm]>.feature-content{display:grid;grid-template-columns:130px minmax(0,1fr);column-gap:16px;align-content:center;align-items:center;min-height:130px}
 #mailbox-dialog[data-mail-route=confirm]>.feature-content>.feature-photo{width:130px;height:130px;grid-row:1 / 4}
 #mailbox-dialog[data-mail-route=confirm]>.feature-content>p{margin:4px 0;font-size:14px;text-align:left}
 #mailbox-dialog[data-mail-route=confirm] .letter-reward{justify-content:flex-start}
 #mailbox-dialog[data-mail-route=confirm] .feature-actions{margin-top:8px}
 #mailbox-dialog .letter-specimen{margin:0 8px}
 #mailbox-dialog .letter-specimen svg{width:70px;height:100px}
 #mailbox-dialog .letter-specimen figcaption{font-size:20px;line-height:24px}
 #mailbox-dialog .letter-actions{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap}
 #mailbox-dialog .letter-actions .letter-help{margin:0}
 #mailbox-dialog .letter-actions .letter-reward{margin:0}
 #mailbox-dialog.request-letter .letter-actions .letter-help{flex-basis:100%}
 .journal-breeds{gap:8px}
 .journal-breed{display:grid;grid-template-columns:76px minmax(0,1fr);gap:3px 10px;padding:10px;text-align:left;min-height:110px;border-radius:18px}
 .journal-breed :is(.feature-photo,.journal-mystery){width:76px;height:76px;grid-row:1 / 5}
 .journal-breed strong{font-size:18px;line-height:24px}
 .journal-breed progress{width:100%;margin:3px 0}
 .journal-primary-list{grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:8px}
 .journal-primary{padding:8px 12px;gap:8px;min-height:56px}
 .journal-primary strong{font-size:14px}
 .journal-combinations{grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:8px}
 .journal-combination{padding:8px 4px;gap:3px}
 .journal-combination .feature-photo,.journal-unseen{width:64px;height:64px}
 #expedition-dialog .expedition-itinerary{padding:10px;gap:10px}
 #expedition-dialog .expedition-itinerary .feature-empty{text-align:left}
 #expedition-dialog .expedition-itinerary .letter-help{margin-top:0}
 #debug-panel{top:max(16px,env(safe-area-inset-top));bottom:max(16px,env(safe-area-inset-bottom));height:auto;max-height:none;width:min(520px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));padding:12px;box-sizing:border-box}
 #debug-panel .w-menu-heading{padding:0 48px 0 0;margin-bottom:4px;min-height:48px}
 #debug-panel .w-title-patch{font-size:22px;line-height:28px;padding:4px 14px}
 #debug-close{position:absolute;right:8px;top:12px;height:48px;min-height:48px}
 #debug-panel .debug-actions{margin:6px 0;gap:6px}
 #debug-panel #debug-events{min-height:0}
 #debug-reset-confirmation{overflow-y:auto;min-height:0;flex-shrink:1!important}
 #error.save-recovery{width:min(640px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));padding:16px}
 .save-recovery .w-title-patch{font-size:22px;line-height:28px;padding:4px 12px}
 .save-recovery p{font-size:14px;line-height:20px;margin:8px 0}
 .save-recovery .recovery-actions{flex-direction:row;flex-wrap:wrap;gap:8px}
 .save-recovery .recovery-actions button{flex:1}
}
@media(orientation:landscape) and (max-height:500px){
 #mailbox-dialog.request-letter>.w-menu-heading{min-height:36px;margin-bottom:8px}
 #mailbox-dialog.request-letter .letter-actions{display:grid;grid-template-columns:1fr 1fr;gap:4px 12px}
 #mailbox-dialog.request-letter .letter-actions .letter-help{grid-column:1 / -1}
 #mailbox-dialog.request-letter .letter-actions:not(:has(.letter-reward))>.w-button{grid-column:1 / -1;justify-self:center}
 #debug-panel:has(#debug-reset-confirmation:not([hidden])){height:fit-content;margin-block:auto}
 #debug-panel .debug-header{position:relative;justify-content:center;padding:0 48px}
 #debug-panel .debug-header #debug-close{right:0;top:50%;transform:translateY(-50%)}
}
#residents-dialog:focus{outline:none}
.resident-header{flex-shrink:0}
@media(orientation:landscape){
 #residents-dialog .resident-header{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:8px;margin-bottom:8px;min-height:48px}
 #residents-dialog .resident-header>.w-menu-heading,#residents-dialog .resident-selection-heading{display:contents}
 #residents-dialog .resident-header .w-title-patch{grid-column:2;grid-row:1;margin:0}
 #residents-dialog .resident-header .habitat-dialog-subtitle{grid-column:1;grid-row:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 #residents-dialog #residents-select{grid-column:3;grid-row:1;justify-self:end;margin-right:56px}
 #residents-dialog .resident-header .dialog-close{position:static;grid-column:3;grid-row:1;justify-self:end;width:48px;height:48px;min-height:48px;padding:0;transform:none}
}
#debug-panel:focus{outline:none}
#debug-panel summary{min-height:48px;display:flex;align-items:center}

@media(orientation:portrait){
 #residents-dialog .resident-header>.w-menu-heading{position:relative;display:flex;align-items:center;justify-content:center;min-height:48px;padding:0 48px;margin-bottom:12px}
 #residents-dialog .resident-header .dialog-close{position:absolute;right:0;top:50%;transform:translateY(-50%);width:48px;height:48px;min-height:48px;padding:0}
 #residents-dialog.selecting-residents .resident-swatches{left:auto;right:9px;top:34px}
}
#debug-panel .debug-header{display:grid;grid-template-columns:48px minmax(0,1fr) 48px;align-items:center;padding:0;gap:8px}
#debug-panel .debug-header #debug-title{grid-column:2;justify-self:center}
#debug-panel .debug-header #debug-close{position:static;grid-column:3;width:48px;height:48px;padding:0;transform:none}
/* Orbit only the specimen area; the action sheet keeps normal touch scrolling. */
#butterfly-focus:not(.breeding-active) #butterfly-portrait{touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none}
#butterfly-focus:not(.breeding-active) #butterfly-portrait[data-dragging=true]{cursor:grabbing}
#butterfly-portrait:focus-visible{outline-offset:-4px;border-radius:16px}

/* Price and affordability stay visible below the scrolling habitat list. */
.habitat-list-footer { flex-wrap: wrap; }
.garden-list-item{position:relative;display:flex;min-width:0}
#habitats-dialog .garden-list-item>.habitat-row{flex:1;min-width:0;width:100%}
#habitats-dialog .garden-list-item:has(.garden-order-controls)>.habitat-row{padding-right:60px;min-height:100px}
#habitats-dialog .garden-list-item:has(.garden-order-controls) .habitat-mark{display:none}
.garden-order-controls{position:absolute;right:8px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column}
.garden-order-button{display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:10px;border:0;background:none;box-shadow:none;color:var(--w-muted);cursor:pointer;-webkit-tap-highlight-color:transparent}
.garden-order-button:disabled{opacity:.25;cursor:default}
.garden-order-button:not(:disabled):hover{color:var(--w-text)}
.garden-order-button svg{display:block;width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.w-material #garden-purchase-dialog{width:min(440px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)))}
.garden-purchase-description{font-size:16px;line-height:1.5;margin:0 0 16px}
.garden-purchase-balance{font-size:14px;line-height:1.5;margin:0 0 12px;color:var(--w-muted)}
#garden-purchase-dialog .feature-footer{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;flex-shrink:0;padding-top:8px}
#garden-purchase-dialog .feature-footer .w-button{min-height:48px;min-width:0;padding:8px;font-size:16px}
#habitat-add { display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap; }
.habitat-purchase-note { display:block; flex-basis:100%; text-align:center; line-height:1.4; overflow-wrap:anywhere; padding:8px 0; margin-bottom:-16px; }
.journal-combination.recorded{color:var(--w-text);font-family:var(--w-font-ui);cursor:pointer;-webkit-tap-highlight-color:transparent}
.journal-combination.recorded:hover{background:var(--w-active-fill)}
#butterfly-display-help{margin:8px 0 0}
#butterfly-cover{display:block;margin:12px auto 0;min-height:48px;padding:8px 18px;-webkit-tap-highlight-color:transparent}
#butterfly-cover[hidden]{display:none}
#butterfly-cover[aria-pressed=true]{border-color:var(--w-favorite,#9b7949);color:var(--w-text);font-weight:800}
#butterfly-cover-status:empty{display:none}

/* Special finishes get a quiet glimmer opposite the color swatches. */
.resident-special{position:absolute;top:7px;left:7px;width:19px;height:19px;color:var(--w-text);pointer-events:none;}
.resident-special svg{display:block;width:100%;height:100%;overflow:visible;fill:var(--w-active-fill);stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;}
/* Special cards: gold edge; doubles add an inner second line. Inset shadows keep card size unchanged. */
.special-double .resident-special{width:28px}
.special-resident .resident-special{z-index:2}
/* Short landscape rows: the favourite star shares the top-left corner, so sparkles sit beside it, clear of the thumbnail. */
/* The sparkle keeps the top-left corner on every special; a favourite's star sits to its right. */
.favorite-resident.special-resident .resident-favorite{left:23px}
.favorite-resident.special-double .resident-favorite{left:31px}

.breeding-actions .w-button{flex-direction:column;gap:2px}
.breeding-actions .coin-amount{font-size:12px;line-height:16px}
.breeding-actions .coin-icon{width:16px;height:16px}

/* Finish stays at the corner of the Decor toolbar. */
#decor-done{order:-1}
.home-toolbar.decor-toolbar .w-button:not(#decor-cancel-placement){padding:0}




@media(max-width:440px){.journal-breed strong{font-size:18px;line-height:24px}.journal-breed :is(.feature-photo,.journal-mystery){max-width:100%;height:auto;aspect-ratio:1}}

/* Offer installation before a mobile browser starts its local garden. */
#install-guide{width:min(440px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));padding:20px}
#install-guide>.w-menu-heading{padding-top:0}
#install-guide .w-title-patch{font-size:22px;line-height:28px}
#install-guide .feature-content{min-height:0;overflow-y:auto;overscroll-behavior:contain;font-size:15px;line-height:1.45}
.install-app-icon{display:block;margin:4px auto 12px;border-radius:18px}
.install-intro{text-align:center;margin:0 0 16px}
#install-guide h3{font:500 18px var(--w-font-heading);margin:12px 0 8px}
.install-steps{padding-left:24px;margin:0}
.install-steps li{padding-left:4px;margin:0 0 10px}
.install-action{white-space:nowrap}
.install-action svg{display:inline-block;width:1.15em;height:1.15em;vertical-align:-.18em;margin-right:.25em;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.install-save-note{margin:16px 0 4px;padding-top:12px;border-top:1px solid var(--w-divider);font-size:14px}
.install-save-note>.install-save-lead{display:block;margin-bottom:4px}
#install-continue{width:100%;min-height:48px}
@media(orientation:landscape) and (max-height:500px){
 #install-guide{width:min(720px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));padding:12px 16px}
 #install-guide>.w-menu-heading{margin-bottom:6px}
 #install-guide .feature-content{font-size:14px;line-height:1.4}
 .install-app-icon{float:left;width:56px;height:56px;margin:0 14px 6px 0;border-radius:14px}
 .install-intro{text-align:left;margin:0 0 8px}
 #install-guide h3{margin:8px 0}
 .install-steps li{margin-bottom:6px}
 .install-save-note{clear:both;margin-top:8px;padding-top:8px}
 #install-guide .feature-footer{padding-top:8px}
}

.w-material .onboarding-card{position:fixed;z-index:5;left:calc(16px + env(safe-area-inset-left));bottom:calc(32px + env(safe-area-inset-bottom) + var(--home-toolbar-height,48px));width:min(320px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));max-height:calc(100% - var(--home-header-bottom,130px) - 128px - env(safe-area-inset-bottom));overflow-y:auto;padding:16px;border:1px solid var(--w-border);border-radius:22px;color:var(--w-text);background:var(--w-canvas)}
.onboarding-card>.w-menu-heading{position:relative;margin:0 0 8px;padding:0 30px 0 0;text-align:left}
.onboarding-card .w-title-patch{display:inline-block;font-size:18px;line-height:24px;padding:6px 10px}
#onboarding-skip{position:absolute;top:0;right:-8px;width:48px;height:48px;padding:10px;border:0;box-shadow:none}
.onboarding-count{font-size:12px;color:var(--w-muted);margin:0 0 6px}
.onboarding-copy{font-size:14px;line-height:1.4;margin:0 0 12px}
.onboarding-reference{white-space:nowrap}
.onboarding-reference>svg.menu-emoji{display:inline-block;width:1.15em;height:1.15em;vertical-align:-.2em;margin:0 .2em 0 0;overflow:visible;fill:none;stroke:none;stroke-width:0}
#onboarding-next{width:100%;min-height:48px;font-size:14px}
.onboarding-error:empty{display:none}.onboarding-error{font-size:13px}
.onboarding-tip{grid-column:1/-1;margin:0 0 10px;padding:8px 10px;background:var(--w-active-fill);border-radius:10px;color:var(--w-text);font-size:14px;line-height:1.4}
body:has(dialog[open]) .onboarding-card,body.decor-editing .onboarding-card:not([data-step=close-decor]),body.butterfly-selected .onboarding-card{display:none}
@media(orientation:landscape){.w-material .onboarding-card{bottom:calc(16px + env(safe-area-inset-bottom));width:280px;max-height:calc(100% - var(--home-header-bottom,104px) - 32px - env(safe-area-inset-bottom));padding:12px}.onboarding-copy{font-size:13px}.onboarding-card .w-title-patch{font-size:17px}.onboarding-tip{font-size:13px;margin-bottom:6px}}

@media(orientation:portrait){.w-material .onboarding-card[data-step=close-decor]{bottom:calc(32px + env(safe-area-inset-bottom) + var(--decor-toolbar-height,48px));max-height:calc(100% - var(--decor-heading-bottom,130px) - var(--decor-toolbar-height,48px) - 48px - env(safe-area-inset-bottom))}}
/* The guide confirms this purchase; retain other status and save-error messages. */
body:has(.onboarding-card[data-step=close-decor]:not([hidden])) #decor-status[data-kind=purchase]{visibility:hidden}

#breeding-explainer.feature-dialog{width:min(380px,calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 32px));height:fit-content;padding:16px}
#breeding-explainer .feature-content{font-size:14px;line-height:1.45}
#breeding-explainer .feature-content p{margin:0 0 12px}
#breeding-explainer .feature-footer .w-button{width:100%}

/* Fill existing specimen slots; preserve row heights and corner badges. */
.w-material #residents-dialog .resident-mark>img{width:100%;height:100%;max-width:100%;object-fit:contain}
@media(orientation:portrait),(min-height:501px){
 .w-material #residents-dialog .resident-mark:has(img){width:calc(100% - 32px)}
 .breeding-partners .resident-card .breeding-thumbnail{width:calc(100% - 16px);max-width:100%}
 .journal-breed{container-type:inline-size}
 .journal-breed :is(.feature-photo,.journal-mystery){width:100%;height:min(112px,100cqw);aspect-ratio:auto}
 .journal-combination .feature-photo{width:100%;height:90px}
}

/* Journal reference link shares the title row without adding vertical chrome. */
#journal-dialog[data-journal-page=overview]>.w-menu-heading{padding-inline:72px}
.journal-guide-link{position:absolute;left:0;top:50%;transform:translateY(-50%);width:68px;min-height:48px;padding:4px;border:0;background:none;color:var(--w-text);font:600 13px/18px var(--w-font-ui);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.journal-guide-link:focus-visible{outline:2px solid var(--w-focus);outline-offset:2px;border-radius:8px}
.journal-color-guide{display:grid;gap:24px}
.color-guide-section h3{margin:0;font:500 22px/30px var(--w-font-heading)}
.color-guide-description,.color-guide-note{margin:4px 0 12px;color:var(--w-muted);font-size:14px;line-height:20px}
.color-guide-swatches{list-style:none;display:grid;grid-template-columns:repeat(auto-fit,minmax(108px,1fr));gap:8px;margin:0;padding:0}
.color-guide-color{display:flex;align-items:center;gap:8px;min-width:0;min-height:48px;padding:6px;border:1px solid var(--w-divider);border-radius:12px;background:var(--w-surface)}
.color-guide-swatch{width:28px;height:28px;flex:0 0 28px;border:1px solid var(--w-border);border-radius:50%;background:var(--swatch)}
.color-guide-swatch[data-effect=metallic]{background:linear-gradient(125deg,var(--swatch) 10%,#fff5dd 38%,var(--swatch) 52%,#665e56 100%)}
.color-guide-swatch[data-effect=glass]{background:linear-gradient(135deg,#ffffff80,transparent 50%,#ffffff99),repeating-conic-gradient(#b8c8c3 0% 25%,#eef1e9 0% 50%) 0 / 12px 12px;box-shadow:inset 0 0 0 3px #ffffff55}
.color-guide-swatch[data-effect=iridescence]{background:linear-gradient(125deg,#a6d9cb,#a4d6e7,#b6a0d7,#e4b7d1,#ebd29f)}
.color-guide-label{min-width:0}.color-guide-label strong{display:block;font-size:13px;font-weight:600}.color-guide-label small{display:block;color:var(--w-muted);font-size:11px;line-height:15px}
.color-guide-note{margin-top:20px;margin-bottom:0}
@media(min-width:700px),(orientation:landscape){.journal-color-guide{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}}

.color-guide-color{position:relative}
.color-guide-special{position:absolute;right:6px;top:8px;width:14px;height:14px;color:var(--w-text);pointer-events:none}
.color-guide-special svg{display:block;width:100%;height:100%;fill:var(--w-active-fill);stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.color-guide-color:has(.color-guide-special){gap:4px}
.color-guide-color:has(.color-guide-special) .color-guide-label strong{padding-right:18px}

/* A compact Options sheet; switch labels are full-width touch targets. */
#options-open{--menu-day-fill:#e0e3e5;--menu-day-ink:#59636b;--menu-night-fill:#38454b;--menu-night-ink:#c0cbd0}
.w-material #options-dialog{width:min(480px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));height:fit-content}
.audio-option{position:relative;display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:60px;padding:8px 4px;font-size:18px;cursor:pointer}
.audio-option+.audio-option{border-top:1px solid var(--w-divider)}
.audio-option input{position:absolute;right:4px;width:48px;height:48px;opacity:0;margin:0;cursor:pointer}
.audio-switch{width:48px;height:28px;border-radius:16px;background:var(--w-divider);border:1px solid var(--w-border);padding:3px;pointer-events:none}
.audio-switch::after{content:"";display:block;width:20px;height:20px;border-radius:50%;background:var(--w-canvas);box-shadow:0 1px 2px #0003}
.audio-option input:checked+.audio-switch{background:var(--w-text)}
.audio-option input:checked+.audio-switch::after{transform:translateX(20px)}
.audio-option input:focus-visible+.audio-switch{outline:2px solid var(--w-text);outline-offset:4px}
.audio-option:has(input:disabled){opacity:.5;cursor:default}
.audio-note{font-size:14px;line-height:20px;color:var(--w-muted);margin:12px 0 0}

#options-dialog .audio-lighting-control{display:flex;align-items:center;justify-content:center;gap:8px;min-width:140px;min-height:48px;padding:6px 12px;font-size:16px}
#options-dialog .audio-lighting-control svg{width:24px;height:24px}
#options-dialog .audio-option:has(.audio-lighting-control){cursor:default}
.game-data-options{border-top:1px solid var(--w-divider);margin-top:8px;padding-top:12px}
.game-data-options h3{font:700 16px/1.4 var(--w-font-ui);margin:0 0 12px}
.game-data-buttons{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.game-data-buttons .w-button{min-width:0;padding:8px;font-size:14px}
#game-reset,#game-diagnostics{grid-column:1 / -1}
.game-build{font-size:11px;color:var(--w-muted);margin:12px 0 0;text-align:center;overflow-wrap:anywhere}
.game-save-code{display:block;width:100%;height:112px;min-height:72px;resize:vertical;box-sizing:border-box;border:1px solid var(--w-border);border-radius:12px;padding:10px;background:var(--w-surface);color:var(--w-text);font:16px/1.4 monospace;overflow-wrap:anywhere}
#game-data-dialog .feature-status{overflow-wrap:anywhere}
.w-material #game-data-dialog{width:min(440px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)))}
.game-data-explainer{font-size:16px;line-height:1.5;margin:0 0 16px}
.game-data-preview{font-size:15px;font-weight:700;line-height:1.5;margin:0 0 16px}
#game-data-dialog .feature-footer{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;flex-shrink:0;padding-top:8px}
#game-data-dialog .feature-footer .w-button{min-width:0;min-height:48px;font-size:16px;padding:8px}
@media (orientation:landscape) and (max-height:520px){
 .w-material #options-dialog{width:min(640px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)))}
 #options-dialog .feature-content{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);column-gap:16px}
 #options-dialog .audio-option{grid-column:1;gap:12px}
 #options-dialog .options-main{grid-column:1;grid-row:1;align-self:start}
 #options-dialog .options-data{grid-column:2;grid-row:1;align-self:start;margin:0;border-left:1px solid var(--w-divider);padding:0 0 0 16px}
 #options-dialog .options-data>.game-data-options:first-child{margin-top:0;border-top:0;padding-top:0}
}
/* Sync shares the Game data section style. */
.sync-summary{font-size:15px;margin:-4px 0 12px}
.sync-code{display:block;width:100%;box-sizing:border-box;border:1px solid var(--w-border);border-radius:12px;padding:12px 10px;margin:0 0 16px;background:var(--w-surface);color:var(--w-text);font:600 15px/1.4 ui-monospace,Menlo,monospace;letter-spacing:0;text-align:center}
.sync-code-display{user-select:all;-webkit-user-select:all}
.sync-code-groups{display:flex;justify-content:center;gap:6px;margin:0 0 16px}
.sync-code-group{box-sizing:border-box;flex:1 1 0;min-width:0;max-width:5.4em;min-height:48px;display:inline-grid;place-items:center;border:1px solid var(--w-border);border-radius:12px;padding:8px 2px;background:var(--w-surface);color:var(--w-text);font:600 17px/1.3 ui-monospace,Menlo,monospace;letter-spacing:.04em;text-align:center;text-transform:uppercase}
.sync-code-box::placeholder{color:var(--w-muted);opacity:.5}
.sync-garden-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0 0 16px}
.sync-garden-card{border:1px solid var(--w-border);border-radius:14px;padding:10px 12px;background:var(--w-surface)}
.sync-garden-card h4{font:700 15px/1.3 var(--w-font-ui);margin:0 0 6px}
.sync-garden-card p{font-size:14px;line-height:1.4;margin:0}
.sync-garden-card .sync-when{color:var(--w-muted);margin-top:4px}
.w-material #sync-dialog{width:min(440px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)))}
#sync-dialog .feature-status{overflow-wrap:anywhere}
#sync-dialog .feature-footer{display:grid;grid-template-columns:repeat(auto-fit,minmax(0,1fr));gap:8px;flex-shrink:0;padding-top:8px}
#sync-dialog .feature-footer .w-button{min-width:0;min-height:48px;font-size:15px;padding:8px}

/* Sorting shares Residents' existing header; its choices overlay the list. */
.resident-header-actions{display:flex;align-items:center;gap:4px;flex-shrink:0}
#residents-sort,#shop-sort{display:grid;place-items:center;width:44px;min-width:44px;height:48px;padding:9px}
#residents-sort svg,#shop-sort svg{width:24px;height:24px;fill:none;stroke:none}
/* Top-left corner, mirroring the close button, so sorting adds no height above the list. */
#scenery-shop #shop-sort{position:absolute;top:8px;left:8px;z-index:2}
#scenery-shop #shop-sort-menu{left:12px;right:auto}
#residents-dialog #residents-sort-menu,#scenery-shop #shop-sort-menu{position:absolute;right:12px;z-index:10;width:230px;max-width:calc(100% - 24px);box-sizing:border-box;border:1px solid var(--w-border);border-radius:20px;padding:12px;overflow-y:auto;overscroll-behavior:contain;box-shadow:0 5px 18px var(--w-lift)}
#residents-sort-menu[hidden],#shop-sort-menu[hidden]{display:none}
#residents-sort-menu button,#shop-sort-menu button{display:flex;justify-content:flex-start;box-shadow:none;align-items:center;gap:10px;width:100%;min-height:44px;padding:8px;border:0;border-radius:10px;font-size:14px;text-align:left;color:var(--w-text);background:transparent}
#residents-sort-menu button[aria-checked=true],#shop-sort-menu button[aria-checked=true]{background:var(--w-active-fill);font-weight:700}
.resident-sort-check{display:flex;width:18px;flex-shrink:0;visibility:hidden}
#residents-sort-menu .resident-sort-check svg,#shop-sort-menu .resident-sort-check svg{width:18px;height:18px;fill:none;stroke:none}
[aria-checked=true]>.resident-sort-check{visibility:visible}
@media(orientation:landscape){
 #residents-dialog .resident-header-actions{grid-column:3;grid-row:1;justify-self:end;margin-right:52px}
 #residents-dialog #residents-select{margin-right:0;padding:8px;min-width:60px}
}

/* Favorites use the title's existing left slot and a small Residents marker. */
#butterfly-favorite{position:absolute;left:0;top:50%;transform:translateY(-50%);width:48px;height:48px;min-width:48px;padding:10px;display:grid;place-items:center;color:var(--w-muted)}
#butterfly-favorite[hidden],.breeding-active #butterfly-favorite{display:none}
#butterfly-favorite svg.menu-emoji{width:26px;height:26px;fill:none;stroke:none}
#butterfly-favorite[aria-pressed=false] svg path{fill:none;stroke:currentColor;stroke-width:2;stroke-linejoin:round}
#butterfly-favorite[aria-pressed=true],.resident-favorite{color:var(--w-favorite,#9b7949)}
[data-theme=dark]{--w-favorite:#d1b77a}
.resident-favorite{position:absolute;top:7px;left:7px;z-index:2;width:18px;height:18px;pointer-events:none}
.resident-favorite svg.menu-emoji{display:block;width:18px;height:18px;fill:none;stroke:none}
.w-material #butterfly-focus:not(.breeding-active) .butterfly-details>.butterfly-heading{position:relative;min-height:48px;padding:0 48px}
#butterfly-focus:not(.breeding-active) #butterfly-close{top:50%;right:0;transform:translateY(-50%)}

/* Compact color-loss advice stays inside existing confirmation scroll regions. */
.color-loss-warning{font-size:14px;line-height:1.4;font-weight:600;color:var(--w-text);background:var(--w-paper,var(--w-canvas));border-left:3px solid var(--w-copper,#ad7650);border-radius:4px;padding:8px 10px;margin:8px 0;overflow-wrap:anywhere}

.color-loss-warning[hidden]{display:none}

/* Final confirmation repeats collection-loss warnings without another specimen card. */
/* .feature-dialog raises specificity over the short-landscape .feature-dialog:not(#expedition-dialog) width. */
#level-info-dialog.feature-dialog{width:min(380px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));padding:16px}
#level-info-dialog .feature-content{font-size:15px;line-height:1.5}
#level-info-dialog .feature-content p{margin:6px 0}
#level-info-dialog .w-title-patch{font-size:22px;line-height:28px}
#level-info-dialog .feature-footer .w-button{width:100%;min-height:48px}
.level-info-muted{color:var(--w-muted);font-size:14px}
.level-info-meter{display:grid;gap:6px;margin:12px 0;font-size:14px;font-weight:700}
.level-info-meter .player-level-progress{position:static;display:block;height:8px;border-radius:5px}
#collection-loss-dialog{width:min(380px,calc(100% - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));padding:16px}
#collection-loss-dialog .feature-content{font-size:15px;line-height:1.5}
#collection-loss-dialog .feature-content p{margin:4px 0}
#collection-loss-dialog .feature-footer{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#collection-loss-dialog .feature-footer .w-button{min-width:0;padding:8px;font-size:15px;min-height:48px}
#collection-loss-dialog .w-title-patch{font-size:22px;line-height:28px}

#residents-open{position:relative;overflow:visible}

/* Quiet publisher link, after all Options controls and inside their scroll area. */
.options-more-games{grid-column:1 / -1;display:flex;align-items:center;justify-content:center;gap:12px;min-height:52px;margin-top:12px;padding:10px 4px 0;border-top:1px solid var(--w-divider);color:var(--w-muted);font-size:14px;font-weight:700;text-decoration:none;border-radius:2px}
.options-more-games img{width:72px;height:auto;display:block;opacity:.65}
.options-more-games:hover{color:var(--w-text)}
.options-more-games:hover img{opacity:.85}
/* The apps' plain studio credit (no link). */
p.options-more-games:hover{color:var(--w-muted)}p.options-more-games:hover img{opacity:.65}
.options-more-games:focus-visible{outline:2px solid var(--w-focus);outline-offset:2px}
/* Soundtrack credits, the last thing in Options. */
.options-credits{grid-column:1 / -1;display:flex;flex-direction:column;align-items:center;margin-top:10px;padding:4px 4px 0;color:var(--w-muted);font-size:13px;text-align:center}
.options-credits p{margin:0 0 2px;font-weight:700}
.options-credits a{display:flex;align-items:center;justify-content:center;min-height:36px;padding:0 8px;color:inherit;text-decoration:none;border-radius:2px}
.options-credits a span{font-style:italic;margin-right:.3em}
.options-credits a:hover{color:var(--w-text)}
.options-privacy{grid-column:1 / -1;justify-self:center;display:flex;align-items:center;min-height:44px;padding:0 10px;color:var(--w-muted);font-size:13px;font-weight:700;text-decoration:underline;text-underline-offset:3px;border-radius:2px}
.options-privacy:hover{color:var(--w-text)}
.options-privacy:focus-visible{outline:2px solid var(--w-focus);outline-offset:2px}
.options-credits a:focus-visible{outline:2px solid var(--w-focus);outline-offset:2px}

/* One tracked request shares existing control rows rather than adding a panel. */
.request-chip{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:0;min-height:32px;padding:4px 8px;border:1px solid var(--w-border);border-radius:10px;background:#e6e9db;color:var(--w-text);font:600 12px/18px var(--w-font-ui);box-shadow:0 2px 0 var(--w-lift);cursor:pointer}
.request-chip[hidden],.resident-selection-heading .habitat-dialog-subtitle[hidden]{display:none}
.request-chip>.menu-emoji{width:18px;height:18px;flex-shrink:0}
.request-chip-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.request-chip-colors{display:flex;gap:3px;flex-shrink:0}
.request-chip-colors i{width:10px;height:10px;border-radius:50%;border:1px solid var(--w-border)}
.request-chip[data-ready="true"]{border-color:var(--w-text)}
[data-theme="dark"] .request-chip,[data-theme="dark"] .offspring-request-mark{background:#354e49}
.request-chip:focus-visible{outline:2px solid var(--w-focus);outline-offset:2px}
.breeding-request-toolbar{display:flex;justify-content:center;align-items:center;gap:8px}
.breeding-request-toolbar.has-request{justify-content:space-between}
/* With or without a tracked request, Change partner keeps its place on the right (was centred, or moved in landscape). */
.breeding-request-toolbar:not(.has-request){justify-content:flex-end}
.breeding-request-toolbar .breeding-change{font-size:12px;min-width:0;padding:4px 8px;flex-shrink:0}
.offspring-request-mark{position:absolute;right:4px;bottom:4px;z-index:5;width:24px;height:24px;display:grid;place-items:center;border-radius:50%;background:#e6e9db;border:1px solid var(--w-border);pointer-events:none}
.offspring-request-mark .menu-emoji{width:16px;height:16px}
.resident-request-mark{position:absolute;right:5px;top:35px;z-index:1;width:22px;height:22px;display:grid;place-items:center;border-radius:50%;background:#e6e9db;border:1px solid var(--w-border);pointer-events:none}
.resident-request-mark .menu-emoji{width:14px;height:14px}
[data-theme="dark"] .resident-request-mark{background:#354e49}
/* Combinations not yet in the journal: honey + disc, mirroring the request envelope.
   Bottom corners cover about a third as much wing as top corners across all breeds. Offsets put each badge
   tangent to the card's 24px outline corner (both discs 4px in). */
.offspring-new-mark{position:absolute;left:4px;bottom:4px;z-index:5;width:24px;height:24px;display:grid;place-items:center;border-radius:50%;background:#e8d4a6;border:1px solid #6a512e80;color:#6a512e;font:900 21px/1 var(--w-font-ui);pointer-events:none}
.mail-row{position:relative}
@media(orientation:landscape){#residents-dialog .resident-header>.resident-selection-heading>.request-chip{grid-column:1;grid-row:1;justify-self:start;max-width:100%}}
.offspring-option{position:relative}
@media(max-width:360px){
 #residents-dialog .resident-selection-heading{gap:6px}
 #residents-dialog .request-chip{gap:4px;padding-inline:6px}
 #residents-dialog #residents-select{min-width:60px;padding-inline:8px}
}
@media(orientation:landscape){
 .breeding-active:not(.partner-picking) .breeding-controls>.breeding-request-toolbar{grid-column:1/-1}
 .breeding-active:not(.partner-picking) .breeding-request-toolbar+.breeding-space{grid-column:1/-1;text-align:center;padding-bottom:4px}
}
.partner-tools{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 0 8px;flex-shrink:0}
.partner-tools[hidden]{display:none}
.partner-tools .request-chip{max-width:calc(100% - 56px)}
#partners-sort{width:48px;min-height:48px;padding:8px;margin-left:auto}
#partners-sort-menu{position:fixed;width:228px;z-index:20;overflow-y:auto}
#partners-sort-menu{max-width:calc(100% - 16px);box-sizing:border-box;border:1px solid var(--w-border);border-radius:20px;padding:12px;overscroll-behavior:contain;box-shadow:0 5px 18px var(--w-lift)}
#partners-sort-menu[hidden]{display:none}
#partners-sort-menu button{display:flex;justify-content:flex-start;box-shadow:none;align-items:center;gap:10px;width:100%;min-height:44px;padding:8px;border:0;border-radius:10px;font-size:14px;text-align:left;color:var(--w-text);background:transparent}
#partners-sort-menu button[aria-checked=true]{background:var(--w-active-fill);font-weight:700}
#partners-sort-menu .resident-sort-check svg{width:18px;height:18px;fill:none;stroke:none}
@media(orientation:landscape){
 .partner-picking .partner-header{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) 48px;align-items:center;gap:12px;padding-bottom:8px;flex-shrink:0}
 .partner-picking .partner-header .breeding-pinned{grid-column:2;grid-row:1;padding:0;justify-content:center}
 .partner-picking .partner-header .partner-tools{display:contents}
 .partner-picking .partner-header .request-chip{grid-column:1;grid-row:1;justify-self:start;max-width:100%}
 .partner-picking .partner-header #partners-sort{grid-column:3;grid-row:1}
}

/* A gentle sage tint distinguishes combinations still missing from the journal. */

.offspring-name{display:flex;align-items:center;justify-content:center;gap:7px;font-weight:700}
.offspring-color-dots{display:inline-flex;gap:4px;flex-shrink:0}
.offspring-color-dots i{display:block;width:10px;height:10px;border:1px solid var(--w-border);border-radius:50%;box-sizing:border-box}

.offspring-name strong{font-weight:700}

/* Keep mobile installation steps above the browser share sheet. */
#install-guide[data-mobile="true"]{top:max(8px,env(safe-area-inset-top));bottom:auto;margin-block:0;max-height:calc(50dvh - max(8px,env(safe-area-inset-top)));padding:12px 16px}
#install-guide[data-mobile="true"]>.w-menu-heading{margin-bottom:8px}
#install-guide[data-mobile="true"] .install-intro{margin:0 0 8px;text-align:left}
#install-guide[data-mobile="true"] h3{margin:0 0 8px}
#install-guide[data-mobile="true"] .feature-footer{flex-shrink:0;padding-top:8px;margin-top:0}
#install-guide[data-mobile="true"] #install-continue{min-height:40px;padding-block:6px}

#request-preview{width:min(360px,calc(100% - 32px));padding:20px}
#request-preview>.w-menu-heading{padding-top:0;margin-bottom:12px}
#request-preview .w-title-patch{font-size:24px}
#request-preview .feature-photo{width:min(100%,160px);max-width:160px;height:160px;object-fit:contain}
.request-preview-caption{display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center;font-size:19px;margin:8px 0}
#request-preview .request-chip-colors{display:flex;gap:6px}
#request-preview .request-chip-colors i{display:block;width:10px;height:10px;border-radius:50%;border:1px solid var(--w-border)}
#request-preview .feature-footer:empty{display:none}
#request-preview-send{width:100%}
@media(orientation:landscape) and (max-height:500px){
 #request-preview{width:min(480px,calc(100% - 32px));padding:12px 16px}
 #request-preview .feature-content{display:flex;align-items:center;gap:16px}
 #request-preview .feature-photo{width:46%;height:140px;flex-shrink:0}
 .request-preview-caption{flex:1;font-size:17px}
}

#install-guide[data-mobile="true"] .feature-footer:empty{display:none}
#install-guide[data-mobile="true"] .w-title-patch{font-size:20px;line-height:26px}

.options-community-link{grid-column:1 / -1;display:flex;align-items:center;justify-content:center;min-height:44px;margin-top:12px;padding:6px 4px;border-top:1px solid var(--w-divider);color:var(--w-muted);font-size:14px;font-weight:700;text-decoration:none;border-radius:2px}
.options-community-link:hover{color:var(--w-text)}
.options-community-link:focus-visible{outline:2px solid var(--w-focus);outline-offset:2px}
.options-community-link+.options-more-games{margin-top:0;padding-top:4px;border-top:0}

.options-community-link{gap:8px}
.options-discord-icon{display:inline-flex;flex-shrink:0}
.options-discord-icon svg{display:block;width:20px;height:20px}

#wing-tips-open{--menu-day-fill:#ece0ce;--menu-day-ink:#75583e;--menu-night-fill:#4b4339;--menu-night-ink:#e3c4a3;order:99}
#wing-tips-dialog{width:min(430px,calc(100% - 32px))}
#wing-tips-dialog .feature-content{text-align:center}
.wing-tips-latte{display:block;width:min(100%,150px);height:auto;aspect-ratio:1;margin:0 auto;border-radius:0}
.wing-tips-message{margin:8px 0 4px;line-height:1.5}
.wing-tips-studio{color:inherit;text-decoration:underline;text-underline-offset:2px}
span.wing-tips-studio{text-decoration:none}
.wing-tips-detail{font-size:13px;color:var(--w-muted);margin:8px 0}
#wing-tips-dialog .feature-footer>.w-button{width:100%}
#wing-tips-dialog:not(.wing-tips-picker) .w-menu-heading{padding-bottom:0}
#wing-tips-playtime{margin:0;line-height:1.25}
#wing-tips-playtime+.wing-tips-latte{margin-top:-12px}
.wing-tips-checkout-note{text-align:center;margin:8px 0 0}
/* App tips: larger sizes beside each other under the main Tip button. */
.wing-tips-sizes{display:flex;gap:8px;margin-top:8px}
.wing-tips-sizes>.w-button{flex:1 1 0;min-width:0}
.wing-tips-preview{display:block;width:100%;height:210px;background:var(--w-surface);border-radius:24px}
.wing-tips-caption{display:block;margin:10px 0;font-size:15px}
.wing-tips-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px;text-align:left}
.wing-tips-fields label{display:grid;gap:4px;font-size:13px;min-width:0}
.wing-tips-fields label:first-child{grid-column:1/-1}
.wing-tips-fields select{width:100%;min-width:0;min-height:44px;padding:8px 10px;font-size:16px}
@media (max-height:550px){.wing-tips-latte{width:90px}.wing-tips-preview{height:140px}}

/* Reward selection uses an opaque full-screen portrait, like butterfly focus. */
#wing-tips-dialog.wing-tips-picker{inset:0;margin:0;width:100%;height:100dvh;max-height:none;border:0;border-radius:0;box-shadow:none;background:var(--w-canvas);padding:max(16px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));align-items:center}
#wing-tips-dialog.wing-tips-picker>.w-menu-heading{width:min(680px,100%);box-sizing:border-box}
#wing-tips-dialog.wing-tips-picker .feature-content{width:min(680px,100%);flex:1;display:flex;flex-direction:column;align-items:center}
#wing-tips-dialog.wing-tips-picker .wing-tips-preview{width:100%;height:clamp(200px,45dvh,580px);flex:1 0 200px;background:transparent;border-radius:0;touch-action:none;cursor:grab}
#wing-tips-dialog.wing-tips-picker .wing-tips-preview:active{cursor:grabbing}
#wing-tips-dialog.wing-tips-picker .wing-tips-fields{width:min(480px,100%);box-sizing:border-box;padding:16px;border:1px solid var(--w-border);border-radius:20px;background:var(--w-surface);flex-shrink:0}
#wing-tips-dialog.wing-tips-picker .feature-footer{width:min(480px,100%);flex-shrink:0}
#wing-tips-dialog.wing-tips-picker .wing-tips-caption{flex-shrink:0}
@media(orientation:landscape) and (min-width:650px){
 #wing-tips-dialog.wing-tips-picker .feature-content{width:min(1000px,100%);display:grid;grid-template-columns:minmax(0,1.3fr) minmax(260px,1fr);grid-template-rows:auto 1fr;column-gap:24px}
 #wing-tips-dialog.wing-tips-picker .wing-tips-preview{grid-row:1/3;height:100%;min-height:180px}
 #wing-tips-dialog.wing-tips-picker .wing-tips-fields{align-self:start}
}

#backup-reminder{width:min(420px,calc(100% - 32px))}
#backup-reminder .feature-footer{display:flex;gap:12px}
#backup-reminder .feature-footer .w-button{flex:1}

.journal-rainbow-dot{display:inline-block;width:12px;height:12px;margin-right:4px;vertical-align:-1px;border-radius:50%;background:conic-gradient(#ef6262,#f4ca59,#73bd79,#62b9df,#9d7bd5,#ef6262);box-shadow:inset 0 0 0 1px #0002}

#game-save-diagnostics{grid-column:1 / -1;justify-self:center}

/* Monthly support totals stay in the existing scrollable menu content. */
.wing-tips-stats{margin:16px 0 4px;padding:14px 12px 4px;border-top:1px solid var(--w-border);text-align:left}
.wing-tips-stats h3{margin:0 0 10px;font-size:16px;text-align:center}
.wing-tips-stats dl{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px 12px;margin:0;font-size:14px}
.wing-tips-stats dt,.wing-tips-stats dd{margin:0}
.wing-tips-stats dd{font-weight:700;text-align:right;font-variant-numeric:tabular-nums}
.wing-tips-news-link{display:block;margin:-6px auto -4px;min-height:48px;padding:4px 12px;border:0;background:none;color:var(--w-text);font:600 14px/18px var(--w-font-ui);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.wing-tips-news-link:focus-visible{outline:2px solid var(--w-focus);outline-offset:2px;border-radius:8px}
/* Restore Purchases (Wings Supporter): a quiet link under the purchase button. */
.wing-tips-restore{display:block;margin:0 auto;min-height:44px;padding:4px 14px;border:0;background:none;color:var(--w-muted);font:700 14px/18px var(--w-font-ui);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.wing-tips-restore:hover:not(:disabled){color:var(--w-text)}
.wing-tips-restore:focus-visible{outline:2px solid var(--w-focus);outline-offset:2px;border-radius:8px}
.wing-tips-restore:disabled{opacity:.55;cursor:default}
.changelog-section{text-align:left;padding:12px 4px 4px}
.changelog-section+.changelog-section{border-top:1px solid var(--w-border)}
.changelog-section h3{margin:0 0 6px;font-size:15px}
.changelog-notes{list-style:none;margin:0;padding:0;display:grid;gap:5px;font-size:14px;line-height:1.45}
.changelog-notes li{position:relative;padding-left:20px}
.changelog-notes li::before{content:"";position:absolute;left:4px;top:.55em;width:7px;height:7px;border-radius:50%;background:var(--w-brand);box-shadow:0 0 0 1.5px color-mix(in srgb,var(--w-brand) 45%,transparent)}
@media(forced-colors:active){.changelog-notes li::before{background:CanvasText;box-shadow:none}}
.wing-tips-discord{grid-column:1 / -1;position:relative;display:flex;justify-content:space-between;align-items:center;gap:12px}
.wing-tips-discord dt,.wing-tips-discord dd{margin:0}
.wing-tips-discord dt{display:flex}
.wing-tips-discord a{display:inline-flex;align-items:center;gap:6px;color:inherit;text-decoration:none}
/* Stretch the tap target over the whole row, at least 44px tall, without changing row spacing. */
.wing-tips-discord a::after{content:'';position:absolute;inset:max(-12px,calc((100% - 44px) / 2)) 0}
.wing-tips-discord a span:last-child{text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
.wing-tips-discord:hover a span:last-child{text-decoration-thickness:2px}
.wing-tips-discord a:focus-visible{outline:none}.wing-tips-discord:has(a:focus-visible){outline:2px solid var(--w-focus);outline-offset:3px;border-radius:4px}
.wing-tips-discord-mark{display:inline-flex;color:#5865F2}.wing-tips-discord-mark svg{display:block;width:17px;height:17px}
.wing-tips-stats .wing-tips-detail{text-align:center;font-size:11px;line-height:1.4}

#wing-tips-open{position:relative}
.wing-tips-badge{width:21px;padding:0;display:grid;place-items:center;line-height:1;text-align:center;color:#854b50}
.wing-tips-badge[hidden]{display:none}

.resident-context{display:flex;flex-direction:column;align-items:flex-start;gap:4px;min-width:0;flex:1}
#residents-dialog .resident-context .habitat-dialog-subtitle{margin:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.resident-context .request-chip{max-width:100%;box-sizing:border-box;overflow:hidden}
@media(orientation:landscape){#residents-dialog .resident-context{grid-column:1;grid-row:1}}

#residents-dialog .resident-mark{position:relative}
.resident-new{position:absolute;left:50%;bottom:0;transform:translateX(-50%);padding:1px 8px;border-radius:12px;background:#e8d4a6;color:#6a512e;font:700 10px/13px var(--w-font-ui);letter-spacing:.2px;pointer-events:none}

/* Explain random offspring before the previews, while keeping inspection separate. */
.offspring-intro .w-menu-heading{padding:0;margin:0 0 8px}
.offspring-intro .w-title-patch{font-size:21px;line-height:1.3;padding:7px 12px;margin:0}
.offspring-explanation{font:13px/1.4 var(--w-font-ui);margin:0 auto 10px;padding:10px 12px;border-radius:14px;background:#f1d49c;color:#664b28;max-width:360px}
.offspring-explanation[hidden],.breeding-recommendation[hidden]{display:none}
.breeding-active .offspring-caption{padding:8px 12px;margin-top:8px}
.breeding-recommendation{font:12px/1.4 var(--w-font-ui);margin:4px 0 8px;color:var(--w-text);grid-column:1/-1}
/* Reserve three text lines before breeding, including the wrapped countdown. */
.breeding-message{box-sizing:border-box;min-height:68px;padding:8px 10px;line-height:1.4}
.breeding-message:empty{display:block}
/* Full garden: breeding is disabled, so the space kept for a post-breeding message isn't needed. */
.breeding-guidance:not([hidden])~.breeding-message:empty{min-height:0;padding:0}
.breeding-controls .breeding-guidance{font-size:14px;line-height:20px}
.breeding-recommendation.was-visible[hidden]{display:block;visibility:hidden}
.breeding-success{padding:8px 10px;border-radius:12px;background:#e2e9d6;color:#344d3f}
.breeding-success strong,.breeding-success span{display:block}
.breeding-success span{font-size:12px}
[data-theme="dark"] .breeding-success{background:#354e49;color:#eceddf}
@media(orientation:portrait){
 #butterfly-focus.breeding-active:not(.partner-picking){display:flex;flex-direction:column;gap:8px}
 .breeding-active:not(.partner-picking) .butterfly-display{display:flex;flex-direction:column;flex:1 1 auto;min-height:0;height:auto}
 .breeding-active:not(.partner-picking) #butterfly-portrait{flex:1 1 180px;width:180px;min-height:60px;max-height:180px}
 .breeding-active:not(.partner-picking) .breeding-parent-names{margin:4px 0 8px}
 .breeding-active:not(.partner-picking) .breeding-offspring{flex:0 1 auto;min-height:0}
 .breeding-active:not(.partner-picking) .offspring-grid{flex:0 1 auto;min-height:64px;overflow:auto}
 .breeding-active:not(.partner-picking) .butterfly-lower{flex:0 0 auto;height:auto;max-height:48dvh}
}
@media(orientation:landscape) and (max-height:500px){
 #butterfly-focus.breeding-active:not(.partner-picking)[open]{--breed-parent-size:80px}
 .breeding-active:not(.partner-picking) .offspring-grid{grid-template-columns:repeat(var(--offspring-columns,4),minmax(0,1fr));grid-template-rows:none;grid-auto-rows:max-content}
 .breeding-active:not(.partner-picking) .breeding-offspring{justify-content:center}
}

@media(orientation:landscape){.breeding-active:not(.partner-picking) .breeding-offspring{justify-content:center}}

/* Keep native image/text drags out of the breeding controls; retain touch scrolling. */
.breeding-panel{user-select:none;-webkit-user-select:none}
.breeding-panel img{-webkit-user-drag:none}

.options-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;grid-column:1}
.options-actions .w-button{min-width:0;padding:8px;font-size:14px;white-space:normal}

.request-preview-carousel{display:flex;align-items:center;justify-content:center;width:100%;gap:8px}
#request-preview .request-preview-carousel .feature-photo{width:calc(100% - 112px);flex:1;min-width:0}
.request-preview-arrow{flex:0 0 48px;width:48px;min-width:48px;padding:8px;font-size:30px}
.request-preview-arrow[hidden]{display:none}
#request-preview .request-preview-carousel:has(.request-preview-arrow[hidden]) .feature-photo{width:100%;flex:initial}
@media(orientation:landscape) and (max-height:520px){.request-preview-carousel{width:55%;flex-shrink:0}}

/* Counts stay outside the scrolling cards and double as section shortcuts. */
.resident-counts{display:flex;align-items:center;justify-content:space-between;gap:4px;flex-shrink:0;padding:0 4px;margin:0 0 4px}
#residents-dialog .resident-counts .w-button{min-width:0;min-height:44px;padding:4px 2px;border:0;background:transparent;box-shadow:none;font-size:14px;font-weight:700;white-space:nowrap}
@media(hover:hover){#residents-dialog .resident-counts .w-button:hover{background:var(--w-active-fill)}}
#residents-dialog .resident-counts .w-button:focus-visible{outline:2px solid var(--w-focus);outline-offset:-2px}
@media(max-width:360px){#residents-dialog .resident-counts .w-button{font-size:12px}}
@media(max-width:340px){#residents-dialog .resident-counts .w-button{font-size:11px}}
#residents-dialog .resident-counts .resident-count-full{color:var(--w-focus)}

@media (any-pointer:coarse) and (min-width:700px) and (min-height:600px) {
  #residents-dialog .resident-header-actions .w-button { min-height:44px;min-width:44px; }
  #residents-dialog #residents-select { min-width:64px; }
}

/* Move scenery: a block from the current garden is explained once, above the destinations. */
#habitat-transfer .transfer-block{margin:0 0 12px;padding:12px 14px;border:1px solid var(--w-border);border-radius:14px;background:var(--w-inset);font-size:15px;line-height:1.45;text-align:left}
/* Stamps: collectible postage from mailbox letters. */
.stamp-art{position:relative;display:inline-block;line-height:0;filter:drop-shadow(0 1px 2px rgba(40,30,20,.3))}
.stamp-art img{display:block;width:100%;height:auto}
.stamp-postmark{position:absolute;inset:9% 9%;overflow:hidden;pointer-events:none;mix-blend-mode:multiply}
.stamp-postmark svg{width:100%;height:100%;display:block}
.stamp-postmark{opacity:.55}
.stamp-placeholder{display:flex;align-items:center;justify-content:center;border:1.5px dashed var(--w-border);border-radius:4px;color:var(--w-muted);font:600 18px var(--w-font-ui);opacity:.7}
.journal-collections{display:grid;grid-template-columns:minmax(0,1fr);gap:16px;margin:0 0 12px;padding:8px 8px 0 0}
@media (orientation:landscape){.journal-collections{grid-template-columns:repeat(2,minmax(0,1fr))}}
.journal-stamps{position:relative;width:100%;display:grid;grid-template-columns:52px minmax(0,1fr) auto;row-gap:2px;column-gap:14px;align-items:center;text-align:left;color:inherit;border:1px solid var(--w-border);border-radius:18px;padding:10px 16px 10px 12px;cursor:pointer;font:inherit;min-height:48px}
.journal-stamps:hover{background-color:var(--w-active-fill)}
.journal-stamps:focus-visible{outline:2px solid var(--w-focus);outline-offset:2px}
.journal-stamps>.stamp-art,.journal-stamps>.stamp-placeholder{grid-row:1/4;width:44px;justify-self:center;transform:rotate(-4deg)}
.journal-stamps>.stamp-placeholder{height:54px}
.journal-stamps strong{font:500 20px/26px var(--w-font-heading)}
.journal-stamps-pct{font-size:13px;color:var(--w-muted);justify-self:end}
.journal-stamps progress{grid-column:2/4;width:100%;height:5px;appearance:none;border:0;border-radius:4px;overflow:hidden;background:var(--w-divider);margin:4px 0}
.journal-stamps progress::-webkit-progress-bar{background:var(--w-divider)}.journal-stamps progress::-webkit-progress-value{background:var(--w-border);border-radius:4px}
.journal-stamps progress::-moz-progress-bar{background:var(--w-border)}
.journal-stamps small{grid-column:2/4;font-size:13px;color:var(--w-muted);overflow-wrap:anywhere}
.journal-stamps .stamp-badge{position:absolute;right:-6px;top:-6px;left:auto;bottom:auto;grid-area:auto;display:flex;align-items:center;justify-content:center;padding:0 5px;font:800 12px/1 var(--w-font-ui);text-align:center}
#journal-dialog .journal-collections+.feature-subtitle{margin-top:4px}
.stamp-sender{margin:0 0 18px}.stamp-sender h3{font:500 18px/24px var(--w-font-heading);margin:0}
.stamp-sender-place{margin:0 0 10px;font-size:13px;color:var(--w-muted)}
.stamp-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;align-items:center;padding:8px 8px 0}
.stamp-cell{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:4/5;padding:0;border:0;background:none;color:inherit;font:inherit;min-height:48px}
button.stamp-cell{cursor:pointer;border-radius:6px}
button.stamp-cell:focus-visible{outline:2px solid var(--w-focus);outline-offset:3px}
.stamp-cell>.stamp-art{max-width:100%}
.stamp-blank{display:block;width:100%;color:var(--w-border);opacity:.8}.stamp-blank svg{display:block;width:100%;height:auto}
.stamp-new-tag{position:absolute;top:-6px;left:-4px;z-index:2;padding:0 5px;border-radius:8px;background:var(--w-primary);color:var(--w-on-primary);font:800 10px/16px var(--w-font-ui)}
.stamp-detail{margin:0;display:flex;flex-direction:column;align-items:center;gap:14px;padding:8px 0}
.stamp-detail>.stamp-art{width:min(240px,62vw);transform:rotate(-2deg)}
.stamp-detail figcaption{text-align:center}.stamp-detail figcaption p{margin:2px 0}
.stamp-detail-tier{font-weight:700}.stamp-detail-tier .stamp-detail-from,.stamp-detail-date{color:var(--w-muted);font-size:14px}
.letter-stamp{float:right;position:relative;width:50px;margin:0 6px 6px 12px;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer;transform:rotate(4deg);border-radius:4px}
.letter-stamp::before{content:'';position:absolute;inset:-6px 0}
.letter-stamp:focus-visible{outline:2px solid var(--w-focus);outline-offset:3px}
.letter-stamp>.stamp-art{width:100%}
.letter-stamp-new{position:absolute;left:50%;bottom:-11px;transform:translateX(-50%);white-space:nowrap;padding:0 6px;border-radius:8px;background:var(--w-primary);color:var(--w-on-primary);font:800 10px/16px var(--w-font-ui)}
.letter-stamp--new{margin-bottom:14px}
/* Sewn cards make direct children position:relative; re-pin stamp corner marks. */
.stamp-cell>.stamp-new-tag,.w-material .w-sewn.journal-stamps>.stamp-badge{position:absolute;z-index:2}
.w-material .w-sewn.journal-stamps>.stamp-art{display:inline-block}
.envelope-stamp{flex:0 0 auto;width:40px;display:flex;justify-content:center;transform:rotate(4deg);margin-right:2px}
.envelope-stamp>.stamp-art{width:100%}.envelope-stamp>.stamp-blank{width:36px;opacity:1;color:var(--w-muted)}.envelope-stamp>.stamp-blank path{stroke-width:2.2}

/* Status messages (e.g. "Loaded your garden…") stay clear of the toolbar:
   above a row of buttons, between the screen edges beside a column. */
body.home-toolbar-wide #status{bottom:calc(28px + env(safe-area-inset-bottom) + var(--home-toolbar-height,48px))}
body:not(.home-toolbar-wide) #status{left:calc(32px + env(safe-area-inset-left) + var(--home-toolbar-width,48px));right:calc(32px + env(safe-area-inset-right) + var(--home-toolbar-width,48px))}
/* Choose a partner uses the same list width as Residents, so both show the same number of butterflies across
   (Residents: min(920px, viewport − insets) minus 70px of padding; insets are 56px a side with several gardens). */
@media (orientation: landscape), (min-width: 601px) {
  body[data-gardens] .partner-picking .breeding-partners{width:100%;margin-inline:auto;max-width:calc(min(920px, 100vw - 32px) - 54px)}
  body[data-gardens=many] .partner-picking .breeding-partners{max-width:calc(min(920px, 100vw - 112px) - 54px)}
}

/* Wing Tips letter: Change beside Place chrysalis, and the change page's preview. */
.letter-tip-buttons{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}
.tip-change-photo{display:flex;justify-content:center}
.tip-change-photo .feature-photo{width:min(192px,50vw);height:auto}
#mailbox-dialog .wing-tips-fields{margin-top:8px}
@media (orientation:landscape) and (max-height:500px){
 .tip-change{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:16px;align-items:center}
 .tip-change-photo .feature-photo{width:min(150px,22vw)}
 #mailbox-dialog .tip-change .wing-tips-fields{margin-top:0}
}
/* Invitations (invite links) look like invitations, not ordinary mail: a gold-edged
   card with a wax seal in the Mailbox, and matching stationery when opened. */
:root{--invite-paper:#FFF8EA;--invite-paper-2:#F6E8CF;--invite-gold:#B98A3E;--invite-gold-soft:#B98A3E66;--invite-wax:#A4483A;--invite-wax-light:#C9685A;--invite-kicker:#8E6A2C}
[data-theme="dark"]{--invite-paper:#33504D;--invite-paper-2:#2A4644;--invite-gold:#D9B26A;--invite-gold-soft:#D9B26A55;--invite-wax:#B9564A;--invite-wax-light:#D87A6C;--invite-kicker:#E3C489}
.mail-envelope.mail-invite{background:linear-gradient(135deg,var(--invite-paper),var(--invite-paper-2));border-color:var(--invite-gold);box-shadow:inset 0 0 0 3px var(--invite-paper),inset 0 0 0 4px var(--invite-gold-soft),0 2px 0 var(--w-lift)}
.mail-envelope.mail-invite:hover{background:linear-gradient(135deg,var(--invite-paper-2),var(--invite-paper))}
.invite-kicker{font:700 11px/1 var(--w-font-ui);letter-spacing:.14em;text-transform:uppercase;color:var(--invite-kicker)}
.mail-invite .envelope-mark .wax-seal,.wax-seal{width:40px;height:40px;filter:drop-shadow(0 1px 1px #0003)}
.wax-seal .wax-seal-edge{fill:var(--invite-wax);stroke:none}
.wax-seal .wax-seal-ring{fill:none;stroke:var(--invite-wax-light);stroke-width:1.6}
.wax-seal .wax-seal-mark{fill:none;stroke:var(--invite-wax-light);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.handwritten-letter.invite-letter{position:relative;display:block;margin:20px 2px 0;padding:28px 18px 16px;border:1px solid var(--invite-gold);border-radius:14px;background:linear-gradient(160deg,var(--invite-paper),var(--invite-paper-2));box-shadow:inset 0 0 0 4px var(--invite-paper),inset 0 0 0 5px var(--invite-gold-soft)}
.invite-letter .letter-copy{display:block}
.invite-letter-seal{position:absolute;top:-14px;left:50%;transform:translateX(-50%)}
.invite-letter-seal .wax-seal{width:48px;height:48px}
.invite-letter .invite-progress{font-family:var(--w-font-ui);font-size:15px;color:var(--invite-kicker);border-top:1px dashed var(--invite-gold-soft);padding-top:10px}
.mail-badge[data-invite=true]{min-width:14px;width:14px;height:14px;padding:0;right:-3px;top:-3px;border-radius:50%;background:var(--invite-wax);border:2px solid var(--invite-paper)}
/* Request letter footer on narrow phones (e.g. a Galaxy S26 with larger display zoom):
   keep the reward to whole phrases, both buttons on one row and the letter readable. */
.letter-reward{flex-wrap:wrap;column-gap:6px;row-gap:2px}
.letter-reward-coins,.letter-reward-points{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.letter-reward-points::before{content:'·';margin-right:4px;color:var(--w-muted)}
.letter-tip-buttons{flex-wrap:nowrap}
.letter-tip-buttons>.w-button{flex:0 1 auto;min-width:0}
@media (max-width:379px){.letter-reward-label{display:none}}
@media (max-width:359px){
 .letter-tip-buttons>.w-button{padding-inline:14px}
 #mailbox-dialog #letter-send-help{display:none}
}
.color-guide-swatch[data-effect=glitter]{background:radial-gradient(circle at 18% 28%,#fff 0 1.6px,transparent 2.6px),radial-gradient(circle at 42% 62%,#ffc6ea 0 1.6px,transparent 2.6px),radial-gradient(circle at 68% 24%,#ffe58a 0 1.4px,transparent 2.4px),radial-gradient(circle at 82% 66%,#9ff0ff 0 1.4px,transparent 2.4px),radial-gradient(circle at 58% 86%,#fff 0 1.2px,transparent 2.2px),radial-gradient(circle at 30% 84%,#ffe58a 0 1px,transparent 2px),linear-gradient(135deg,#5a3d74,#2f3a66)}
/* Small colour dots (Residents cards, butterfly details) show special finishes too. */
:is(.resident-swatches,#butterfly-colors) i[data-effect=metallic]{background:linear-gradient(125deg,var(--swatch) 10%,#fff5dd 40%,var(--swatch) 55%,#665e56 100%)}
:is(.resident-swatches,#butterfly-colors) i[data-effect=glass]{background:linear-gradient(135deg,#ffffffdd,#c9dcdc 55%,#ffffffaa)}
:is(.resident-swatches,#butterfly-colors) i[data-effect=iridescence]{background:linear-gradient(125deg,#a6d9cb,#a4d6e7,#b6a0d7,#e4b7d1,#ebd29f)}
#butterfly-colors i[data-effect=glitter]{background:radial-gradient(circle at 30% 30%,#fff 0 1.1px,transparent 1.9px),radial-gradient(circle at 70% 62%,#ffc6ea 0 1.1px,transparent 1.9px),radial-gradient(circle at 66% 26%,#ffe58a 0 .9px,transparent 1.6px),radial-gradient(circle at 34% 72%,#9ff0ff 0 .9px,transparent 1.6px),linear-gradient(135deg,#5a3d74,#2f3a66)}
/* Residents card dots are only 12px: smaller flecks so the dark base still shows. */
.resident-swatches i[data-effect=glitter]{background:radial-gradient(circle at 30% 32%,#fff 0 .55px,transparent 1.1px),radial-gradient(circle at 68% 60%,#ffc6ea 0 .55px,transparent 1.1px),radial-gradient(circle at 62% 26%,#ffe58a 0 .45px,transparent .95px),radial-gradient(circle at 36% 72%,#9ff0ff 0 .45px,transparent .95px),linear-gradient(135deg,#5a3d74,#2f3a66)}

/* Hand-sewn material (Round 20, approved 7 October 2026): linen panels with one
   real-thread seam, paper for the things you pick, sewing-box controls.
   Shared tokens and the seam itself live in design/material.css. */
.w-material :is(.habitat-dialog,#scenery-shop,.feature-dialog,.butterfly-sheet,#decor-sale,#decor-heading,.onboarding-card,.loading-panel,#update-notice).w-sewn:not(#expedition-dialog){border-color:var(--w-panel-edge);border-radius:18px;box-shadow:var(--w-panel-shadow)}
/* Sort popovers float like small panels: warm edge, soft shadow, no seam. */
#residents-dialog #residents-sort-menu,#scenery-shop #shop-sort-menu,#butterfly-focus #partners-sort-menu{border-color:var(--w-panel-edge);border-radius:14px;box-shadow:0 14px 30px -12px rgba(26,38,28,.5),0 2px 0 var(--w-lift)}
/* Items inside a panel stop repeating its seam. */
.w-material :is(.journal-breed,.journal-stamps,.offspring-caption,.resident-sort-menu,.transfer-result).w-sewn::after{display:none}
/* Paper cards: no outline, a hairline paper edge and a short contact shadow.
   Hover, current, selected and ready states keep their own fills and borders. */
.resident-row,.habitat-row,.mail-envelope:not(.mail-invite),.color-guide-color,.sync-garden-card,#habitat-transfer .transfer-block{border-color:transparent;border-radius:9px;box-shadow:var(--w-paper-shadow)}
.resident-row,.habitat-row,.mail-envelope:not(.mail-invite),.color-guide-color,.sync-garden-card{background-color:var(--w-paper)}
/* Special butterflies keep their gold edge on paper cards (after the rule above, which would clear it);
   doubles add a second line. Select mode's outline still wins. */
.special-resident{--special-edge:#C9962E;border-color:var(--special-edge);box-shadow:inset 0 0 0 1px var(--special-edge),var(--w-paper-shadow)}
.special-resident.special-double{box-shadow:inset 0 0 0 1px var(--special-edge),inset 0 0 0 3px var(--w-paper),inset 0 0 0 5px var(--special-edge),var(--w-paper-shadow)}
.w-material :is(.journal-breed,.journal-stamps).w-sewn{border-color:transparent;border-radius:9px;background-color:var(--w-paper);background-image:none;box-shadow:var(--w-paper-shadow)}
.w-material :is(.journal-breed,.journal-stamps).w-sewn:hover{background-color:var(--w-active-fill)}
.mail-envelope[data-ready=true]{border-color:var(--w-focus);box-shadow:inset 0 0 0 1px var(--w-focus),0 6px 10px -8px rgba(92,70,40,.3)}
/* Specimen and garden names read like collector's labels. */
.resident-card strong,.habitat-row strong{font-family:var(--w-font-heading);font-weight:500;letter-spacing:-.005em}
/* Lighter reorder chevrons let garden names lead each row. */
.garden-order-button{color:color-mix(in srgb,var(--w-muted) 70%,transparent)}
/* Switches: a four-hole sewing button on a stitched track. */
.audio-switch{border-color:var(--w-button-edge);background-image:linear-gradient(90deg,transparent 8px,color-mix(in srgb,var(--w-text) 22%,transparent) 8px calc(100% - 8px),transparent calc(100% - 8px));background-size:100% 1px;background-position:center;background-repeat:no-repeat}
.audio-option input:checked+.audio-switch{background-color:#5F7A5C;background-image:repeating-linear-gradient(90deg,rgba(255,246,228,.6) 0 3.5px,transparent 3.5px 6.5px);background-size:calc(100% - 18px) 1.3px;background-position:center;background-repeat:no-repeat}
body[data-theme=dark] .audio-option input:checked+.audio-switch{background-color:#7E9C78}
.audio-switch::after{background:radial-gradient(circle at 40% 40%,#7A6247 0 1.1px,transparent 1.5px),radial-gradient(circle at 60% 40%,#7A6247 0 1.1px,transparent 1.5px),radial-gradient(circle at 40% 60%,#7A6247 0 1.1px,transparent 1.5px),radial-gradient(circle at 60% 60%,#7A6247 0 1.1px,transparent 1.5px),radial-gradient(circle,#FBF1E0 0 58%,#E5CFAE 60% 100%);box-shadow:0 1px 2px rgba(40,30,15,.35),inset 0 0 0 1px rgba(120,88,55,.35)}
/* Progress is a tape measure. */
:is(.journal-breed,.journal-stamps) progress{height:8px;border-radius:1px;box-shadow:0 0 0 1px rgba(112,82,50,.22)}
:is(.journal-breed,.journal-stamps) progress::-webkit-progress-bar{border-radius:1px;background:repeating-linear-gradient(90deg,var(--w-tape-tick) 0 1px,transparent 1px 6px) 0 0/100% 3px no-repeat,var(--w-tape)}
:is(.journal-breed,.journal-stamps) progress::-webkit-progress-value{border-radius:1px;background:repeating-linear-gradient(90deg,rgba(90,60,30,.35) 0 1px,transparent 1px 6px) 0 0/100% 3px no-repeat,var(--w-tape-fill)}
:is(.journal-breed,.journal-stamps) progress::-moz-progress-bar{border-radius:1px;background:repeating-linear-gradient(90deg,rgba(90,60,30,.35) 0 1px,transparent 1px 6px) 0 0/100% 3px no-repeat,var(--w-tape-fill)}
.level-info-meter .player-level-progress{height:9px;border-radius:1px;background:repeating-linear-gradient(90deg,var(--w-tape-tick) 0 1px,transparent 1px 6px) 0 0/100% 3px no-repeat,var(--w-tape);box-shadow:0 0 0 1px rgba(112,82,50,.22)}
.level-info-meter .player-level-progress::before{border-radius:1px;background:repeating-linear-gradient(90deg,rgba(90,60,30,.35) 0 1px,transparent 1px 6px) 0 0/100% 3px no-repeat,var(--w-tape-fill)}
/* Handwriting, not an uppercase landing-page kicker. */
.invite-kicker{font:600 21px/1 'Wings Letter',cursive;letter-spacing:0;text-transform:none}
/* Corner controls stay inside the seam (its centreline is 8.5px in). */
.habitat-dialog .dialog-close,#scenery-shop-close,.breeding-close,.w-material .feature-dialog>.feature-close{top:12px;right:12px}
#scenery-shop #shop-sort{top:16px;left:16px}
@media (max-width:340px){#scenery-shop .w-menu-heading{padding-inline:52px}}
/* Close buttons light up as a round 38px fill, so even a heading-centred ×
   in a short landscape panel never paints over the seam. */
.w-material :is(.dialog-close,.feature-close,.breeding-close,#butterfly-close,#scenery-shop-close).w-button--quiet:active:not(:disabled){background:radial-gradient(circle,var(--w-inset) 18.5px,transparent 19px)}
@media (hover:hover){.w-material :is(.dialog-close,.feature-close,.breeding-close,#butterfly-close,#scenery-shop-close).w-button--quiet:hover:not(:disabled){background:radial-gradient(circle,var(--w-inset) 18.5px,transparent 19px)}}
@media (orientation:landscape) and (max-height:500px){#habitats-dialog .habitat-purchase-note{margin-bottom:-6px}}
@media (forced-colors:active){.audio-switch,.audio-option input:checked+.audio-switch{background-image:none}}
/* Coin balance in the Breed panel's title row, mirroring the × on the right (the header is hidden
   while breeding). Partner picking doesn't need it. */
.breeding-balance{display:none;position:absolute;top:12px;left:18px;z-index:2;height:48px;margin:0;align-items:center;font-size:14px}
.breeding-active:not(.partner-picking) .breeding-balance{display:flex}
.breeding-balance .coin-amount{gap:4px}
.breeding-balance .coin-amount .coin-icon{width:20px;height:20px}
@media (max-width:359px),(orientation:landscape) and (max-height:500px){.breeding-balance{font-size:12px;left:16px}.breeding-balance .coin-amount{gap:3px}.breeding-balance .coin-amount .coin-icon{width:16px;height:16px}}
/* Level 1 with one scenery: Scenery/Shop count the affordable scenery with chrysalis spots (mail-badge style). */
.scenery-badge[hidden],.scenery-card[hidden]{display:none}
.journal-overall{font-weight:700;color:var(--w-text);margin-bottom:0}
