/* Shared dialog structure: only the body scrolls; close is always reachable. */
dialog.modal-shell,.family-app dialog.modal-shell{--modal-pad:24px;box-sizing:border-box;padding:0;max-height:calc(100dvh - 32px);overflow:hidden;border-radius:22px}
dialog.modal-shell:not(.is-anchored){inset:0;margin:auto}
dialog.modal-shell[open],.family-app dialog.modal-shell[open]{display:flex;flex-direction:column}
.modal-shell>.modal-shell-heading{display:flex;flex:none;align-items:center;justify-content:space-between;gap:16px;margin:0;padding:20px var(--modal-pad);border-bottom:1px solid #dee6dc;background:inherit;min-width:0}
.modal-shell .modal-shell-heading h2{margin:0;font-size:24px;line-height:1.25;overflow-wrap:anywhere}
.modal-shell-titles{min-width:0}
.modal-shell-titles>.onboarding-eyebrow,.modal-shell-titles>.eyebrow,.modal-shell-titles>.section-kicker{display:block;margin:0 0 6px}
.modal-shell .modal-shell-heading .modal-shell-close{position:static;display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;margin:0;padding:0;border:0;border-radius:50%;background:#eef3eb;color:#224e40;font:400 28px/1 system-ui,sans-serif;cursor:pointer}
.modal-shell .modal-shell-close:focus-visible{outline:3px solid #7aa48c;outline-offset:2px}
.modal-shell-body{flex:1 1 auto;min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;padding:20px var(--modal-pad) var(--modal-pad);scroll-padding-block:16px;scrollbar-width:thin}
.modal-shell>.modal-shell-form{display:flex;flex:1 1 auto;flex-direction:column;gap:0;min-height:0;min-width:0;margin:0;overflow:hidden}
.modal-shell-form>.modal-shell-footer{display:flex;flex:none;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:12px;margin:0;padding:16px var(--modal-pad);border-top:1px solid #dee6dc;background:inherit}
.modal-shell .modal-shell-footer button{min-height:44px;max-width:100%;white-space:normal}
.modal-shell .modal-shell-footer .primary{flex:1}
.modal-shell>.family-dialog-child-label{flex:none;margin:0;padding:10px var(--modal-pad);border-bottom:1px solid #dee6dc}
/* Moving the landing page content into its own scroller keeps its original typography. */
.modal.modal-shell .modal-shell-body>p:not(.eyebrow){font-size:12px;color:#6b7862;line-height:1.8}
.modal.modal-shell .modal-shell-heading h2{font-size:28px;margin:0}
.modal.modal-shell .modal-shell-heading .eyebrow{font-size:10px}
/* Compact choices retain the existing controls and the real chest artwork. */
.family-app .workspace-dialog.modal-shell .reward-type-picker{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:22px}
.family-app .workspace-dialog.modal-shell .reward-type-picker span{flex-direction:row;justify-content:flex-start;text-align:left;gap:10px;min-height:48px;padding:10px 12px;background:#fffefa;font-size:14px}
.family-app .workspace-dialog.modal-shell .reward-type-picker b{font-size:19px}
.family-app .workspace-dialog.modal-shell .reward-type-picker input:checked+span{padding:9px 11px;background:#eaf3e4}
.family-app .workspace-dialog.modal-shell .chest-picker{border:0;padding:0;gap:10px;background:transparent;margin:24px 0}
.family-app .workspace-dialog.modal-shell .chest-picker legend{padding:0;margin-bottom:10px}
.family-app .workspace-dialog.modal-shell .chest-picker label>span{padding:12px 6px}
.family-app .workspace-dialog.modal-shell .chest-picker label svg,.family-app .workspace-dialog.modal-shell .chest-picker label .chest-sprite{width:44px!important;height:44px!important}
.family-app .workspace-dialog.modal-shell .reward-preview{background:transparent;border:0;border-top:1px solid #dee6dc;border-radius:0;padding:20px 0 0;margin:0}
.family-app .workspace-dialog.modal-shell .reward-preview h3{font-size:18px}
.family-app .workspace-dialog.modal-shell .reward-form-intro,.family-app .workspace-dialog.modal-shell .field-help{line-height:1.5}
/* Family messages are a scrolling dialog on the island, with their own close action. */
.child-game .bottle-panel{display:flex;flex-direction:column;overflow:hidden}
.child-game .bottle-panel>.game-panel-top{flex:none;position:static;margin-bottom:0;padding-bottom:16px;background:var(--child-paper)}
.child-game .bottle-panel>.modal-panel-body{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding-top:16px;scroll-padding-block:16px}
@media(max-width:600px){
 dialog.modal-shell,.family-app dialog.modal-shell{--modal-pad:20px;max-height:calc(100dvh - 24px);max-width:calc(100vw - 24px);border-radius:20px}
 .modal-shell>.modal-shell-heading{padding-block:16px}
 .modal-shell .modal-shell-heading h2{font-size:22px}
 .modal-shell-form>.modal-shell-footer{padding-bottom:max(16px,env(safe-area-inset-bottom))}
 .family-app .workspace-dialog.modal-shell .form-actions{flex-direction:row}
 .family-app .workspace-dialog.modal-shell .form-actions button{width:auto}
 .family-app .workspace-dialog.modal-shell .reward-type-picker span{font-size:13px;padding:10px 9px;gap:7px}
 .family-app .workspace-dialog.modal-shell .reward-type-picker input:checked+span{padding:9px 8px}
}
@media(max-height:440px){
 dialog.modal-shell,.family-app dialog.modal-shell{max-height:calc(100dvh - 16px)}
 .modal-shell>.modal-shell-heading{padding-block:10px}
 .modal-shell-form>.modal-shell-footer{padding-block:10px}
}
