/* MADA V106 | A unified interior design across ALL grade-aware modules.
   Visual skin only: does not alter note sizes, keyboard logic or assessment scoring. */
body[data-mada-unified-age]{--mada-yellow:#ffe650;--mada-orange:#f18b00;--mada-pink:#e62584;--mada-blue:#1667af;--mada-graphite:#354559;--mada-hero-grad:linear-gradient(120deg,#ffe650,#ffbc24);--mada-text:#354559;--mada-bright:#e62584;--mada-content:#fff;--mada-line:#e9eaf0;--mada-bg:#f8f9fd;--primary:#e62584!important;--accent:#ffe650!important;--bg:#f8f9fd!important;--surface:#fff!important;--ink:#354559!important;--muted:#6c7b8b!important;--line:#e5e9f1!important;--soft:#fff0f7!important;background:var(--mada-bg);color:var(--mada-text);}
body[data-mada-unified-age="middle"]{--mada-bright:#1667af;--mada-hero-grad:linear-gradient(120deg,#116bb5,#247cc3);--primary:#1667af!important;--soft:#e8f3ff!important}
body[data-mada-unified-age="senior"]{--mada-bright:#354559;--mada-hero-grad:linear-gradient(125deg,#26354d,#41526c);--primary:#354559!important;--soft:#eaf0f8!important}
body[data-mada-unified-age] .mada-topbar{background:#fff!important;box-shadow:0 1px 18px #35455914;border-bottom:1px solid #e5e9f1;backdrop-filter:none;color:var(--mada-graphite);}
body[data-mada-unified-age] .mada-shell{background:radial-gradient(ellipse at 6% 96%,#ffebaf40,transparent 28%),radial-gradient(ellipse at 95% 85%,#ffa1d530,transparent 28%),#f9faff;}
body[data-mada-unified-age] .mada-sidebar{background:linear-gradient(180deg,#fff 2%,#f8f9fd 98%);border-left:1px solid #e6eaf2;box-shadow:inset -2px 0 #ffffff9e;}
body[data-mada-unified-age] .mada-sidebar .sidebar-brand{padding:12px;border-radius:16px;background:#fff;box-shadow:0 6px 20px #3545590d}
body[data-mada-unified-age] .mada-sidebar nav button,body[data-mada-unified-age] .mada-sidebar nav a{border-radius:14px;font-weight:750;transition:background .18s ease;}
body[data-mada-unified-age] .mada-sidebar nav button.active{background:#fff0f6!important;color:#c81773!important;box-shadow:inset -4px 0 #e62584;border:1px solid #f7dce9}
body[data-mada-unified-age="middle"] .mada-sidebar nav button.active{background:#e6f3ff!important;color:#125f9e!important;box-shadow:inset -4px 0 #1667af;border-color:#d8e8f8}
body[data-mada-unified-age="senior"] .mada-sidebar nav button.active{background:#edf1f8!important;color:#354559!important;box-shadow:inset -4px 0 #354559;border-color:#dbe4f0}
body[data-mada-unified-age] .mada-topbar .userpill .avatar,body[data-mada-unified-age] .mada-topbar .avatar{background:#fff2d2;color:#354559;border:2px solid #ffc44d;}
body[data-mada-unified-age] #mobile-menu-toggle{background:#fff;color:#354559;border:1px solid #e6eaf2;box-shadow:0 3px 11px #35455913}
body[data-mada-unified-age] .global-page-back{border-color:#e9ebf2;background:#fff;box-shadow:0 4px 15px #35455911}
/* Spacious main content, consistent top/bottom margins and typography */
body.mada-unified-content #main.mada-unified-main{width:100%;min-width:0;max-width:1530px;margin-inline:auto;padding:clamp(14px,2vw,28px)!important;overflow:visible;position:relative;isolation:isolate;background:transparent;}
body.mada-unified-content #main.mada-unified-main::before{content:"";pointer-events:none;position:fixed;inset:auto -12% -35px;height:135px;z-index:-1;background:linear-gradient(105deg,#ffdb6a23,#f3a3c429,#88c6f630);border-radius:50% 50% 0 0}
body.mada-unified-content #main.mada-unified-main>h1{font-size:clamp(23px,3vw,32px);letter-spacing:-.015em;color:#354559;margin-block:15px 12px}
body.mada-unified-content #main.mada-unified-main>p.muted{color:#65748a}
body.mada-unified-content #main.mada-unified-main :is(.panel,.card,.stat,.game-card,.lesson-card,.rhythm-course-card,.kid-gallery-card,.qr-student-card){border-color:#e5e9f1;box-shadow:0 9px 28px #3545590a;border-radius:20px;}
body.mada-unified-content #main.mada-unified-main :is(.panel,.card,.game-card,.lesson-card){overflow-wrap:anywhere;}
body.mada-unified-content #main.mada-unified-main :is(.cardtop,.panel-header){background:linear-gradient(125deg,#fcfaff,#f3f8ff);border-bottom:1px solid #ecedf3;}
body.mada-unified-content #main.mada-unified-main :is(.card,.game-card,.lesson-card,.rhythm-course-card){transition:transform .16s ease,box-shadow .16s ease;}
@media (hover:hover){body.mada-unified-content #main.mada-unified-main :is(.card,.game-card,.lesson-card,.rhythm-course-card):hover{transform:translateY(-2px);box-shadow:0 13px 30px #35455916}}
body.mada-unified-content #main.mada-unified-main :is(.toolbar,.tabs){row-gap:9px;}
body.mada-unified-content #main.mada-unified-main input:not([type=checkbox]):not([type=radio]):not([type=range]),body.mada-unified-content #main.mada-unified-main select,body.mada-unified-content #main.mada-unified-main textarea{border-radius:12px;border-color:#dce3ee;min-width:0;max-width:100%;}
body.mada-unified-content #main.mada-unified-main :is(button,.button){border-radius:12px;}
body.mada-unified-content #main.mada-unified-main :is(.badge,.pill){font-weight:800;}
body.mada-unified-content #main.mada-unified-main .badge.gold{background:#fff0bd;color:#795501;}
/* Unified feature image banner for every inner route; artwork is reused from V105 age designs */
.mada-unified-banner{--hero-bg:linear-gradient(125deg,#ffdc45,#ffe983);--hero-fg:#2e3e55;min-height:190px;display:grid;grid-template-columns:minmax(0,1.2fr) minmax(175px,.8fr);border-radius:25px;overflow:hidden;isolation:isolate;position:relative;color:var(--hero-fg);box-shadow:0 11px 28px #35455917;margin-bottom:20px;background:var(--hero-bg);border:1px solid #ffffff87;}
body[data-mada-unified-age="middle"] .mada-unified-banner{--hero-bg:linear-gradient(122deg,#0f71bf,#2a7fc2);--hero-fg:#fff;}
body[data-mada-unified-age="senior"] .mada-unified-banner{--hero-bg:linear-gradient(120deg,#25364d,#43546c);--hero-fg:#fff;}
.mada-unified-banner--lessons{--hero-bg:linear-gradient(123deg,#ffe1ee,#f5bfdf)}
body[data-mada-unified-age="middle"] .mada-unified-banner--lessons{--hero-bg:linear-gradient(123deg,#ab126a,#e62584)}
body[data-mada-unified-age="senior"] .mada-unified-banner--lessons{--hero-bg:linear-gradient(125deg,#fff,#e8eef6);--hero-fg:#354559}
.mada-unified-banner--games,.mada-unified-banner--rhythm{--hero-bg:linear-gradient(120deg,#fff0be,#ffc767)}
body[data-mada-unified-age="middle"] .mada-unified-banner--games,body[data-mada-unified-age="middle"] .mada-unified-banner--rhythm{--hero-bg:linear-gradient(120deg,#c92375,#e96e96)}
body[data-mada-unified-age="senior"] .mada-unified-banner--games,body[data-mada-unified-age="senior"] .mada-unified-banner--rhythm{--hero-bg:linear-gradient(120deg,#25364e,#40506a)}
.mada-unified-banner--piano{--hero-bg:linear-gradient(120deg,#c0eaff,#80c3f6)}
.mada-unified-banner--reports{--hero-bg:linear-gradient(120deg,#c0eaff,#e3f4ff)}
body[data-mada-unified-age="middle"] .mada-unified-banner--reports{--hero-bg:linear-gradient(120deg,#1268aa,#328ccd)}
body[data-mada-unified-age="senior"] .mada-unified-banner--reports{--hero-bg:linear-gradient(120deg,#25364e,#40506a)}
.mada-unified-banner-content{position:relative;z-index:2;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;padding:20px clamp(17px,2.5vw,35px);gap:8px;min-width:0;}
.mada-unified-brand-line{display:flex;align-items:center;gap:10px;margin-bottom:0;opacity:.98;font-size:11px;font-weight:800;}
.mada-unified-brand-line img{width:56px;height:38px;object-fit:contain;filter:drop-shadow(0 2px 2px #00000010);}
.mada-unified-breadcrumb{display:flex;gap:7px;align-items:center;font-size:12px;font-weight:750;opacity:.86;flex-wrap:wrap;}
.mada-unified-breadcrumb button{font-size:inherit!important;color:inherit!important;background:transparent!important;padding:0 3px!important;text-decoration:underline;text-underline-offset:3px;box-shadow:none!important;min-height:25px;}
.mada-unified-banner h1{font-size:clamp(24px,3vw,39px);color:inherit;line-height:1.25;margin:0;font-weight:900;letter-spacing:-.015em;}
.mada-unified-banner p{font-size:clamp(11px,1vw,14px);line-height:1.6;color:inherit;opacity:.88;margin:0;max-width:440px;}
.mada-unified-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:4px;}
.mada-unified-actions button{font-size:12px;font-weight:850;min-height:35px;padding:7px 13px;border-radius:999px;background:#fff;color:#354559;box-shadow:0 2px 6px #00000015;}
.mada-unified-actions button.mada-unified-secondary-action{background:#ffffff24;color:inherit;border:1px solid #ffffff77;box-shadow:none;}
.mada-unified-banner-art{position:relative;min-width:0;overflow:hidden;z-index:1}
.mada-unified-banner-art img{height:100%;width:100%;object-fit:cover;object-position:center;display:block;transform:scale(1.04);}
.mada-unified-banner-art::before{content:"";position:absolute;inset:0;z-index:2;background:linear-gradient(to left,transparent 56%,var(--hero-fade,#fff0) 100%);pointer-events:none;}
[dir="rtl"].mada-unified-banner .mada-unified-banner-art::before{background:linear-gradient(to right,transparent 35%,#ffffff00 100%)}
.mada-unified-brand-strip{position:absolute;z-index:3;bottom:0;inset-inline:0;display:flex;height:6px;direction:ltr}
.mada-unified-brand-strip i{flex:1;background:#ffe650}.mada-unified-brand-strip i:nth-child(2){background:#f18b00}.mada-unified-brand-strip i:nth-child(3){background:#e62584}.mada-unified-brand-strip i:nth-child(4){background:#1667af}
/* Bottom navigation consistent with V105 homepage on tablets and phones */
.mada-unified-bottom{display:none;}
@media(max-width:900px){
 body.mada-unified-content #main.mada-unified-main{padding:12px 12px max(20px,env(safe-area-inset-bottom))!important;}
 body.mada-unified-content .mada-topbar{height:65px!important;min-height:65px;padding-inline:12px!important;}
 body.mada-unified-content .mada-shell{min-height:calc(100dvh - 65px);}
 .mada-unified-bottom{display:flex;position:sticky;bottom:env(safe-area-inset-bottom,0px);z-index:23;background:#fffefefa;backdrop-filter:blur(10px);border-radius:16px;box-shadow:0 4px 22px #35455919;border:1px solid #e6eaf0;padding:5px 3px max(5px,env(safe-area-inset-bottom,0px));gap:2px;justify-content:space-around;margin-top:15px;}
 .mada-unified-bottom button{flex:1;min-width:0;min-height:47px;display:flex;flex-direction:column;align-items:center;gap:1px;justify-content:center;background:transparent;color:#485b71;padding:4px 1px;border-radius:12px;box-shadow:none;border:0;}
 .mada-unified-bottom button.active{background:#fff0f7;color:#e62584}
 .mada-unified-bottom button>span{font-size:23px;line-height:1.12}.mada-unified-bottom button>small{font-size:10px;white-space:nowrap;letter-spacing:-.02em;color:inherit;}
 body[data-mada-unified-age="middle"] .mada-unified-bottom button.active{background:#e9f4ff;color:#1667af}
 body[data-mada-unified-age="senior"] .mada-unified-bottom button.active{background:#e8edf5;color:#354559}
}
@media(max-width:600px){
 .mada-unified-banner{min-height:139px;grid-template-columns:minmax(0,1.35fr) minmax(98px,.65fr);border-radius:18px;margin-bottom:12px;}
 .mada-unified-banner-content{padding:12px;gap:5px;}
 .mada-unified-brand-line img{height:30px;width:42px}.mada-unified-brand-line{font-size:9px;gap:5px}
 .mada-unified-breadcrumb{font-size:10px;line-height:1.25;gap:4px;}
 .mada-unified-banner h1{font-size:clamp(19px,5.6vw,26px);line-height:1.2}
 .mada-unified-banner p{font-size:10px;line-height:1.3;max-width:230px}
 .mada-unified-actions{margin-top:1px;gap:5px}
 .mada-unified-actions button{padding:6px 9px;font-size:10px;min-height:29px}
 body.mada-unified-content #main.mada-unified-main :is(.panel,.card){border-radius:15px;padding:clamp(11px,3vw,16px);}
 body.mada-unified-content #main.mada-unified-main :is(.cards,.game-grid,.lesson-grid){gap:9px}
 body.mada-unified-content #main.mada-unified-main>h1{font-size:22px;}
 body.mada-unified-content #main.mada-unified-main .toolbar{gap:7px;}
}
@media(max-width:360px){.mada-unified-banner p{display:none}.mada-unified-banner{min-height:119px}.mada-unified-banner h1{font-size:18px}.mada-unified-brand-line{display:none}.mada-unified-bottom button>small{font-size:9px}}
@media(prefers-reduced-motion:reduce){body.mada-unified-content #main :is(.card,.game-card){transition:none!important}}
/* Dedicated full-screen instrument/number practice must retain its natural dimensions. */
body.mada-unified-focus #main{background:transparent;}
body.mada-unified-focus .mada-unified-bottom,body.mada-unified-focus .mada-unified-banner{display:none!important}
/* Identical AR/EN control used in every internal banner. */
.mada-unified-brand-line{width:100%;}
.mada-unified-lang{margin-inline-start:auto;display:flex;align-items:center;gap:2px;direction:ltr;border-radius:24px;border:1px solid #ffffffaf;background:#ffffffbc;padding:2px;}
.mada-unified-lang button{background:transparent!important;border-radius:20px!important;color:#354559!important;min-height:24px!important;padding:3px 8px!important;font-size:10px!important;box-shadow:none!important;}
.mada-unified-lang button.active{background:#e62584!important;color:#fff!important;}
body[data-mada-unified-age="middle"] .mada-unified-lang button.active{background:#1667af!important;}
body[data-mada-unified-age="senior"] .mada-unified-lang button.active{background:#354559!important;}
@media(max-width:600px){.mada-unified-lang button{padding:2px 5px!important;font-size:9px!important;min-height:22px!important}.mada-unified-brand-line>span{display:none}}
/* Finishing touches across the original lesson, game and teacher modules. */
body[data-mada-unified-age] .mada-sidebar nav button,body[data-mada-unified-age] .mada-sidebar nav a{color:#526376!important;opacity:1!important;}
body[data-mada-unified-age] .mada-sidebar nav button.active{color:#c81773!important;}
body[data-mada-unified-age="middle"] .mada-sidebar nav button.active{color:#125f9e!important}
body[data-mada-unified-age="senior"] .mada-sidebar nav button.active{color:#354559!important}
body.mada-unified-content #main .v103-lessons-grid{gap:14px}
body.mada-unified-content #main .v103-lesson-tile{border-radius:19px;background:#fff;border:1px solid #e5e9f1;box-shadow:0 7px 24px #3545590d;overflow:hidden}
body.mada-unified-content #main .v103-lesson-tile img{border-radius:13px;object-fit:cover}
body.mada-unified-content #main .v103-lesson-head{background:linear-gradient(135deg,#ffffff,#faf3f9);border-radius:17px;padding:12px 17px;border:1px solid #eee4ec}
body.mada-unified-content #main .v103-term-tabs{gap:8px}
body.mada-unified-content #main .v103-term-tabs button.selected{background:#e62584;color:#fff}
body[data-mada-unified-age="middle"].mada-unified-content #main .v103-term-tabs button.selected{background:#1667af}
body[data-mada-unified-age="senior"].mada-unified-content #main .v103-term-tabs button.selected{background:#354559}
body.mada-unified-content #main .games-grid>.game-card{border-radius:19px!important;box-shadow:0 7px 22px #35455912;}
body.mada-unified-content #main .game-card:is(:hover,:focus-visible){border-color:#e62584;}
body.mada-unified-content #main .lesson-visual-banner{border-radius:19px;box-shadow:0 10px 23px #35455912;}
body.mada-unified-content #main .note-box{border-inline-start:4px solid #e62584;border-inline-end:0;background:linear-gradient(105deg,#fff5d7,#fff8fb);}
body.mada-unified-content #main .panel-title-row{gap:12px;flex-wrap:wrap}
body.mada-unified-content #main .band-banner{background:linear-gradient(115deg,#1667af,#e62584);border-radius:21px;box-shadow:0 8px 22px #35455914;}
body.mada-unified-content #main .stat{border-top:4px solid #ffe650}
body.mada-unified-content #main .stat:nth-child(4n+2){border-top-color:#f18b00}
body.mada-unified-content #main .stat:nth-child(4n+3){border-top-color:#e62584}
body.mada-unified-content #main .stat:nth-child(4n){border-top-color:#1667af}
.mada-unified-bottom button>small{max-width:100%;white-space:normal;text-wrap:balance;line-height:1.2;display:block;text-align:center;overflow-wrap:normal}
@media(max-width:420px){.mada-unified-bottom button{min-height:56px}.mada-unified-bottom button>small{font-size:9px}.mada-unified-bottom button>span{font-size:19px}}

/* A restrained brand accent on general inner-page content cards. */
body.mada-unified-content #main .cards>.card{background:linear-gradient(155deg,#fff 70%,#fff3f8);border-top:4px solid #e62584;}
body.mada-unified-content #main .cards>.card:nth-child(4n+2){background:linear-gradient(155deg,#fff 70%,#ecf7ff);border-top-color:#1667af;}
body.mada-unified-content #main .cards>.card:nth-child(4n+3){background:linear-gradient(155deg,#fff 70%,#fff6d6);border-top-color:#ffe650;}
body.mada-unified-content #main .cards>.card:nth-child(4n){background:linear-gradient(155deg,#fff 70%,#fff3df);border-top-color:#f18b00;}
.mada-unified-class-chip{font-size:10px;max-width:230px;border-radius:100px;padding:2px 8px;background:#ffffff5c;color:inherit;line-height:1.3;}
@media(max-width:600px){.mada-unified-class-chip{font-size:9px;max-width:190px;padding:2px 5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
