/* Halo ALEIA mobile hardening — 2026-10-02
   Loaded last so phone layouts win over older desktop-focused rules. */

html,body{max-width:100%;overflow-x:hidden}
img,video,canvas{max-width:100%;height:auto}

@media(max-width:760px){
  /* Global page guards */
  .site,.lp-shell,.lp-main,.lp-report-page,.family-stage,.profile-stage,.auth-stage,
  .ap-shell,.ap-main,.aleia-landing-v2,.aleia-v2-main{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important
  }
  .lp-grid,.lp-card,.lp-task-copy,.lp-student,.lp-student-top>div,
  .family-panel,.child-world-card,.profile-card,.auth-card,.auth-copy,.auth-form,
  .ap-workspace,.ap-card,.ap-panel{
    min-width:0!important;
    max-width:100%!important
  }
  input,select,textarea,button{max-width:100%}
  p,h1,h2,h3,b,small,span,em{overflow-wrap:anywhere}

  /* Learning Partner shell */
  .lp-topbar{
    height:auto!important;
    min-height:70px!important;
    padding:12px 14px!important;
    gap:10px!important
  }
  .lp-brand{min-width:0!important;gap:10px!important}
  .lp-brand-mark{width:32px!important;height:32px!important;flex:0 0 32px!important}
  .lp-brand-copy{min-width:0!important}
  .lp-brand-copy b{font-size:13px!important;line-height:1.15!important}
  .lp-brand-copy small{font-size:6px!important;letter-spacing:.12em!important;white-space:normal!important}
  .lp-profile{flex:0 0 auto!important}
  .lp-main{padding:24px 14px 48px!important}
  .lp-heading{gap:14px!important;margin-bottom:20px!important}
  .lp-heading h1{font-size:30px!important}
  .lp-card{padding:16px!important;border-radius:18px!important}
  .lp-card-head{align-items:flex-start!important;flex-wrap:wrap!important;gap:8px 12px!important}
  .lp-card-head>div{min-width:0!important;flex:1 1 180px!important}
  .lp-card-head h2{font-size:17px!important;line-height:1.15!important}
  .lp-priority-count{flex:0 0 auto!important;margin-left:auto!important}

  /* Priority rows: no flex wrapping collisions */
  .lp-task.lp-dashboard-priority{
    display:grid!important;
    grid-template-columns:46px minmax(0,1fr) auto!important;
    grid-template-areas:
      "avatar copy action"
      "avatar badge action"!important;
    align-items:start!important;
    column-gap:11px!important;
    row-gap:7px!important;
    padding:16px 0!important
  }
  .lp-dashboard-priority>.lp-child-avatar{
    grid-area:avatar!important;
    width:46px!important;
    height:46px!important;
    border-radius:14px!important;
    flex:none!important
  }
  .lp-dashboard-priority>.lp-task-copy{grid-area:copy!important}
  .lp-dashboard-priority>.lp-badge{
    grid-area:badge!important;
    justify-self:start!important;
    margin:0!important;
    white-space:nowrap!important
  }
  .lp-dashboard-priority>.lp-mini{
    grid-area:action!important;
    align-self:start!important;
    justify-self:end!important;
    margin:0!important;
    padding:5px 0 5px 8px!important;
    white-space:nowrap!important
  }
  .lp-dashboard-priority .lp-task-copy b{font-size:12.5px!important;line-height:1.2!important}
  .lp-dashboard-priority .lp-student-meta{
    margin-top:3px!important;
    font-size:8px!important;
    line-height:1.35!important
  }
  .lp-dashboard-priority .lp-next-task{
    display:inline-flex!important;
    width:max-content!important;
    max-width:100%!important;
    margin-top:7px!important
  }

  /* Student cards */
  .lp-student-top{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:start!important;
    gap:10px!important
  }
  .lp-student-top>.lp-badge{margin-top:0!important;white-space:nowrap!important}
  .lp-student-statusline{gap:5px!important}
  .lp-student-statusline span{line-height:1.25!important}
  .lp-weekly-timeline-head{gap:6px!important}
  .lp-week-chips{gap:5px!important}

  /* Teacher workflows */
  .lp-student-hero{gap:14px!important;padding:18px!important}
  .lp-workspace-grid{grid-template-columns:1fr!important}
  .lp-action-card{min-height:0!important}
  .lp-form-section{padding:16px!important;border-radius:19px!important}
  .lp-form-hero{gap:12px!important}
  .lp-form-submit{width:100%!important}
  .lp-photo-uploader,.lp-activity-fields{grid-template-columns:1fr!important}
  .lp-pulse-top{gap:10px!important}
  .lp-pulse-result{min-width:0!important}
  .lp-responsibility-note{gap:10px!important}
  .lp-database-table-wrap{-webkit-overflow-scrolling:touch!important}
  .lp-database-table{min-width:760px!important}

  /* Report page */
  .lp-report-page{padding:16px 10px 42px!important}
  .lp-report-sheet{width:100%!important;border-radius:18px!important}
  .lp-report-cover,.lp-report-section{padding-left:14px!important;padding-right:14px!important}
  .lp-report-two-col{grid-template-columns:1fr!important}
  .lp-report-area-list,.lp-report-notes,.lp-report-moments{grid-template-columns:1fr!important}

  /* Parent / family / profile */
  .family-stage,.profile-stage,.auth-stage{padding-left:14px!important;padding-right:14px!important}
  .family-panel,.child-world-card,.profile-card,.auth-card{padding-left:18px!important;padding-right:18px!important}
  .family-heading{gap:14px!important}
  .family-grid{grid-template-columns:1fr!important}
  .parent-controls{flex-direction:column!important;align-items:stretch!important}
  .parent-controls .btn{width:100%!important}
  .child-world-top{min-width:0!important}
  .profile-form{grid-template-columns:1fr!important}
  .universe-demo,.universe-grid{grid-template-columns:1fr 1fr!important}
  .auth-card{grid-template-columns:1fr!important;gap:24px!important}
  .auth-form{padding:20px!important}

  /* Assessment */
  .ap-workspace,.ap-welcome{grid-template-columns:1fr!important}
  .ap-result-grid,.ap-mirror-grid,.ap-support-grid{grid-template-columns:1fr!important}
  .ap-pair{grid-template-columns:1fr!important}
  .ap-pair>span{display:none!important}
  .ap-deep-grid{grid-template-columns:1fr 1fr!important}
}

