/* v2.9.9 — four mobile public actions + teacher branding, no menu duplicates.
   Layout RTL: upper row Home (right), Register (left); lower row Install (right), Login (left).
   Legacy desktop header/menu layouts are preserved. */
.public-mobile-navlinks,.public-mobile-brand-banner{display:none}
@media(max-width:980px){
  /* Let the page scroll without a four-row header covering an exam or registration form. */
  body.public-premium-theme .main-header,
  body.public-egypt-theme.public-premium-theme .main-header,
  body.public-premium-theme .main-header.is-scrolled{
    position:relative!important;top:auto!important;
    background:linear-gradient(135deg,#06275d,#0b3a82)!important;
  }
  /* Move the teacher's visible name out of the small top row and into the banner. */
  body.public-premium-theme .main-header .nav-wrap>.brand .brand-text{display:none!important}
  body.public-premium-theme .main-header .nav-wrap>.brand{min-width:0;max-width:calc(100% - 75px)}
  body.public-premium-theme .main-header .nav-wrap{min-height:58px!important;padding-top:7px!important;padding-bottom:4px!important}
  /* This link is in the desktop menu only; on phones it lives outside the menu. */
  body.public-premium-theme .main-header .nav-links>a.public-nav-home{display:none!important}
  body.public-premium-theme .main-header .public-mobile-navlinks,
  body.public-premium-theme .main-header .public-mobile-actions{
    display:grid!important;
    direction:rtl;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:9px;
    padding:0 12px 9px;
    background:transparent;
    align-items:stretch;
    box-sizing:border-box;
  }
  body.public-premium-theme .main-header .public-mobile-navlinks .btn,
  body.public-premium-theme .main-header .public-mobile-actions .btn{
    display:flex!important;min-width:0;width:100%;box-sizing:border-box;
    min-height:46px;padding:9px 7px;border-radius:13px;
    gap:7px;align-items:center;justify-content:center;text-align:center;
    font-size:clamp(12px,3.4vw,16px);line-height:1.3;font-weight:900;
    white-space:normal;text-decoration:none;overflow-wrap:anywhere;
    transition:filter 150ms ease;
    box-shadow:0 4px 14px rgba(0,0,0,.15);
  }
  body.public-premium-theme .main-header .public-mobile-navlinks .btn:hover,
  body.public-premium-theme .main-header .public-mobile-actions .btn:hover{filter:brightness(1.05)}
  body.public-premium-theme .main-header .public-mobile-navlinks .btn:focus-visible,
  body.public-premium-theme .main-header .public-mobile-actions .btn:focus-visible,
  body.public-premium-theme .main-header .public-mobile-brand-banner a:focus-visible{
    outline:3px solid #ffdf70;outline-offset:3px;
  }
  body.public-premium-theme .main-header .public-mobile-navlinks .btn .ui-icon,
  body.public-premium-theme .main-header .public-mobile-actions .btn .ui-icon{
    width:17px;height:17px;flex:0 0 17px;color:currentColor!important;
  }
  body.public-premium-theme .main-header .public-mobile-navlinks .public-mobile-home{
    background:#fff!important;color:#102f66!important;border:1px solid #cbdaf7!important;
  }
  body.public-premium-theme .main-header .public-mobile-navlinks .public-mobile-register{
    background:linear-gradient(135deg,#b80c2b,#e33444)!important;
    color:#fff!important;border:1px solid #f47789!important;
  }
  body.public-premium-theme .main-header .public-mobile-actions .public-mobile-install{
    background:#fff!important;color:#103b80!important;border:1px solid #fff!important;
  }
  body.public-premium-theme .main-header .public-mobile-actions .public-mobile-login{
    background:#edba48!important;color:#122b52!important;border:1px solid #ffe299!important;
  }
  /* Banner is the exact artwork supplied by the user, kept sharp and completely visible. */
  body.public-premium-theme .main-header .public-mobile-brand-banner{
    display:block!important;padding:0 10px 10px;box-sizing:border-box;
  }
  body.public-premium-theme .main-header .public-mobile-brand-banner a{
    display:block;margin:auto;max-width:680px;border-radius:13px;overflow:hidden;
    background:#02122f;border:1px solid rgba(255,255,255,.15);
    box-shadow:0 4px 16px rgba(0,0,0,.17);
  }
  body.public-premium-theme .main-header .public-mobile-brand-banner img{
    display:block;width:100%;height:auto;aspect-ratio:1600/533;
    object-fit:contain;
  }
  /* Desktop actions are deliberately not shown twice on mobile. */
  body.public-premium-theme .main-header .nav-actions>.install-app-btn,
  body.public-premium-theme .main-header .nav-actions>[data-public-login],
  body.public-premium-theme .main-header .nav-actions>[data-public-dashboard]{display:none!important}
}
@media(max-width:350px){
  body.public-premium-theme .main-header .public-mobile-navlinks,
  body.public-premium-theme .main-header .public-mobile-actions{gap:5px;padding-inline:7px;padding-bottom:7px}
  body.public-premium-theme .main-header .public-mobile-navlinks .btn,
  body.public-premium-theme .main-header .public-mobile-actions .btn{font-size:12px;padding:6px 3px;gap:4px}
  body.public-premium-theme .main-header .public-mobile-brand-banner{padding-inline:6px}
}
@media(min-width:981px){
  .public-mobile-navlinks,.public-mobile-actions,.public-mobile-brand-banner{display:none!important}
}
@media print{.public-mobile-navlinks,.public-mobile-actions,.public-mobile-brand-banner{display:none!important}}
