/* MADA V107 — consistent brand labels, readable cards, fixed phone navigation. */
.mada-app-branch{font-family:system-ui,Arial,sans-serif!important;direction:ltr!important;unicode-bidi:isolate;font-weight:850;color:#354559;letter-spacing:.015em;white-space:nowrap}
/* Explicit two-row header grid: keep notifications and language in row 1,
   branch name centered beneath the logo rather than displacing a control. */
body[data-mada-page="home"] .mada105-top{grid-template-columns:auto auto minmax(0,1fr) auto;grid-template-rows:auto auto;row-gap:1px}
body[data-mada-page="home"] .mada105-top .mada105-menu{grid-area:1 / 1}
body[data-mada-page="home"] .mada105-top .mada105-lang{grid-area:1 / 2}
body[data-mada-page="home"] .mada105-top .mada105-logo{grid-area:1 / 3}
body[data-mada-page="home"] .mada105-top .mada105-notifications{grid-area:1 / 4}
body[data-mada-page="home"] .mada105-top .mada-app-branch{grid-area:2 / 1 / 3 / -1;justify-self:center;font-size:12px;line-height:1.25;max-width:100%;margin:0 0 3px}
.mada-unified-brand-line .mada-app-branch{font-size:clamp(11px,1.3vw,14px);color:inherit}
.mada-qr-app-title{font-size:15px;font-weight:900;line-height:1.3;text-align:center;color:#354559;border-radius:8px;background:#fff3c3;padding:7px 5px;margin-bottom:8px}
.qr-student-card{border-top:4px solid #e62584!important}
/* Contrast according to the actual grade theme, not one forced color. */
body[data-mada-page="home"] .mada105-card .mada105-card-copy{position:relative;isolation:isolate;}
body[data-mada-page="home"] .mada105-card .mada105-card-copy strong{color:#202f43!important;text-shadow:0 1px 0 #ffffff55!important;font-weight:900!important}
body[data-mada-page="home"] .mada105-card .mada105-card-copy small{color:#37485a!important;font-weight:750!important}
body[data-mada-page="home"] .mada105-card .mada105-card-copy::before{content:"";position:absolute;z-index:-1;inset:-5px -7px;border-radius:13px;background:#ffffff8c;pointer-events:none}
/* Dark blue/magenta or older-student cards require white labels, with a
   translucent dark text panel for AA-style contrast against photography. */
body[data-mada-age-home="middle"][data-mada-page="home"] .mada105-card:is(.mada105-hero,.mada105-class) .mada105-card-copy strong,
body[data-mada-age-home="senior"][data-mada-page="home"] .mada105-card:is(.mada105-hero,.mada105-small,.mada105-reports) .mada105-card-copy strong{color:#fff!important;text-shadow:0 2px 4px #182b448c!important}
body[data-mada-age-home="middle"][data-mada-page="home"] .mada105-card:is(.mada105-hero,.mada105-class) .mada105-card-copy small,
body[data-mada-age-home="senior"][data-mada-page="home"] .mada105-card:is(.mada105-hero,.mada105-small,.mada105-reports) .mada105-card-copy small{color:#fff!important}
body[data-mada-age-home="middle"][data-mada-page="home"] .mada105-card:is(.mada105-hero,.mada105-class) .mada105-card-copy::before,
body[data-mada-age-home="senior"][data-mada-page="home"] .mada105-card:is(.mada105-hero,.mada105-small,.mada105-reports) .mada105-card-copy::before{background:#192e4780}
body[data-mada-unified-age] .mada-unified-banner h1{color:inherit}
@media(max-width:1199px){
 body[data-mada-page="home"] .mada105-bottom,
 body.mada-unified-content .mada-unified-bottom{position:fixed!important;top:auto!important;bottom:0!important;left:0!important;right:0!important;width:100%!important;min-width:0!important;height:auto!important;max-height:none!important;display:flex!important;align-items:stretch!important;z-index:9500!important;margin:0!important;border-radius:16px 16px 0 0!important;background:#fffffffa!important;border:1px solid #e4e9f0!important;box-shadow:0 -7px 25px #25364e25!important;padding:5px max(6px,env(safe-area-inset-right,0px)) max(6px,env(safe-area-inset-bottom,0px)) max(6px,env(safe-area-inset-left,0px))!important;transform:none!important;}
 body[data-mada-page="home"] .mada105-shell{padding-bottom:calc(92px + env(safe-area-inset-bottom,0px))!important;}
 body.mada-unified-content #main.mada-unified-main{padding-bottom:calc(93px + env(safe-area-inset-bottom,0px))!important;}
 body[data-mada-page="home"] .mada105-bottom button,
 body.mada-unified-content .mada-unified-bottom button{min-width:0;touch-action:manipulation}
 body[data-mada-page="home"] .mada105-top .mada-app-branch{font-size:11px}
}
@media(max-width:380px){body[data-mada-page="home"] .mada105-top .mada-app-branch{font-size:10px}}
/* Do not force a fixed navigation bar over the dedicated immersive piano. */
body.mada-unified-focus .mada-unified-bottom,body.number-immersive-body .mada105-bottom{display:none!important}
/* Reserve a tidy caption under the logo without adding a second grid row. */
body[data-mada-page="home"] .mada105-top{min-height:112px;padding-bottom:18px}
body[data-mada-page="home"] .mada105-top .mada-app-branch{position:absolute;inset-inline:auto;left:50%;bottom:2px;transform:translateX(-50%);grid-column:auto;grid-row:auto;margin:0;z-index:2;line-height:1.3;text-align:center;pointer-events:none}
/* Dark visual cards must retain white type for accessible contrast. */
body[data-mada-age-home="middle"] .mada105-card:is(.mada105-hero,.mada105-class) .mada105-card-copy strong,
body[data-mada-age-home="senior"] .mada105-card:is(.mada105-hero,.mada105-small,.mada105-reports) .mada105-card-copy strong{color:#fff!important;text-shadow:0 1px 3px #17233988!important}
body[data-mada-age-home="middle"] .mada105-card:is(.mada105-hero,.mada105-class) .mada105-card-copy small,
body[data-mada-age-home="senior"] .mada105-card:is(.mada105-hero,.mada105-small,.mada105-reports) .mada105-card-copy small{color:#f9fbff!important}
body[data-mada-age-home="middle"] .mada105-card:is(.mada105-hero,.mada105-class) .mada105-card-copy::before,
body[data-mada-age-home="senior"] .mada105-card:is(.mada105-hero,.mada105-small,.mada105-reports) .mada105-card-copy::before{background:#1a304b2b;box-shadow:none}
