/* Shared rhythm. Compact game controls and illustrated scene coordinates keep
   their own geometry; reading panels use minimum physical spacing on phones. */
:root{--space-xs:4px;--space-sm:8px;--space-md:12px;--space-lg:16px;--space-xl:24px;--space-2xl:32px;--reading-leading:1.55;--heading-leading:1.2}
.story-shell:not(.compact-workshop) p{line-height:var(--reading-leading)}
.story-shell:not(.compact-workshop) :is(h1,h2,h3){line-height:var(--heading-leading)}
.story-shell:not(.compact-workshop) button{line-height:1.3}
.story-shell:not(.compact-workshop) small{line-height:1.4}
.story-paper{padding-bottom:32px}
.story-shell>.story-paper:last-of-type{margin-bottom:12px}
.story-paper>h2{margin-top:24px;margin-bottom:12px}
.story-paper>h2:first-child{margin-top:0}
.story-paper>p+button,.story-paper>article+button,.story-paper>section+button{margin-top:12px}
.story-paper>.story-primary+.story-soft,.story-paper>.story-soft+.story-soft{margin-top:12px}
.story-shell .story-primary,.story-shell .story-soft{line-height:1.3}
.story-shell .recipe-result h2{line-height:1.25}
.recipe-hero h2{line-height:1.18}.recipe-hero p{margin-top:10px}
.recipe-card,.request-card{padding:18px}
.recipe-card>p{margin:12px 0 14px}
.recipe-ingredients{padding:10px;gap:8px}
.recipe-buttons{gap:10px;margin-top:4px}
.recipe-buttons button{margin-top:10px}
.recipe-ingredient small{margin-top:5px}
.request-card+.request-card{margin-top:20px}
.request-card h2{margin:10px 0 12px}
.request-card>p{margin:0 0 16px}
.request-progress{margin:16px 0 20px}
.request-card>h3{margin:16px 0 12px}
.request-item{gap:16px;margin:0 0 12px}
.request-reward{margin:4px 0 12px;padding:12px}
.request-card>.story-primary{margin-top:12px}
.request-card>.story-soft{margin-top:10px}
.request-echo{line-height:1.55;padding:14px;margin:16px 0}
.estate-heading h2{margin:8px 0 12px;line-height:1.2}
.estate-heading p{margin:0;line-height:1.6}
.estate-stage-title{margin-top:24px;margin-bottom:16px}
.estate-gate{padding:16px;margin-bottom:20px}
.estate-gate p{margin-top:10px;line-height:1.55}
.estate-items{gap:16px}
.estate-item{padding:16px 12px;gap:14px}
.estate-item h3{line-height:1.3}
.estate-item p{margin:10px 0;line-height:1.55}
.estate-item small{line-height:1.5;margin:8px 0}
.estate-item .story-primary{margin-top:12px}
.estate-save-note{margin:20px 0 16px!important}
.purse-explanation h3{line-height:1.3}
.purse-explanation p{margin-top:10px;line-height:1.6}
.purse-section-heading{margin-top:28px;margin-bottom:16px}
.purse-storage p{margin:10px 0 14px;line-height:1.55}
.purse-generators{gap:14px}
.purse-generator h3{line-height:1.3}
.purse-generator p{margin:10px 0 12px;line-height:1.5;min-height:30px}
.purse-generator>small{margin:12px 0 10px;min-height:32px;line-height:1.5}
.purse-generator .purse-buy{min-height:40px}
.purse-energy p{margin:16px 0;line-height:1.6}
.purse-all-ready p,.purse-refill p,.purse-star-note p,.purse-earn p{margin-top:10px;line-height:1.55}
.purse-earn{margin-top:28px;padding:20px;row-gap:14px}
.purse-restoration p{margin:12px 0 16px;line-height:1.6}
.purse-restoration-copy>small{line-height:1.5;margin-top:12px}
.journey-total-heading h2+p{margin-top:10px}
.journey-hero-copy h2+p,.story-chapter-title h2+p{margin-top:12px}
.journey-route{row-gap:24px}
.adventure-intro,.evidence-reading p,.story-dialogue p{line-height:1.65}
.adventure-footer-actions{gap:12px}
.adventure-clue-reading p+p,.adventure-chronicle article+article{margin-top:16px}
.story-shell .story-rewards{margin-top:20px;margin-bottom:20px;gap:14px;padding:18px 12px}
.story-nav{padding-top:10px;padding-bottom:max(12px,env(safe-area-inset-bottom));gap:4px}
.story-nav button{gap:5px;line-height:1.25}
/* Keep the footer clear even when the final paragraph wraps to extra lines. */
.story-shell:not(.compact-workshop){padding-bottom:100px}
.comic-reader{padding-bottom:24px!important}
.comic-top{padding-bottom:18px}.comic-controls{gap:12px}.comic-dots{margin:20px 0}
/* Reference-based pages: minimum mobile gaps, content-driven panel heights. */
.game-stage .paper{height:auto!important;min-height:0!important;padding-bottom:max(24px,calc(var(--u)*44))}
.game-stage .paper :is(h1,h2,h3){line-height:1.22}
.game-stage .paper p{line-height:1.55}
.game-stage .paper>p{margin-top:12px;margin-bottom:16px}
.game-stage .paper>h1{margin-bottom:20px}
.game-stage .paper>h2{margin-bottom:12px}
.game-stage .paper>.primary+.primary,.game-stage .paper>.primary+.soft{margin-top:12px}
.game-stage .paper button{line-height:1.3}
.inn-paper .row:first-child{margin-bottom:16px}
.inn-paper h2{margin-bottom:12px}
.inn-paper .lead{margin:0 8px 16px}
.inn-paper .meter{margin:0 8px 20px;gap:12px}
.game-stage .inn-paper>p{margin-top:0;margin-bottom:16px}
.game-stage .shop-paper{padding:0 max(12px,calc(var(--u)*18)) 24px}
.shop-paper .starter-offer{height:auto;min-height:170px;padding:20px 18px}
.starter-offer h2{white-space:normal;max-width:75%;margin-bottom:12px;font-size:max(22px,calc(var(--u)*44))}
.starter-offer p{margin-top:0;max-width:62%;font-size:max(13px,calc(var(--u)*28));line-height:1.5}
.starter-offer .cream{margin-top:16px;min-height:40px;height:auto;padding:10px 18px}
.shop-paper .products-grid{gap:12px;margin-top:16px}
.shop-paper .product{height:auto;min-height:180px;padding:14px 12px 16px;display:flex;flex-direction:column;align-items:center}
.product h3{margin:12px 0 16px;white-space:normal;font-size:max(15px,calc(var(--u)*33))}
.product button{margin-top:auto;min-height:38px;height:auto;padding:9px}
.shop-paper .noads-offer,.shop-paper .daily-offer{height:auto;margin-top:16px;gap:14px;padding:18px 14px;align-items:center}
.noads-offer>.art-fragment,.daily-offer>.art-fragment{width:25%;height:auto;aspect-ratio:1;flex-shrink:0}
.noads-offer h3,.daily-offer h3{white-space:normal;font-size:max(16px,calc(var(--u)*34))}
.noads-offer p,.daily-offer p{margin:10px 0 14px;font-size:max(12px,calc(var(--u)*25));line-height:1.5}
.noads-offer button,.daily-offer button{height:auto;min-height:40px;padding:10px;font-size:max(12px,calc(var(--u)*29))}
.game-stage .detail-art{margin:16px auto}
.item-paper .chain-strip{margin:16px 0;gap:8px}
.item-paper .detail-caption{margin:16px 0 20px}
.item-paper>.soft{margin-top:12px}
.storage-grid{gap:8px;margin-top:16px}
.storage-expand{margin-top:20px}
.storage-expand h2{margin-bottom:16px;font-size:max(20px,calc(var(--u)*40))}
.stored-detail{margin-top:16px;height:auto;min-height:92px;padding:16px;gap:14px}
.stored-detail h3{margin-bottom:12px}
.purchase-art{margin-top:20px;margin-bottom:20px}
.purchase-contents{gap:10px;margin-bottom:16px}
.purchase-paper .sandbox-pill{margin:16px auto 20px;line-height:1.4}
.purchase-paper .soft{margin-top:12px}
.purchase-paper .checkout-note{display:block;font-size:max(11px,calc(var(--u)*25));line-height:1.5;margin-top:16px;text-align:center}
.energy-bottle{margin:20px auto 16px}
.game-stage .energy-paper .refill-time{margin:16px 0 20px}
.energy-ad{height:auto;margin-bottom:16px;padding:12px}
.energy-ad small{display:block;margin-top:10px;line-height:1.4}
.energy-paper>.outlined{margin-top:16px}
.energy-paper>.text-link{margin:16px auto 0}
.reward-paper h1{white-space:normal;line-height:1.2;margin-bottom:20px}
.reward-values{gap:12px}
.reward-values>div{height:auto;min-height:130px;padding:12px 8px}
.reward-values strong{line-height:1.3;margin-top:12px}
.reward-paper .sandbox-pill{margin:20px auto;line-height:1.4}
.event-rewards{gap:10px}
.event-rewards article{height:auto;min-height:170px;padding:12px 8px;display:flex;flex-direction:column;gap:10px}
.event-rewards strong{height:auto;min-height:32px;margin:0;font-size:max(11px,calc(var(--u)*25));line-height:1.4}
.event-rewards button{margin-top:auto;min-height:36px;font-size:max(10px,calc(var(--u)*24));line-height:1.3;padding:8px 4px}
.event-paper .premium-gift{height:auto;min-height:110px;margin-top:20px;padding:16px 12px;gap:12px}
.premium-gift h3{font-size:max(15px,calc(var(--u)*34));line-height:1.3}
.premium-gift p{margin-top:10px;font-size:max(12px,calc(var(--u)*25));line-height:1.5}
.settings-card{padding:12px 14px;margin-bottom:16px}
.settings-card .audio-setting{height:auto;min-height:78px;padding:14px 0;gap:14px}
.setting-slider label{margin-bottom:14px;line-height:1.3}
.settings-card .preference{height:auto;min-height:64px;padding:12px 0;gap:12px}
.preference strong{white-space:normal;line-height:1.35}
.account h2{margin-bottom:16px;height:auto;min-height:42px}
.account .primary{margin-top:12px;margin-bottom:0;min-height:44px;line-height:1.3}
.settings-links{margin-top:20px}
.recovery-paper h1{margin:0 8px 16px}
.recovery-paper .save-card{height:auto;min-height:94px;padding:16px;gap:12px;margin:16px 0}
.save-card h3{margin-bottom:10px;line-height:1.25}
.save-card small{display:block;line-height:1.5;font-size:max(11px,calc(var(--u)*27))}
.recovery-paper>.primary,.recovery-paper>.soft{margin-top:16px;min-height:44px;height:auto;padding-top:12px;padding-bottom:12px}
.privacy-paper h1{margin-bottom:24px}
.privacy-paper .inset-card{padding:16px 12px}
.privacy-paper .inset-card p{margin:12px 0 20px;line-height:1.6}
.privacy-paper .privacy-option{height:auto;min-height:54px;margin-bottom:12px;padding:14px!important;line-height:1.3}
.privacy-paper .text-link{margin:12px 0 16px}
.game-stage .profile-form,.game-stage .start-panel{height:auto!important}
.start-panel h2{margin-bottom:16px;line-height:1.2}
.start-panel .text-link{margin-top:12px}
/* Dialogs follow the same paragraph/button rhythm, independently of artboards. */
#modal:not(.sources-modal):not(.story-choice-modal){padding:24px}
#modal:not(.sources-modal):not(.story-choice-modal) h2{line-height:1.25;margin:0 0 16px}
#modal:not(.sources-modal):not(.story-choice-modal) h3{line-height:1.3;margin:16px 0 10px}
#modal:not(.sources-modal):not(.story-choice-modal) p{line-height:1.6;margin:12px 0 16px}
#modal:not(.sources-modal):not(.story-choice-modal) .primary{margin-top:12px;line-height:1.35;min-height:44px}
.sources-hero h2{line-height:1.2;margin:10px 0 12px}
.sources-intro p{line-height:1.6}.sources-grid{gap:12px}
.sources-grid .source-card{row-gap:6px;padding-top:12px;padding-bottom:12px}
.source-card strong{line-height:1.3}.source-card small{line-height:1.5}
.sources-note{line-height:1.6;margin:16px 0}
.decision-dialog-paper p{line-height:1.6}
.decision-dialog-paper .primary+.primary{margin-top:12px}
@media(max-width:350px){.recipe-card,.request-card{padding:16px}.recipe-ingredients{gap:6px}.estate-item{gap:10px;padding:14px 10px}.purse-generators{gap:10px}.game-stage .paper>p{font-size:max(13px,calc(var(--u)*32))}.sources-grid{gap:10px}}
