html{scroll-padding-top:88px}
.af-site-header{position:sticky;top:0;z-index:50;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:77px;padding:16px max(24px,calc((100vw - 1180px)/2));border-bottom:1px solid #e7edf5;background:#fff;box-shadow:0 2px 12px #14213b08;color:#10172c;font-family:'Hiragino Sans','Hiragino Kaku Gothic ProN','Noto Sans JP',system-ui,sans-serif}
.af-site-logo{display:flex;align-items:center;gap:12px;font-size:22px;font-weight:900;letter-spacing:-.5px;white-space:nowrap;text-decoration:none}
.af-site-mark{display:grid;place-items:center;flex:none;width:40px;height:40px;padding-right:3px;border-radius:10px;background:linear-gradient(135deg,#5bb9ff,#1663eb);color:#fff;font-size:29px;letter-spacing:-3px;transform:rotate(-9deg)}
.af-site-menu{position:relative;margin-left:auto;flex:none}
.af-site-menu summary{display:flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:8px 10px;border:1px solid #dce4ed;border-radius:10px;background:#eff3f8;color:#14213b;font-size:12px;font-weight:700;cursor:pointer;list-style:none;touch-action:manipulation}
.af-site-menu summary::-webkit-details-marker{display:none}
.af-site-header :is(a,summary):focus-visible{outline:3px solid #2168e9;outline-offset:3px}
.af-site-menu .af-site-close,.af-site-menu[open] .af-site-open{display:none}
.af-site-menu[open] .af-site-close{display:block}
.af-site-menu nav{position:absolute;top:calc(100% + 10px);right:0;display:flex;flex-direction:column;align-items:stretch;gap:4px;width:min(300px,calc(100vw - 32px));max-height:calc(100dvh - 100px);overflow-y:auto;margin:0;padding:10px;border:1px solid #dce4ed;border-radius:16px;background:#fff;box-shadow:0 12px 36px #14213b26}
.af-site-menu nav a{display:flex;align-items:center;gap:10px;min-height:48px;padding:12px 14px;border-radius:10px;font-size:15px;font-weight:700;line-height:1.7;color:#33413a;white-space:nowrap;text-decoration:none}
.af-site-menu nav a:hover,.af-site-menu nav a:focus-visible{background:#eff3f8;color:#174c37}
.af-site-menu nav .af-site-ai{background:#e5f3eb;color:#174c37}
.af-site-ai span{flex:1}
@media(max-width:760px){html{scroll-padding-top:80px}.af-site-header{min-height:69px;padding:12px 16px}.af-site-logo{font-size:17px;gap:8px}.af-site-mark{width:34px;height:34px;font-size:25px}}
@media(max-width:370px){.af-site-logo{font-size:15px}}
@media print{.af-site-header{display:none}html{scroll-padding-top:0}}

/* Keep the shared header independent of the lesson typography. */
.af-site-header{max-width:none;width:100%;margin:0;line-height:1.7;letter-spacing:normal;flex-wrap:nowrap}
.af-site-header,.af-site-header *{box-sizing:border-box}
.af-site-logo{color:#10172c}
.af-site-menu{padding:0;border:0;background:none;color:#14213b}
.af-site-menu summary{margin:0;line-height:1.7;letter-spacing:normal}
.af-site-menu summary::after{content:none}
.af-site-menu nav{font-size:15px;font-weight:700;flex-wrap:nowrap}
.af-site-menu nav a{justify-content:flex-start;background:transparent;border:0}
.af-site-menu svg{flex:none;display:block}
.ai-local-nav{display:flex;justify-content:center;flex-wrap:wrap;gap:8px;padding:12px 18px;border-bottom:1px solid #d9dfce;background:#fffdf5}
.ai-local-nav a{display:flex;align-items:center;justify-content:center;min-height:44px;padding:6px 14px;border-radius:8px;background:#eef1e5;font-size:13px;text-decoration:none}
@media print{.ai-local-nav{display:none}}
