/* A real full-width band paints the entire header, including its bottom edge.
   The inner header retains the existing max-width, padding and logo sizes. */
.site-header-band{position:relative;z-index:12;width:100%;background:#11182D;color:#FFFFFF}
.site-header{position:relative;background:transparent;color:#FFFFFF;border-bottom-color:transparent}
.site-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:24px;min-width:0}
.site-header .home-shortcuts{display:flex;align-items:center;gap:24px;flex-shrink:0}
.site-header .home-header-link{font-size:13px;white-space:nowrap;display:flex;align-items:center;gap:8px;padding:12px 0;line-height:1.5;text-decoration:none}
.site-header .home-tools-menu{position:relative}
.site-header .home-tools-menu summary{list-style:none;cursor:pointer;touch-action:manipulation}
.site-header .home-tools-menu summary::-webkit-details-marker{display:none}
.site-header .menu-chevron{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s}
.site-header .home-tools-menu[open] .menu-chevron{transform:rotate(180deg)}
.site-header .brand,.site-header .brand-name,.site-header .home-header-link,.site-header .reference-nav,.site-header .symbols-home{color:#FFFFFF}
.site-header .home-brand-en,.site-header .current-page,.site-header .home-header-link:hover,.site-header .home-tools-menu[open]>summary{color:#AE9FFF}
.site-header .nav-tools select,.site-header .nav-tools button{color:#F5F1E9;background:#1D2540;border-color:#FFFFFF30;color-scheme:dark}
.site-header .nav-tools select:hover,.site-header .nav-tools button:hover:not(:disabled){border-color:#AE9FFF}
.site-header .nav-tools .record-trigger{color:#FFFFFF;background:#6C57E8;border-color:#6C57E8}
.site-header .nav-tools .record-trigger:hover:not(:disabled),.site-header .nav-tools .record-trigger[aria-pressed="true"]{color:#FFFFFF;background:#5C49CE;border-color:#AE9FFF}
body.lesson .site-header button[data-shortcut]::after,body.lesson button.primary[data-shortcut]::after{opacity:1}
.site-header :is(a,button,select,summary):focus-visible{outline:2px solid #AE9FFF;outline-offset:3px;border-radius:4px}
.site-header select option{background:#1D2540;color:#FFFFFF}
.site-header .learning-tool-list{position:absolute;z-index:20;right:0;top:calc(100% + 8px);width:344px;max-width:calc(100vw - 36px);padding:7px;border:1px solid #FFFFFF30;border-radius:14px;color:#FFFFFF;background:#1D2540;box-shadow:0 14px 40px #00000030}
.site-header .learning-tool-link{display:flex;align-items:center;gap:12px;border-radius:9px;padding:15px 12px;text-decoration:none}
.site-header .learning-tool-link>div{min-width:0}
.site-header .learning-tool-link h3{font-size:14px;font-weight:600;margin:0 0 4px;line-height:1.5}
.site-header .learning-tool-link p{font-size:11px;line-height:1.7;margin:0}
.site-header .learning-tool-link svg{flex:0 0 34px;width:34px;height:34px;stroke:#AE9FFF;stroke-width:1.8;fill:#FFFFFF;stroke-linecap:round;stroke-linejoin:round}
.site-header .learning-tool-link svg text{stroke:none;fill:#11182D;font-family:Cambria,serif}
.site-header .learning-tool-link svg .icon-soft{fill:#DED6FA;stroke:none}.site-header .learning-tool-link svg .icon-line{fill:none}
.site-header .learning-tool-link h3{color:#FFFFFF}.site-header .learning-tool-link p{color:#C6C7D8}
.site-header .learning-tool-link:hover,.site-header .learning-tool-link:focus-visible{background:#293250}
.site-header .tool-arrow{color:#AE9FFF;margin-left:auto;font-size:18px}
.recording>.site-header-band{display:none}
@media(max-width:1200px){.site-header-actions{flex-wrap:wrap;gap:8px 20px}}
@media(max-width:760px){
 .site-header-band .site-header{flex-wrap:wrap;gap:8px}
 .site-header-actions{flex:1 0 100%;gap:8px}
 .site-header .home-shortcuts{flex-basis:100%;justify-content:space-between;gap:14px}
 .site-header .home-header-link{font-size:13px;min-height:44px;padding:12px 0}
 .site-header .nav-tools{flex:1 1 100%;justify-content:space-between;gap:4px;min-width:0}
 .site-header .nav-tools #lesson-nav{flex:1 1 100px;min-width:0;max-width:180px}
 .site-header .nav-tools #layout,.site-header .nav-tools button{flex-shrink:0}
 .site-header .home-tools-menu .learning-tool-list{top:100%}
}

/* Brand identity and a separate, unboxed specialty wordmark. */
.header-identity{display:flex;align-items:center;gap:24px;flex-shrink:0;min-width:0}
.site-header .brand .brand-lockup{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;border:0;min-width:0}
.site-header .brand .brand-name{font-size:20px;font-weight:700;letter-spacing:.2px;line-height:1.35;margin:0;padding:0;border:0}
.site-header .brand .brand-subline{display:flex;align-items:center;margin:0;padding:0;border:0;line-height:1.4}
.site-header .brand .brand-en{font:11px/1.4 Arial,sans-serif;letter-spacing:1.6px;color:#AE9FFF;margin:0;padding:0;border:0}
/* A lighter purple keeps this wordmark legible on the navy header. */
.site-header .brand-feature{display:block;border-left:1px solid #FFFFFF30;padding:6px 0 6px 24px;color:#9479FF;font-size:20px;line-height:1.5;font-weight:700;letter-spacing:1.2px;white-space:nowrap}
.site-header .brand-feature::after{content:"";display:block;width:1.4em;height:2px;margin-top:5px;border-radius:2px;background:currentColor}
@media(max-width:1050px){.header-identity{gap:16px}.site-header .brand-feature{font-size:18px;padding-left:16px}.site-header .brand .brand-name{font-size:18px}}
@media(max-width:760px){.header-identity{gap:14px}.site-header .brand .brand-name{font-size:17px;letter-spacing:0}.site-header .brand .brand-en{font-size:10px;letter-spacing:1px}.site-header .brand .brand-lockup{gap:4px}.site-header .brand-feature{font-size:16px;letter-spacing:.5px;padding-left:14px}}
@media(max-width:520px){.header-identity{width:100%;gap:12px}.site-header .header-identity .brand{flex:0 1 auto;gap:6px}.site-header .header-identity .brand-logo{width:42px;height:42px}.site-header .brand .brand-name{font-size:16px}.site-header .brand-feature{font-size:14px;letter-spacing:0;padding:4px 0 4px 12px;margin-left:auto}}
@media(max-width:380px){.header-identity{gap:8px}.site-header .header-identity .brand-logo{width:36px;height:36px}.site-header .brand .brand-name{font-size:14px}.site-header .brand .brand-en{font-size:9px}.site-header .brand-feature{font-size:12px;padding-left:10px}}

/* One shared footer across the home, lessons, practice and reference pages. */

/* Keep short pages as tall as the visible viewport, without fixing the footer
   over content or changing the lesson canvas. Recording and print keep their
   existing layout. The vh fallback also supports older tablet browsers. */
@media screen{
 body:not(.recording){display:flex;flex-direction:column;min-height:100vh;min-height:100dvh}
 body:not(.recording)>main{width:100%;flex:1 0 auto;margin-top:0;margin-bottom:0}
 body:not(.recording)>.site-header-band,
 body:not(.recording)>.help-line,
 body:not(.recording)>.brand-footer{flex-shrink:0}
}

@media (max-width:350px){
  .site-header .header-identity{flex-wrap:wrap;row-gap:4px}
  .site-header .header-identity .brand-feature{margin-left:0}
}
.brand-footer{position:relative;isolation:isolate;overflow:hidden;background:#11182D;color:#FFFFFF;margin:24px 0 0;padding:28px 32px 14px;width:100%;max-width:none}
.brand-footer::before{content:"";position:absolute;z-index:-1;width:370px;height:370px;border:1px solid #6C57E82B;border-radius:50%;right:-110px;top:-180px;box-shadow:0 0 0 75px #11182D,0 0 0 76px #6C57E81F,0 0 0 150px #11182D,0 0 0 151px #6C57E815;pointer-events:none}
.brand-footer-inner{max-width:1086px;margin:0 auto;display:grid;grid-template-columns:minmax(280px,.9fr) minmax(0,1.5fr);column-gap:55px;row-gap:16px;align-items:center}
.footer-identity{display:flex;align-items:center;gap:9px;width:fit-content;color:#FFFFFF}
.footer-identity img{display:block;flex-shrink:0;width:78px;height:78px}
.footer-identity strong{display:block;font-size:21px;line-height:1.5;white-space:nowrap;font-weight:650;letter-spacing:.2px}
.footer-english{display:block;color:#AE9FFF;font-family:Arial,sans-serif;font-size:15px;letter-spacing:1.7px;margin-top:8px}
.footer-belief{font-size:clamp(20px,2.05vw,27px);line-height:1.9;letter-spacing:.1px;font-weight:550;position:relative;padding-top:12px;margin:0}
.footer-belief:before{content:"";position:absolute;top:0;left:0;width:52px;height:3px;background:#6C57E8}
.footer-belief span{white-space:nowrap;color:#9479FF}
.brand-footer .footer-registration{justify-self:center;color:#c7ccda;text-decoration:none;white-space:nowrap}
.brand-footer .footer-registration:hover,.brand-footer .footer-registration:focus{color:#fff;text-decoration:underline}
.footer-bottom{grid-column:1/-1;border-top:1px solid #FFFFFF24;padding-top:10px;display:flex;justify-content:space-between;gap:20px;font-size:12px;color:#FFFFFFA6;line-height:1.7}
.footer-bottom a{color:#FFFFFF;white-space:nowrap}.footer-bottom a span{color:#AE9FFF;margin-left:10px}
.recording>.brand-footer{display:none}
@media(max-width:900px){.brand-footer-inner{grid-template-columns:1fr;gap:8px}.footer-belief{font-size:25px}.footer-bottom{margin-top:0}}
@media(max-width:700px){.brand-footer{padding:16px 22px 10px;margin-top:14px}.brand-footer-inner{gap:8px}.footer-identity{gap:6px}.footer-identity img{width:65px;height:65px}.footer-identity strong{font-size:19px}.footer-english{font-size:13px;letter-spacing:1.5px;margin-top:5px}.footer-belief{font-size:21px;padding-top:10px;line-height:1.95}.footer-bottom{padding-top:8px;font-size:11px;gap:15px;align-items:flex-start}.footer-bottom>span{max-width:210px}.brand-footer::before{right:-280px;top:-150px}}
@media(max-width:450px){.footer-belief{font-size:20px}.footer-identity strong{font-size:18px}}
@media(max-width:380px){.brand-footer{padding-left:18px;padding-right:18px}.footer-identity img{width:48px;height:48px}.footer-identity strong{font-size:16px}.footer-belief{font-size:18px}}
@media print{.site-header-band,.site-header,.brand-footer{display:none!important}}

/* Keep native select behavior, with the same inset chevron in every lesson and tool.
   Only arrow and text clearance override local padding/background shorthands. */
body select:not([multiple]){
 --select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath d='m2 2 6 6 6-6' fill='none' stroke='%236C57E8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
 -webkit-appearance:none;appearance:none;
 background-image:var(--select-chevron)!important;background-repeat:no-repeat!important;background-position:right 14px center!important;background-size:12px 8px!important;
 padding-right:40px!important;cursor:pointer;
}
.site-header .nav-tools select:not([multiple]){--select-chevron:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 10'%3E%3Cpath d='m2 2 6 6 6-6' fill='none' stroke='%23E9E2FF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
body select:disabled{cursor:not-allowed}
.controls select#speed{min-width:88px}
.site-header .nav-tools select#layout{min-width:114px;max-width:120px}
@media(max-width:520px){.site-header .nav-tools{flex-wrap:wrap}.site-header .nav-tools #lesson-nav{flex:1 1 100%;max-width:none}}
@media(forced-colors:active){body select:not([multiple]){-webkit-appearance:menulist;appearance:auto;background-image:none!important;padding-right:12px!important}}

/* Contact stays compact in the existing navy shell; the QR uses unchanged
   source pixels in an SVG viewport, with a complete white quiet zone. */
.site-header .header-contact{border:0;border-radius:0;background:transparent;color:#FFFFFF;font:inherit;font-size:13px;min-height:44px;padding:12px 0}
.site-header .header-contact:hover{color:#AE9FFF;background:transparent}
.brand-footer-inner{grid-template-columns:minmax(240px,.9fr) minmax(0,1.5fr) 184px;column-gap:28px}
.footer-contact{margin:0;text-align:center;justify-self:end;width:184px}
.footer-contact-open{display:block;width:128px;height:128px;min-height:0;padding:0;margin:0 auto;border:0;border-radius:8px;background:#FFFFFF;overflow:hidden;line-height:0}
.contact-qr-image{display:block;width:100%;height:auto;border-radius:8px;background:#FFFFFF}
.footer-contact figcaption{font-size:12px;line-height:1.6;margin-top:8px;color:#E4E0F2;white-space:nowrap}
.footer-contact-open:focus-visible{outline:2px solid #AE9FFF;outline-offset:4px}
body.contact-open{overflow:hidden}
.contact-overlay{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;padding:20px;background:rgba(17,24,45,.55);overscroll-behavior:contain}
.contact-overlay[hidden]{display:none!important}
.contact-dialog{position:relative;flex:none;width:min(368px,100%);max-height:calc(100vh - 40px);max-height:calc(100dvh - 40px);overflow:auto;padding:44px 24px 22px;border-radius:16px;background:#FFFFFF;color:#11182D;text-align:center;box-shadow:0 16px 64px #11182D26;outline:none}
.contact-dialog .contact-qr-image{width:min(296px,100%);margin:0 auto}
.contact-close{position:absolute;top:4px;right:4px;display:grid;place-items:center;width:40px;height:40px;min-height:40px;padding:0;border:0;background:transparent;border-radius:8px;color:#5D6272}
.contact-close:hover{background:#F5F3FB;color:#6C57E8}
.contact-close svg{display:block;width:20px;height:20px;margin:0;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
.contact-message{font-size:14px;line-height:1.7;white-space:nowrap;margin:10px 0 0}
@media(max-width:1099px){
 .brand-footer-inner{grid-template-columns:minmax(0,1fr) 184px;gap:12px 24px}
 .footer-identity{grid-column:1;grid-row:1}.footer-belief{grid-column:1;grid-row:2}
 .footer-contact{grid-column:2;grid-row:1/3;align-self:center}.footer-bottom{grid-row:3}
}
@media(max-width:600px){
 .brand-footer-inner{grid-template-columns:minmax(0,1fr);row-gap:16px}
 .footer-contact{grid-column:1;grid-row:3;justify-self:center;width:auto;text-align:center}
 .footer-contact-open{margin:0 auto}.footer-bottom{grid-row:4}
}
@media(max-height:520px) and (orientation:landscape){
 .contact-dialog{width:284px;padding:32px 20px 14px}
 .contact-dialog .contact-qr-image{width:min(220px,calc(100vh - 124px));width:min(220px,calc(100dvh - 124px))}
 .contact-message{font-size:13px;margin-top:8px}
}
.recording>.contact-overlay{display:none!important}
@media print{.contact-overlay,.footer-contact,.header-contact{display:none!important}body.contact-open{overflow:visible}}

.brand-footer .footer-bottom{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:6px 16px}
.footer-links,.footer-support-links{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:4px 16px}
@media(max-width:640px){
 .brand-footer .footer-bottom{gap:6px 8px}
 .footer-bottom>span:first-child{grid-column:1/-1;max-width:none}
 .footer-links{display:contents}
 .footer-bottom .browser-help-link,.footer-support-links{grid-column:1;grid-row:2}
 .footer-support-links{flex-direction:column;align-items:flex-start;gap:3px}
 .footer-support-links a{white-space:normal}
 .footer-bottom .footer-registration{grid-column:2;grid-row:2}
 .footer-links>a:last-child{grid-column:3;grid-row:2;justify-self:end;text-align:right}
 .footer-links>a{white-space:normal}
}
.browser-notice{margin:10px auto;padding:10px 16px;max-width:1080px;color:#211b43;background:#f4f1ff;font:15px/1.6 sans-serif}.browser-notice a{color:#493aa8;text-decoration:underline}

/* Tablet lessons: site navigation above, classroom controls below. */
@media screen and (min-width:700px) and (max-width:1599px) {
  body.lesson .site-header-band .site-header {
    display:grid;
    grid-template-columns:auto minmax(0,1fr);
    align-items:center;
    gap:6px 18px;
    padding:10px 28px;
  }
  body.lesson .site-header-actions {display:contents}
  body.lesson .site-header .home-shortcuts {
    justify-self:end;
    justify-content:flex-end;
    gap:clamp(12px,2vw,24px);
  }
  body.lesson .site-header .nav-tools {
    grid-column:1/-1;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:8px;
    padding-top:8px;
    border-top:1px solid #363d51;
  }
  body.lesson .nav-tools #lesson-nav {
    flex:0 1 36%;
    width:36%;
    min-width:240px;
    max-width:420px;
    margin-right:auto;
  }
  body.lesson .site-header .nav-tools select,
  body.lesson .site-header .nav-tools button {min-height:44px}
  body.lesson .site-header .nav-tools .icon-only {min-width:44px}
}

.site-header a.brand-feature{text-decoration:none}.site-header a.brand-feature:hover,.site-header a.brand-feature:focus-visible{color:#c7baff}

.site-header .brand-course-suffix{color:#fff}

/* Give the full course name its own row on compact tablets. */
@media screen and (min-width:600px) and (max-width:900px){
  .site-header-band .site-header,body.lesson .site-header-band .site-header{display:grid;grid-template-columns:minmax(0,1fr);gap:4px;height:auto}
  .site-header-band .site-header .header-identity{grid-column:1}
  .site-header-band .site-header .site-header-actions{display:contents}
  .site-header-band .site-header .home-shortcuts,body.lesson .site-header .home-shortcuts{grid-column:1;justify-self:stretch;justify-content:flex-end;flex-wrap:wrap;gap:4px 18px}
  .site-header-band .site-header .home-header-link{min-height:44px}
}
.site-header .phone-menu-toggle,.site-header .phone-course-link{display:none}
@media screen and (max-width:599px) and (orientation:portrait){
  .site-header-band .site-header.phone-menu-ready{
    display:grid;grid-template-columns:minmax(0,1fr);gap:0;min-height:0;height:auto;padding:25px clamp(10px,calc(12vw - 28px),16px) 15px;
  }
  .phone-menu-ready .header-identity{width:100%;flex-wrap:nowrap;justify-content:space-between;gap:8px}
  .site-header.phone-menu-ready .header-identity .brand{flex:0 1 auto;gap:6px}
  .site-header.phone-menu-ready .header-identity .brand-logo{width:clamp(61px,17.75vw,75px);height:clamp(61px,17.75vw,75px)}
  .site-header.phone-menu-ready .brand .brand-name{font-size:clamp(17px,5.3vw,23px);letter-spacing:0;white-space:nowrap}
  .site-header.phone-menu-ready .brand .brand-en{font-size:clamp(11px,3.2vw,13px);letter-spacing:1.3px}
  .site-header.phone-menu-ready .brand-feature{display:none}
  .site-header.phone-menu-ready .phone-menu-toggle{
    display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:none;min-height:44px;
    padding:0 8px;border:0;background:transparent;color:#fff;font:inherit;font-size:15px;cursor:pointer;
  }
  .phone-menu-toggle::after{content:"";width:7px;height:7px;border:solid #bcb1ff;border-width:0 1.5px 1.5px 0;transform:translateY(-2px) rotate(45deg)}
  .phone-menu-toggle[aria-expanded="true"]::after{transform:translateY(2px) rotate(225deg)}
  .phone-menu-ready .site-header-actions{display:contents}
  .site-header.phone-menu-ready .home-shortcuts{display:none}
  .site-header.phone-menu-open .home-shortcuts{
    display:grid;grid-template-columns:minmax(0,1fr);gap:0;margin:7px 0 4px;padding:4px 12px;
    background:#1d2540;border:1px solid #363d51;border-radius:10px;
  }
  .site-header.phone-menu-open .home-header-link{
    display:flex;align-items:center;width:100%;min-height:44px;padding:10px 2px;text-align:left;font-size:15px;
  }
  .phone-menu-open .home-shortcuts>*+*{border-top:1px solid #363d51}
  .phone-menu-open .home-tools-menu summary{justify-content:space-between}
  .site-header.phone-menu-open .learning-tool-list{position:static;width:auto;max-width:none;box-shadow:none;border:0;padding:0 0 6px;background:transparent}
  .site-header.phone-menu-open .learning-tool-link{padding:8px}
  .phone-menu-open .learning-tool-list a[href*="singapore-math.html"]{display:none}
  .phone-menu-ready .nav-tools{margin-top:8px;width:100%}
}

/* The active section remains visible in the expanded mobile menu. */
.site-header .home-shortcuts .home-header-link[aria-current],
.site-header a.brand-feature[aria-current]{color:#ddd5ff;text-decoration:underline;text-decoration-color:#aa95ff;text-decoration-thickness:2px;text-underline-offset:5px}
.site-header .learning-tool-link[aria-current]{background:#eeeaff;color:#4935a4}
@media screen and (max-width:599px) and (orientation:portrait){
 .site-header.phone-menu-open .home-header-link[aria-current]{background:#30284b;box-shadow:inset 3px 0 #b7a7ff}
}

/* Keep the tablet navigation close to the brand when the links wrap. */
@media screen and (min-width:701px) and (max-width:1200px) {
  body:not(.lesson) .site-header-band .site-header.home-header {
    min-height:101px;
    padding-top:9px;
    padding-bottom:9px;
    row-gap:2px;
  }
}

@media screen and (min-width:901px) {
  .site-header-band .site-header.home-header { flex-wrap:wrap }
  .site-header.home-header .site-header-actions { flex:0 0 auto; max-width:100%; margin-left:auto }
  .site-header.home-header .home-shortcuts { flex-wrap:wrap }
}
