/* Copyright 2026 Michael Shaun French. Developed in the United Kingdom.
   Main-app shared design; activity/game content retains its specialised layout. */
body.shared-ui .shared-menu-panel:not(dialog){height:auto!important;min-height:100%!important;max-height:none!important;padding:16px!important;gap:16px!important;overflow:visible!important;box-sizing:border-box}
body.shared-ui #everydayActivities.shared-menu-panel{height:auto!important;min-height:100%!important;flex:1}
body.shared-ui .shared-menu-panel>.app-menu-heading{position:relative;padding:0 48px 4px!important;text-align:center}
body.shared-ui .shared-menu-panel>.app-menu-heading .app-menu-brand{display:block!important;font-size:14px!important;line-height:1.3!important;margin:0 0 6px!important}
body.shared-ui .shared-menu-panel>.app-menu-heading .app-menu-tagline{display:none!important}
body.shared-ui .shared-menu-panel>.app-menu-heading :is(h1,h2){font-size:calc(var(--ui-title) * var(--ui-reading-scale,1))!important;line-height:1.25!important;min-height:0!important;margin:0!important;overflow-wrap:anywhere}
body.shared-ui .shared-card-grid{display:grid!important;gap:var(--ui-space)!important;min-width:0!important;min-height:0!important;overflow:visible!important;align-content:stretch;flex:1}
body.shared-ui .shared-card-grid[hidden]{display:none!important}
body.shared-ui .shared-menu-card{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;min-width:0!important;min-height:112px!important;border:var(--ui-border) solid var(--accent)!important;border-radius:var(--ui-radius)!important;box-shadow:0 3px 12px #0000000b!important;padding:16px 12px!important;gap:12px!important;background:var(--surface);color:var(--text);box-sizing:border-box}
body.shared-ui .shared-menu-card[hidden]{display:none!important}
body.shared-ui .shared-menu-card .shared-menu-picture{width:var(--ui-menu-icon)!important;height:var(--ui-menu-icon)!important;max-height:var(--ui-menu-icon)!important;flex:none!important;object-fit:contain}
body.shared-ui .shared-menu-card .shared-menu-picture img{width:100%;height:100%;object-fit:contain}
body.shared-ui .shared-menu-card .shared-menu-label{font-size:calc(var(--ui-label) * var(--ui-reading-scale,1))!important;font-weight:700!important;line-height:var(--ui-line-height,1.25)!important;max-width:100%;min-width:0;overflow-wrap:normal!important;word-break:normal!important;text-align:center}
body.shared-ui.pictures-only .shared-menu-card .shared-menu-label,body.shared-ui.words-only .shared-menu-card .shared-menu-picture{display:none!important}
body.shared-ui .shared-menu-panel>.activity-menu-pager{position:static!important;padding:4px 0!important;font-size:14px!important;line-height:1.4!important;margin:0!important;flex:none}
body.shared-ui .shared-menu-panel>.activity-menu-extra{position:static!important;padding-top:12px}
body.shared-ui #boardDialog.shared-menu-panel{max-height:100dvh!important;padding:16px!important;gap:12px!important}
body.shared-ui #boardDialog.shared-menu-panel .board-dialog-heading{display:block!important;position:relative;text-align:center;padding-inline:48px;flex:none}
body.shared-ui #boardDialog.shared-menu-panel #backBoardDialog{position:absolute;left:0;top:0;min-height:48px;width:44px}
body.shared-ui #boardDialog.shared-menu-panel #boardFolderName{font-size:16px;line-height:1.4;overflow-wrap:anywhere;margin:6px 0 0}
body.shared-ui #boardDialog.shared-menu-panel .shared-card-grid{overflow-y:auto!important;overflow-x:hidden!important;scrollbar-gutter:stable;overscroll-behavior-y:contain;scroll-padding:8px;padding:4px 6px!important;flex:1 1 0!important}
body.shared-ui #boardDialog :is(#selectionPageArrows,#boardPageArrows){flex:none;font-size:14px}
body.shared-ui .communication-options-open .comm-options-pane{overflow:visible;max-height:none;padding:8px 0 20px}
body.shared-ui .communication-options-open .comm-options-pane>.settings-card{max-width:960px}
body.shared-ui :is(.settings-card,#testContent>.test-section,.game-sidebar){border-radius:var(--ui-radius)}
body.shared-ui #testPage .test-heading{margin-bottom:12px;padding-bottom:8px;border-bottom:1px solid var(--border)}
body.shared-ui #testTitle{font-size:calc(var(--ui-title) * var(--ui-reading-scale,1))!important;line-height:1.25;overflow-wrap:anywhere}
body.shared-ui :is(#testContent,.game-sidebar) :is(p,label){line-height:1.45}
body.shared-ui :is(.arcade-controls,.arcade-directions,.game-toolbar,.test-toolbar,.test-actions) button{min-height:48px;border-radius:12px;font-size:16px;padding:8px 12px;white-space:normal;overflow-wrap:anywhere}
body.shared-ui #testContent :is(input,select,textarea){max-width:100%;min-width:0;box-sizing:border-box;font-size:16px}
body.shared-ui #testContent :is(h2,h3){overflow-wrap:anywhere}
body.shared-ui #testContent img{max-width:100%}
body.shared-ui dialog:not(#messageDialog,#boardDialog,#aacColourKeyDialog,.quick-settings-fullscreen){border-radius:var(--ui-radius);max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;box-sizing:border-box}
body.shared-ui dialog:not(#messageDialog,#boardDialog) :is(button,input:not([type=checkbox],[type=radio],[type=range]),select,textarea){min-height:48px;max-width:100%;min-width:0;font-size:16px;box-sizing:border-box}
body.shared-ui #quickSettings :is(button,.quick-settings-option){border-radius:12px}
body.shared-ui button:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
body.shared-ui.reference-list-board #grid .tile{height:auto!important;min-height:72px!important;gap:12px!important}
body.shared-ui.reference-list-board #grid .tile-caption{height:auto!important;min-height:0!important;font-size:calc(18px * var(--ui-reading-scale,1))!important;line-height:var(--ui-line-height,1.3)!important}
body.shared-ui.reference-list-board #grid .symbol{width:44px!important;height:44px!important;min-height:44px!important}
@media(max-width:480px){body.shared-ui .shared-menu-panel:not(dialog){padding:12px!important;gap:12px!important}body.shared-ui .shared-menu-card{padding:12px 8px!important;gap:10px!important}body.shared-ui .shared-menu-card .shared-menu-picture{width:48px!important;height:48px!important}}
@media(max-width:360px){body.shared-ui .shared-menu-panel:not(dialog){padding:8px!important}body.shared-ui .shared-menu-card{padding:8px 4px!important}body.shared-ui .shared-card-grid{gap:8px!important}}
@media(orientation:landscape) and (max-height:500px){body.shared-ui .shared-menu-panel:not(dialog),body.shared-ui #boardDialog.shared-menu-panel{padding:8px!important;gap:8px!important}body.shared-ui .shared-menu-panel>.app-menu-heading .app-menu-brand{display:none!important}body.shared-ui .shared-menu-panel>.app-menu-heading :is(h1,h2){font-size:22px!important}body.shared-ui .shared-menu-card{padding:8px!important;gap:6px!important}body.shared-ui .shared-menu-card .shared-menu-picture{width:40px!important;height:40px!important}body.shared-ui #testPage .test-heading{margin-bottom:6px;padding-bottom:4px}body.shared-ui #testTitle{font-size:20px!important}}
@media(prefers-reduced-motion:reduce){body.shared-ui *{scroll-behavior:auto}}

body.shared-ui .shared-menu-panel>.app-menu-heading .ui-home-control{position:absolute;right:0;top:0}
body.shared-ui #testPage .test-heading #uiActivityHome{grid-column:1;grid-row:1;justify-self:start;min-height:48px;width:48px;padding:8px}

/* Simple presets first; optional detailed layout controls and responsive short forms. */
body.shared-ui #uiAdvancedLayouts>summary{font-size:20px;font-weight:700;min-height:48px;cursor:pointer;display:list-item;align-content:center}
body.shared-ui #uiAdvancedLayouts>.settings-card{margin:16px 0 0;padding:12px 0;border:0;background:transparent}
body.shared-ui .ui-short-options,body.shared-ui .ui-orientation-fields{display:grid;grid-template-columns:minmax(0,1fr);gap:12px 24px;min-width:0}
body.shared-ui .ui-short-options>.setting-toggle{margin:0;min-width:0}
body.shared-ui .ui-orientation-fields>div{display:grid;gap:8px;min-width:0}
body.shared-ui .ui-orientation-fields select{width:100%}
@media(min-width:1000px){body.shared-ui .ui-short-options,body.shared-ui .ui-orientation-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}

body.shared-ui.reference-settings #settingsPage{width:100%;margin-inline:auto;box-sizing:border-box}

/* Pin prompts to readable line lengths and use the surrounding width for controls. */
@media (min-width:1120px) and (orientation:landscape){
  body.shared-ui.reference-settings #settingsPage,
  body.shared-ui .communication-options-open .comm-options-pane>.settings-card{
    width:100%;
    max-width:none;
    box-sizing:border-box;
  }
  body.shared-ui :is(#settingsPage,.comm-options-pane) .settings-card>p{
    max-inline-size:80ch;
  }
}