@media(max-width:520px){
  /* Compact phone */
  .lp-main{padding:20px 12px 42px!important}
  .lp-topbar{padding:11px 12px!important}
  .lp-brand-copy b{font-size:12.5px!important}
  .lp-card{padding:14px!important}
  .lp-heading h1{font-size:27px!important}
  .lp-stats{grid-template-columns:1fr!important}
  .lp-stat{padding:16px!important}

  .lp-task.lp-dashboard-priority{
    grid-template-columns:44px minmax(0,1fr)!important;
    grid-template-areas:
      "avatar copy"
      "avatar badge"
      ". action"!important;
    column-gap:10px!important;
    row-gap:7px!important
  }
  .lp-dashboard-priority>.lp-child-avatar{width:44px!important;height:44px!important}
  .lp-dashboard-priority>.lp-mini{
    justify-self:start!important;
    padding:3px 0!important
  }
  .lp-dashboard-priority>.lp-badge{font-size:6.4px!important;padding:5px 7px!important}
  .lp-dashboard-priority .lp-next-task{font-size:5.8px!important}

  .lp-student-top{
    grid-template-columns:1fr!important;
    gap:7px!important
  }
  .lp-student-top>.lp-badge{justify-self:start!important}
  .lp-student-hero{flex-direction:column!important}
  .lp-child-avatar-xl{width:54px!important;height:54px!important;flex-basis:54px!important}
  .lp-progress-pill{width:100%!important}
  .lp-slider-head{gap:10px!important}
  .lp-pulse-top{align-items:flex-start!important;flex-direction:column!important}
  .lp-pulse-result{
    width:100%!important;
    justify-content:flex-start!important
  }
  .lp-pulse-score-label{text-align:left!important;max-width:none!important}
  .lp-photo-preview{grid-template-columns:1fr 1fr!important}
  .lp-stepper{overflow-x:auto!important;white-space:nowrap!important}
  .lp-success-card{margin:30px auto!important;padding:28px 16px!important}

  .lp-report-meta{grid-template-columns:1fr!important}
  .lp-report-evidence-strip{grid-template-columns:1fr 1fr!important}
  .lp-pulse-summary-row{grid-template-columns:1fr!important}
  .lp-development-row{grid-template-columns:1fr!important}

  .memory-stats{grid-template-columns:1fr 1fr!important}
  .child-world-top{flex-direction:column!important;gap:12px!important}
  .family-avatar.big{width:64px!important;height:64px!important}
  .universe-demo,.universe-grid{grid-template-columns:1fr!important}
  .ap-deep-grid{grid-template-columns:1fr!important}

  .aleia-partner-dialog,
  .aleia-entry-dialog,
  .lp-biodata-modal{
    width:calc(100vw - 20px)!important;
    max-width:calc(100vw - 20px)!important;
    padding-left:16px!important;
    padding-right:16px!important
  }
}


/* Assessment header: keep ALEIA and child identity readable on phones */
@media(max-width:760px){
  .game-screen .game-top{
    height:78px!important;
    min-height:78px!important;
    flex-wrap:nowrap!important;
    gap:10px!important;
    padding-left:14px!important;
    padding-right:14px!important
  }
  .game-screen .game-top .brand{
    flex:1 1 auto!important;
    min-width:0!important;
    white-space:nowrap!important
  }
  .game-screen .game-top .brand>span{
    display:inline-flex!important;
    align-items:baseline!important;
    flex-wrap:nowrap!important;
    white-space:nowrap!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
    font-size:19px!important
  }
  .game-screen .game-top .brand>span b,
  .game-screen .game-top .brand>span i{
    white-space:nowrap!important;
    overflow-wrap:normal!important;
    word-break:normal!important
  }
  .game-screen .game-top .brand-mark{
    flex:0 0 36px!important;
    width:36px!important;
    height:38px!important
  }
  .game-screen .game-top .game-pill{
    flex:0 1 auto!important;
    max-width:48%!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    overflow-wrap:normal!important;
    word-break:normal!important
  }
}
@media(max-width:380px){
  .game-screen .game-top .brand>span{font-size:17px!important}
  .game-screen .game-top .game-pill{max-width:45%!important;font-size:9px!important}
}
