/* AlmatyKids phone UI. Existing photography and brand colours are retained. */
.mobile-tabs,.mobile-learning-nav,.phone-menu-extra{display:none}
@media(max-width:767px){
 :root{--phone-gutter:20px;--phone-tab-height:68px;--phone-safe-bottom:env(safe-area-inset-bottom,0px)}
 html{scroll-padding-top:112px;scroll-padding-bottom:100px;overflow-wrap:break-word}
 body{padding-bottom:calc(var(--phone-tab-height) + var(--phone-safe-bottom));-webkit-text-size-adjust:100%;}
 *,*::before,*::after{box-sizing:border-box}
 main,section,article,form,.dashboard-refresh>div,.dashboard-refresh main{min-width:0;max-width:100%}
 input:not([type=checkbox]):not([type=radio]):not([type=hidden]),select,textarea{font-size:16px!important;max-width:100%;min-height:48px;border-radius:12px!important}
 button,summary,.ak-pill,.ak-ghost,.btn{min-height:44px;touch-action:manipulation}
 button,a{touch-action:manipulation}
 button:active,.primary-action:active,.ak-pill:active{filter:brightness(.94)}
 h1{font-size:30px!important;line-height:1.12!important;letter-spacing:-.025em!important}
 h2{line-height:1.2!important}p{overflow-wrap:break-word}
 .mobile-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));position:fixed;left:0;right:0;bottom:0;z-index:90;background:#fff;border-top:1px solid #e9e1f1;padding:6px max(6px,env(safe-area-inset-right)) calc(6px + var(--phone-safe-bottom)) max(6px,env(safe-area-inset-left));min-height:calc(var(--phone-tab-height) + var(--phone-safe-bottom));}
 .mobile-tabs a{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;min-height:54px;color:#64566f;text-decoration:none;font-size:11px;font-weight:700;line-height:1.2;border-radius:12px;padding:4px 1px;white-space:nowrap}
 .mobile-tabs svg{width:23px;height:23px;flex:none}
 .mobile-tabs a[aria-current]{color:#6D28D9;background:#f3edfc} /* taste-skill-ignore: user explicitly retains purple branding */
 .mobile-tabs a[aria-current] svg{stroke-width:2.2}
 .phone-keyboard-open .mobile-tabs{display:none}
 .site-header{background:#fff;color:#241634;border-bottom:1px solid #eee7f5;padding-top:env(safe-area-inset-top);}
 .site-top{padding:10px var(--phone-gutter) 12px;gap:10px;display:flex;flex-wrap:wrap}
 .site-brand{font-size:23px;gap:8px;flex:1}.site-brand img{width:34px;height:34px;border-radius:6px}.site-brand>span>span{color:#6D28D9} /* taste-skill-ignore: user explicitly retains purple branding */
 .site-tools{gap:4px;margin:0;flex:none}.site-tools>.site-languages,.site-tools>.site-account,.site-tools>.site-signin{display:none}
 .site-menu-toggle{display:grid;color:#6D28D9;background:#f3edfc;border-radius:12px;width:44px;height:44px} /* taste-skill-ignore: user explicitly retains purple branding */
 .site-search{order:3;flex-basis:100%;max-width:none;display:block;margin:0}.site-search input{background:#f4f0f8;border:1px solid transparent;padding:12px 44px 12px 14px;min-height:44px}
 .site-nav{display:none;padding:12px 20px 20px;gap:0;max-height:calc(100dvh - 210px);overflow:auto;border-top:1px solid #eee7f5;grid-template-columns:1fr 1fr}
 .site-nav[data-open=true]{display:grid}.site-nav a{color:#241634;border:0;white-space:normal;min-height:48px;padding:13px 10px;border-radius:8px}
 .site-nav a[aria-current]{background:#f3edfc;color:#6D28D9}.phone-menu-extra{display:block;grid-column:1/-1;border-top:1px solid #e9e1f1;margin-top:8px;padding-top:8px} /* taste-skill-ignore: user explicitly retains purple branding */
 .phone-menu-extra .site-languages{display:flex;justify-content:flex-start}.phone-menu-extra .site-languages button{color:#64566f;min-width:56px}.phone-menu-extra .site-languages [aria-pressed=true]{color:#6D28D9;border-color:#6D28D9} /* taste-skill-ignore: user explicitly retains purple branding */
 .phone-menu-extra .account-menu{position:static;box-shadow:none;padding:0;display:grid;grid-template-columns:1fr 1fr;font-size:14px}
 .phone-menu-extra .site-signin{display:block;color:#6D28D9;background:#f3edfc;text-align:center;border:0} /* taste-skill-ignore: user explicitly retains purple branding */
 .site-header+nav{display:none}
 .home-hero{display:flex;flex-direction:column;padding:20px var(--phone-gutter) 28px;gap:20px}
 .hero-photo{order:-1}.hero-photo img{height:210px;aspect-ratio:1.65;object-fit:cover;border-radius:16px}.hero-photo figcaption{display:none}
 .hero-copy{padding:0;align-self:stretch}.home-refresh h1{font-size:36px!important;max-width:12ch;line-height:1.06!important}.hero-copy>p{font-size:16px;line-height:1.5;margin:14px 0 20px;max-width:38ch}
 .hero-caption{display:none}.hero-copy .primary-action{width:100%;font-size:16px;border-radius:12px;min-height:50px}
 .home-container{margin-left:var(--phone-gutter);margin-right:var(--phone-gutter);max-width:none}
 .home-refresh h2{font-size:27px}.home-refresh p{font-size:16px}.section-heading{display:flex;align-items:start;flex-direction:column;gap:10px;margin-bottom:20px}
 .resources-section,.news-section,.photo-section{padding-top:28px;padding-bottom:28px}.resource-row{padding:20px 0;gap:12px}.resource-row strong{font-size:22px}.resource-row small{font-size:15px}
 .catalog-section{padding-top:28px;padding-bottom:28px;gap:24px}.catalog-section img{height:230px;border-radius:16px}.catalog-fact{font-size:13px!important}
 .home-news{gap:24px}.home-news h3{font-size:21px}.home-news img{border-radius:12px}.photo-gallery{grid-template-columns:1fr 1fr;gap:16px 12px}.photo-gallery img{height:140px;border-radius:12px}.photo-gallery figcaption{font-size:13px}
 .home-help{padding:28px 0 36px}.home-help h2{font-size:28px}.home-help .primary-action{width:100%;border-radius:12px;font-size:16px}
 .site-footer{padding:30px 20px 24px}.footer-grid{gap:24px}.site-footer h2{font-size:17px}.site-footer a{display:inline-flex;min-height:44px;align-items:center}.footer-brand{font-size:30px!important}
 /* Existing routes use inline desktop grids. Explicitly tagged at enhancement time. */
 .phone-grid{grid-template-columns:minmax(0,1fr)!important;gap:16px!important}
 .phone-wide-padding{padding:24px 20px!important}
 .phone-title{font-size:30px!important;line-height:1.12!important}
 .phone-table-wrap{width:100%;overflow:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;border-radius:12px}
 .phone-table-wrap table{min-width:580px}.phone-table-wrap:focus-visible{outline:3px solid #6D28D9} /* taste-skill-ignore: user explicitly retains purple branding */
 .phone-section{padding-left:20px!important;padding-right:20px!important;padding-top:24px!important;padding-bottom:24px!important}
 .phone-page-hero{background:#f0e8fc!important;color:#241634!important;box-shadow:none!important;border-radius:16px!important;padding:24px 20px!important}
 .phone-page-hero h1{color:#241634!important;max-width:100%!important;margin-top:0!important}
 .phone-page-hero p{color:#64566f!important;font-size:16px!important}
 .phone-page-hero>span,.phone-page-hero>[aria-hidden=true]{display:none!important}
 .phone-page-hero>div:not([aria-hidden]){color:#6D28D9}.phone-page-hero>div:not([aria-hidden]) *{color:inherit!important} /* taste-skill-ignore: user explicitly retains purple branding */
 .mobile-learning-nav{display:flex;gap:8px;overflow:auto;padding:16px 20px 0;scrollbar-width:none}
 .mobile-learning-nav a{white-space:nowrap;padding:10px 16px;border-radius:12px;color:#64566f;background:#f0eaf8;min-height:44px;font-size:15px;font-weight:700}
 .mobile-learning-nav a[aria-current]{color:#fff;background:#6D28D9} /* taste-skill-ignore: user explicitly retains purple branding */
 .ak-game-card:hover{transform:none!important}.ak-game-card{border-radius:16px!important;box-shadow:none!important}.ak-tile{box-shadow:none!important}
 .ak-auth-aside{display:none!important}#panelLogin h1{font-size:26px!important}.role-card{min-height:60px!important}
 .dashboard-refresh aside{position:static!important;width:auto!important;min-height:0!important;height:auto!important;margin:12px 16px!important;padding:12px!important;border-radius:16px!important}
 .dashboard-refresh main,.ak-main{margin-left:0!important;min-width:0!important;width:auto!important}
 .dashboard-refresh header{position:static!important;padding:16px 20px!important;flex-wrap:wrap!important;gap:12px!important}
 .dashboard-refresh header h1{font-size:27px!important}.dashboard-refresh header input{width:100%!important;max-width:100%!important}
 .dashboard-refresh aside nav button,.dashboard-refresh aside nav a{min-height:48px!important}
 .dashboard-refresh .dashboard-menu-toggle{min-height:44px;border-radius:12px}
 .dashboard-refresh .phone-wide-padding{padding:20px!important}
 .ak-admin-aside{position:static!important;width:auto!important;height:auto!important;max-height:none!important;margin:12px 16px!important;padding:12px!important;border-radius:16px!important}
 .ak-admin-main{margin-left:0!important;width:100%!important;padding:20px!important;min-width:0!important}
 #ak-chat-btn{bottom:calc(82px + var(--phone-safe-bottom))!important;width:48px!important;height:48px!important;right:16px!important}
 #ak-chat-panel{bottom:calc(140px + var(--phone-safe-bottom))!important;right:12px!important;max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 240px)!important}
 .phone-keyboard-open #ak-chat-btn{display:none!important}
 @media(max-width:360px){:root{--phone-gutter:16px}.mobile-tabs a{font-size:10px}.hero-photo img{height:180px}.home-refresh h1{font-size:32px!important}}
 @media(orientation:landscape){.site-search{display:none}.site-header{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}.hero-photo img{height:220px}.mobile-tabs{--phone-tab-height:58px}.mobile-tabs a{min-height:44px}}
}
@media(prefers-reduced-motion:reduce){.mobile-tabs *{transition:none!important}}
.phone-filters>summary{display:none}
@media(max-width:767px){
 #main-content>.max-w-6xl{padding:0!important}
 #ak-chat-widget{bottom:calc(82px + var(--phone-safe-bottom))!important;right:16px!important;z-index:95!important}
 #ak-chat-popup{width:min(340px,calc(100vw - 32px))!important;max-height:calc(100dvh - 230px)!important}
 .phone-keyboard-open #ak-chat-widget{bottom:12px!important}
 .phone-page-hero form[role=search]{border-radius:12px!important;padding:5px!important;box-shadow:none!important;gap:4px!important}
 .phone-page-hero form[role=search] input{min-width:0;width:100%;padding:8px!important}
 .phone-page-hero form[role=search] button{flex:none;white-space:nowrap;padding:10px 14px!important;border-radius:9px!important;background:#6D28D9!important;font-size:14px!important} /* taste-skill-ignore: user explicitly retains purple branding */
 .phone-filters{margin-top:16px;background:#fff;border:1px solid #e9e1f1;border-radius:12px;padding:0 16px}
 .phone-filters>summary{display:list-item;padding:14px 0;color:#6D28D9;font-weight:700;cursor:pointer;min-height:48px} /* taste-skill-ignore: user explicitly retains purple branding */
 .phone-filters>form{border:0!important;box-shadow:none!important;padding:0 0 16px!important;margin:0!important;border-radius:0!important}
 .phone-filters select{min-width:0;width:100%}
}
@media(min-width:768px){.phone-filters>form{display:block!important}.phone-filters:not([open])>form{display:block!important}}
@media(max-width:767px){
 .dashboard-refresh{padding-top:env(safe-area-inset-top)}
 .ak-admin-aside{margin-top:calc(12px + env(safe-area-inset-top))!important}
}

@media(max-width:767px){
 #ak-chat-btn{bottom:auto!important;right:auto!important}
 .dashboard-refresh header{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important}
 .dashboard-refresh header form[action="/materials"]{width:auto!important;min-width:0;padding:3px 12px!important;border-radius:12px!important}
 .dashboard-refresh header form[action="/materials"] input{min-width:0;background:transparent;font-size:16px!important;min-height:44px!important}
 .phone-stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important}
 .phone-stats-grid>div{border-radius:12px!important;box-shadow:none!important;padding:16px!important}
 .phone-stats-grid>div>span{display:none!important}
 .phone-stats-grid>div>.ak-d{margin-top:0!important;font-weight:400!important}
 .phone-dashboard-greeting{background:#6D28D9!important;box-shadow:none!important;border-radius:16px!important;padding:20px!important} /* taste-skill-ignore: user explicitly retains purple branding */
 .phone-dashboard-greeting>[style*="position:absolute"]{display:none!important}
 .phone-dashboard-greeting>div{min-width:0!important}
 #panelLogin form>button[type=submit]{background:#E91E63!important;box-shadow:none!important;border-radius:12px!important}
}

@media(max-width:767px){
 .games-mobile-flow{display:flex;flex-direction:column}
 .games-mobile-flow>section{width:100%}
 .games-phone-hero{order:0}.games-phone-filters{order:1;position:static!important}.games-phone-list{order:2}.games-phone-progress{order:3}.games-phone-leaderboard{order:4}.games-phone-legend{order:5}
 .games-phone-hero .phone-page-hero>div:not([aria-hidden]){margin-top:16px!important;gap:20px!important}
 .games-phone-hero .phone-page-hero .ak-display:not(h1){font-size:20px!important}
 .games-phone-filters>div{padding:12px 20px!important}
 .games-phone-filters>div>div{flex-wrap:nowrap!important;justify-content:flex-start!important;overflow-x:auto;padding-bottom:5px}
 .games-phone-filters a{flex-shrink:0;min-height:44px;display:inline-flex;align-items:center}
 .games-phone-list{padding-top:20px!important}
 .games-phone-progress .phone-grid{grid-template-columns:1fr 1fr!important}
}
