/* Shared site navigation. Scope to the outer header, never demo replicas. */
html:has(>body.academy-main-nav){scrollbar-gutter:stable}
body.academy-main-nav{--academy-header-height:80px}
body.academy-main-nav>.topbar{--body:'Noto Sans JP',Arial,sans-serif;--ink:#242334;--sub:#686774;--line:#e5e4eb;--accent:#6145d9}
body.academy-main-nav>.topbar,body.academy-main-nav>.topbar *{box-sizing:border-box}
body.academy-main-nav>.topbar .brand{display:flex;align-items:center;line-height:1}
body.academy-main-nav>.topbar .brand img{display:block}
body.academy-main-nav>.topbar .nav a{display:flex;align-items:center;text-decoration:none}
body.academy-main-nav>.topbar .nav a::after{content:none}
body.academy-main-nav>.topbar .topbar-right a{text-decoration:none}

body.academy-main-nav>.topbar{height:80px;position:sticky;top:0;z-index:1000;background:#fff;border-bottom:1px solid #e5e4eb;box-shadow:none}
body.academy-main-nav>.topbar .topbar-in{position:relative;display:grid;grid-template-columns:minmax(208px,1fr) auto minmax(208px,1fr);align-items:center;gap:clamp(16px,2vw,32px);width:100%;max-width:none;height:80px;min-height:80px;margin:0;padding:0 clamp(20px,2.5vw,48px)!important}
body.academy-main-nav>.topbar .brand{grid-column:1;justify-self:start;flex:none;margin:0;padding:0}
body.academy-main-nav>.topbar .brand img{width:152px;max-width:152px;height:44px;max-height:44px;object-fit:contain}
body.academy-main-nav>.topbar .nav{grid-column:2;position:static;display:flex!important;flex-wrap:nowrap;align-items:center;justify-content:center;justify-self:stretch;gap:24px!important;width:auto;margin:0;padding:0;border:0;background:transparent;box-shadow:none;transform:none}
body.academy-main-nav>.topbar .nav a{flex:none;height:44px;min-height:44px;padding:10px 0;border:0;border-bottom:2px solid transparent;border-radius:0;background:transparent;box-shadow:none;font:500 14px/22px var(--body);letter-spacing:0;white-space:nowrap;color:var(--sub)}
body.academy-main-nav>.topbar .nav a[aria-current]{border-bottom-color:var(--accent);color:var(--accent);font-weight:500;box-shadow:none}
body.academy-main-nav>.topbar .nav a:hover{color:var(--accent);background:transparent}
body.academy-main-nav>.topbar .topbar-right{grid-column:3;display:flex;align-items:center;justify-self:end;gap:8px;margin:0}
body.academy-main-nav>.topbar .topbar-right :is(.account-nav,.access-nav-link){display:inline-flex;align-items:center;min-height:44px;margin:0;padding:0;border:0;border-radius:0;background:transparent;font:500 13px/20px var(--body);color:var(--ink);white-space:nowrap}
body.academy-main-nav>.topbar .topbar-right .btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100px;min-width:100px;height:44px;min-height:44px;padding:0 16px;border:1px solid var(--accent);border-radius:8px;background:var(--accent);color:#fff;font:700 13px/20px var(--body)}
body.academy-main-nav>.topbar .topbar-right .btn::before{content:none}
body.academy-main-nav>.topbar .topbar-right .btn::after{content:none}
body.academy-main-nav>.topbar .nav :is(.category-mobile-link,.category-mobile-divider,.category-mobile-account-actions,[data-account-mobile]),body.academy-main-nav>.topbar .ref-menu-toggle{display:none!important}
body.academy-main-nav>.topbar .academy-menu-backdrop{display:none}
@media(max-width:1100px){
 html:has(>body.academy-main-nav>.topbar .nav.ref-menu-open){overflow:hidden;scrollbar-gutter:auto}
 body.academy-main-nav:has(>.topbar .nav.ref-menu-open){width:calc(var(--academy-menu-width,100vw) - var(--academy-menu-gutter,0px))}
 body.academy-main-nav>.topbar .academy-menu-backdrop{position:fixed;inset:var(--academy-header-height) auto 0 0;z-index:0;margin:0;padding:0;width:var(--academy-menu-width,100vw);height:auto;border:0;border-radius:0;background:rgba(55,59,64,.38);cursor:pointer}
 body.academy-main-nav>.topbar:has(.nav.ref-menu-open) .academy-menu-backdrop{display:block}

 body.academy-main-nav>.topbar .topbar-in{grid-template-columns:minmax(0,1fr) auto;gap:16px}
 body.academy-main-nav>.topbar .topbar-right{display:none}
 body.academy-main-nav>.topbar .ref-menu-toggle{display:block!important;position:relative;grid-column:2;grid-row:1;margin:0;width:44px;height:44px;padding:0;background:transparent;border:0;border-radius:8px;color:var(--ink);font-size:0;cursor:pointer}
 body.academy-main-nav>.topbar .ref-menu-toggle::before,
 body.academy-main-nav>.topbar .ref-menu-toggle::after{content:'';position:absolute;left:11px;top:21px;width:22px;height:2px;border-radius:2px;background:currentColor;pointer-events:none}
 body.academy-main-nav>.topbar .ref-menu-toggle::before{box-shadow:0 -7px 0 currentColor,0 7px 0 currentColor}
 body.academy-main-nav>.topbar .ref-menu-toggle::after{display:none}
 body.academy-main-nav>.topbar .ref-menu-toggle[aria-expanded="true"]::before{box-shadow:none;transform:rotate(45deg)}
 body.academy-main-nav>.topbar .ref-menu-toggle[aria-expanded="true"]::after{display:block;transform:rotate(-45deg)}
 body.academy-main-nav>.topbar .ref-menu-toggle:focus-visible{outline:3px solid #9d87ed;outline-offset:3px}
 body.academy-main-nav>.topbar .nav{display:none!important}
 body.academy-main-nav>.topbar .nav.ref-menu-open{position:fixed;grid-column:auto;z-index:1;display:flex!important;flex-direction:column;align-items:stretch;justify-content:flex-start;top:var(--academy-header-height);left:0;right:auto;width:var(--academy-menu-width,100vw);max-width:none;margin:0;border-radius:0;gap:0!important;overscroll-behavior:contain;max-height:calc(100dvh - 80px);overflow:auto;padding:12px 32px 20px;border-bottom:1px solid var(--line);background:#fff;box-shadow:0 16px 24px #2423340a}
 body.academy-main-nav>.topbar .nav a{height:44px;padding:10px 12px;border:0;border-radius:6px}
 body.academy-main-nav>.topbar .nav a[aria-current]{background:#f2eefc}
 body.academy-main-nav>.topbar .nav .category-mobile-divider{display:block!important;flex:none;width:100%;height:0;margin:8px 0;border:0;border-top:1px solid var(--line)}
 body.academy-main-nav>.topbar .nav .category-mobile-help{min-height:40px;height:40px;font-size:13px;color:var(--sub)}
 body.academy-main-nav>.topbar .nav .category-mobile-account-actions{display:grid!important;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:12px;margin-top:12px}
 body.academy-main-nav>.topbar .nav .category-mobile-account-actions a{display:flex!important;align-items:center;justify-content:center;min-height:46px;height:46px;padding:10px 12px;border:1px solid var(--accent);border-radius:8px;background:#fff;color:var(--accent);font:500 14px/22px var(--body);text-decoration:none}
 body.academy-main-nav>.topbar .nav .category-mobile-account-actions .category-mobile-register{background:var(--accent);color:#fff}
 body.academy-main-nav>.topbar .nav .category-mobile-account-actions a:hover{background:#f2eefc}
 body.academy-main-nav>.topbar .nav .category-mobile-account-actions .category-mobile-register:hover{background:#5035b9}

 body.academy-main-nav>.topbar .nav .category-mobile-link,body.academy-main-nav>.topbar .nav [data-account-mobile]{display:flex!important}
}
@media(max-width:700px){
 body.academy-main-nav{--academy-header-height:68px}
 body.academy-main-nav>.topbar{height:68px}
 body.academy-main-nav>.topbar .topbar-in{height:68px;min-height:68px;padding:0 20px!important}
 body.academy-main-nav>.topbar .brand img{width:132px;height:38px;max-height:38px}
 body.academy-main-nav>.topbar .nav.ref-menu-open{padding:8px 20px 16px;max-height:calc(100dvh - 68px)}
}


/* Shell bounds follow the shared header; the demo itself keeps its own styles. */
@media(min-width:901px){
 body.academy-main-nav.learning-shell .stage-practice,
 body.academy-main-nav.learning-shell .stage-practice>.practice-canvas{height:calc(100dvh - var(--academy-header-height))!important}
}
@media(max-width:900px){
 body.academy-main-nav.learning-mobile-active .stage-practice{height:calc(var(--learning-viewport-height,100dvh) - var(--academy-header-height))!important}
 body.academy-main-nav.learning-mobile-active .stage-practice>.practice-canvas{height:auto!important}
}

body.academy-main-nav>.topbar .topbar-right .btn.header-login{background:#fff;color:var(--accent)}
body.academy-main-nav>.topbar .topbar-right .btn.header-login:hover{background:#f2eefc}
body.academy-main-nav>.topbar .topbar-right .btn.header-register:hover{background:#5035b9}
