/* Shared JovialSight brand frame; practice colours remain local to the tool. */
html,body{height:auto;min-height:100%;overflow:visible}
body{display:block}
.site-shell{width:min(1180px,calc(100% - 40px));margin:0 auto}
.site-header,.site-footer{color:#17352f;background:#fff}
.site-header{border-bottom:1px solid rgba(23,53,47,.08)}
.nav-shell{min-height:78px;display:flex;align-items:center;justify-content:space-between;gap:20px}
.site-header a,.site-footer a{text-decoration:none;color:inherit}
.site-brand{display:flex;align-items:center;gap:11px;flex:none}
.brand-mark{width:42px;height:42px;object-fit:cover;border-radius:7px}
.brand-copy{display:flex;flex-direction:column;line-height:1.1}
.brand-copy strong{font-family:Georgia,'Times New Roman',serif;font-size:17px;letter-spacing:-.2px}
.brand-copy small{font-size:11px;letter-spacing:.18em;margin-top:4px;color:#53635f}
.site-navigation{display:flex;align-items:center}
.site-navigation a{padding:9px 13px;font-size:14px;font-weight:500;color:#53635f;min-height:44px;display:flex;align-items:center}
.site-navigation a.active{color:#1f6454;text-decoration:underline 2px #ffe15a;text-underline-offset:8px}
.site-navigation a:hover{color:#1f6454}
.menu-button{display:none;width:44px;height:44px;border:0;border-radius:12px;padding:10px;background:#edf2ed;color:#17352f;cursor:pointer}
.menu-button svg{width:24px;height:24px}
.site-header :focus-visible,.site-footer :focus-visible,#social-dialog :focus-visible{outline:3px solid #1f6454;outline-offset:3px}
#app{width:min(1540px,calc(100% - 48px));height:auto;min-height:calc(100dvh - 190px);margin:20px auto 28px}
.tool-title{font-size:23px;line-height:1.3;letter-spacing:-.02em;margin:0 0 14px;font-weight:850}
.lesson-control-row{display:block;margin-bottom:16px}
.lesson-controls{justify-content:flex-start;flex-wrap:wrap;gap:10px}
.lesson-controls .btn{min-height:44px;white-space:nowrap;font-size:15px;padding:10px 15px}
.workspace-left{container:lesson-panel / inline-size;display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:var(--shadow);padding:17px 19px;overflow:hidden}
.workspace-heading{flex:none}
.workspace-left .article-pane{flex:1;min-height:0;max-height:none;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent}
.workspace-heading .lesson-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.workspace-heading .lesson-controls .btn{padding:10px 8px}
.workspace-heading .lesson-control-row{margin-bottom:16px}
@container lesson-panel (min-width:540px){.workspace-heading .lesson-controls{grid-template-columns:repeat(4,minmax(0,max-content));gap:8px}.workspace-heading .lesson-controls .btn{padding:10px 12px}}
#screen-game.active{flex:none;gap:0}
.game-layout{display:grid;grid-template-columns:minmax(0,var(--article-share)) minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:16px;flex:none;height:max(680px,calc(100dvh - 220px))}
.article-text{overflow:auto;flex:1;min-height:0}
.practice-pane{overflow:visible}
.practice-pane .mini-game-area{height:clamp(180px,28dvh,300px);min-height:180px;flex:none}
.practice-pane .typing-stage[data-collapsed="true"]{height:48px;min-height:48px}
.input-area{position:static}
.word-card{overflow-x:hidden}
.prompt-line{display:flex;justify-content:center;flex-wrap:wrap;min-width:0;white-space:normal;max-width:100%}
.prompt-unit{min-width:max(1.8rem,2.5em);padding:0 1px}
.current-english{overflow-wrap:anywhere}
.site-footer{border-top:1px solid #e4e4e7}
.footer-inner{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:26px 0}
.footer-brand{display:flex;align-items:center;gap:11px;font-family:Georgia,serif;font-size:17px;font-weight:700}
.footer-brand img{border-radius:6px;flex:none}
.footer-brand span span{color:#1f6454}
.footer-social{display:flex;align-items:center;justify-content:center;gap:22px;flex-wrap:wrap}
.footer-social button{border:0;background:none;color:#53635f;padding:0;min-height:44px;display:inline-flex;align-items:center;gap:8px;font-size:14px;cursor:pointer}
.footer-social button:hover{color:#1f6454}
.footer-social svg{width:22px;height:22px;flex:none}
.footer-meta{text-align:right;color:#53635f}
.footer-meta nav{display:flex;justify-content:flex-end;gap:17px}
.footer-meta a{font-size:11px;font-weight:700;min-height:24px;display:flex;align-items:center}
.copyright{font-size:9px;letter-spacing:.04em;padding-top:8px}
#social-dialog{color:#17352f;background:#fff;border:1px solid #e4e4e7;border-radius:23px;padding:30px;max-width:440px;width:calc(100% - 28px);max-height:calc(100dvh - 28px);overflow:auto;text-align:center}
#social-dialog::backdrop{background:rgba(24,24,27,.44)}
#social-dialog h2{font-family:Georgia,serif;margin-top:12px;padding:0 20px;font-size:26px}
#social-dialog p{line-height:1.6;color:#53635f;font-size:16px}
#social-dialog img{display:block;width:min(240px,100%);height:auto;object-fit:contain;margin:20px auto}
#social-dialog a{display:block;text-decoration:none;color:#17352f;background:#edf2ed;border-radius:12px;padding:15px;margin-top:12px;font-weight:650}
.social-close{position:absolute;right:12px;top:10px;width:44px;height:44px;border:0;border-radius:50%;background:none;font-size:28px;color:#17352f;cursor:pointer}
@media(max-width:1050px){.footer-inner{flex-wrap:wrap;justify-content:center}.footer-meta{text-align:center}.footer-meta nav{justify-content:center}}
@media(max-width:980px){
 .nav-shell{flex-wrap:wrap;gap:0;padding:14px 0}
 .menu-button{display:grid;place-items:center}
 .site-navigation{display:none;order:3;width:100%;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;padding-top:14px}
 .site-navigation.is-open{display:grid}
 .site-navigation a{justify-content:center;border-radius:11px;background:#edf2ed}
}
@media(max-width:999px){
 #app{width:calc(100% - 32px);min-height:calc(100dvh - 170px);margin-top:16px}
 .game-layout{height:auto;grid-template-columns:minmax(0,1fr);grid-template-rows:clamp(180px,25dvh,320px) auto;gap:12px}
 .article-pane{padding:14px 16px}
 .workspace-left{padding:14px 16px}
 .article-text{overflow:auto;flex:1;line-height:1.5;font-size:16px}
 .practice-pane{overflow:visible}
 .mini-game-area{height:clamp(150px,22dvh,260px);flex:none;min-height:150px}
 .typing-stage[data-collapsed="true"]{height:48px;min-height:48px}
 .word-area{min-height:0}
 .word-card{min-height:118px}
 .input-area{padding:12px}
}
@media(min-width:1000px) and (max-height:650px){
 .game-layout{height:auto;min-height:540px;align-items:stretch}
 .article-pane{max-height:650px}
 .mini-game-area{height:150px;min-height:150px;flex:none}
}
/* Large tablets can exceed 1000px even in portrait. Screen orientation is
   stable while the keyboard changes the available viewport height. */
html[data-stacked="true"]:not([data-compact="true"]) .game-layout{height:auto;min-height:0;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:12px}
html[data-stacked="true"]:not([data-compact="true"]) .workspace-left{height:clamp(300px,36dvh,440px)}
html[data-stacked="true"]:not([data-compact="true"]) .article-pane{max-height:none}
html[data-stacked="true"]:not([data-compact="true"]) .practice-pane .mini-game-area{height:clamp(150px,22dvh,260px);min-height:150px;flex:none}
html[data-stacked="true"]:not([data-compact="true"]) .practice-pane .typing-stage[data-collapsed="true"]{height:48px;min-height:48px}
@media(max-width:650px){
 .site-shell{width:calc(100% - 26px)}
 .nav-shell{min-height:68px;padding:12px 0}
 .brand-mark{width:38px;height:38px}
 .brand-copy strong{font-size:15px}
 .footer-inner{flex-direction:column;gap:12px;text-align:center;padding:24px 0}
 .footer-meta a{min-height:44px;font-size:13px}
}
html[data-compact="true"] #app{width:calc(100% - 24px);min-height:calc(100dvh - 100px);margin:12px auto 24px}
html[data-compact="true"] .workspace-left{padding:0;border:0;border-radius:0;box-shadow:none;background:transparent;overflow:visible}
html[data-compact="true"] .tool-title{font-size:19px;margin-bottom:10px}
html[data-compact="true"] .lesson-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
html[data-compact="true"] .lesson-controls .btn{font-size:14px;padding:9px 8px;width:100%}
html[data-compact="true"] .lesson-control-row{margin-bottom:12px}
html[data-compact="true"] .article-pane,html[data-compact="true"] .typing-stage,html[data-compact="true"] .hud{display:none}
html[data-compact="true"] .typing-stage *{animation:none!important}
html[data-compact="true"] .game-layout{display:block;height:auto;min-height:0}
html[data-compact="true"] .practice-pane{overflow:visible}
html[data-compact="true"] .word-area{min-height:0;margin-bottom:10px}
html[data-compact="true"] .word-card{min-height:130px;padding:12px 10px;border-radius:16px}
html[data-compact="true"] .prompt-zh{font-size:28px}
html[data-compact="true"] .prompt-py{font-size:17px}
html[data-compact="true"] .current-english{font-size:16px;line-height:1.5;margin-top:10px}
html[data-compact="true"] .input-area{padding:10px;gap:10px;border-radius:16px}
html[data-compact="true"] .feedback{min-height:90px;padding:8px 10px}
html[data-compact="true"] .feedback-idle{min-height:48px}
html[data-compact="true"] .fb-row{grid-template-columns:74px minmax(0,1fr)}
html[data-compact="true"] .fb-hint{font-size:14px}
html[data-compact="true"] #typing{font-size:18px;min-height:48px;padding:11px 12px}
html[data-compact="true"] .metric-label{font-size:14px}
html[data-compact="true"] .success-particle{display:none}
@media(prefers-reduced-motion:reduce){.footer-social button{transition:none}}
html[data-stacked="false"] #app{min-height:0;height:auto;margin:16px auto}
html[data-stacked="false"] .game-layout{height:var(--desktop-workspace-height,calc(100dvh - 210px));min-height:0}
html[data-stacked="false"] .practice-pane .mini-game-area{height:var(--desktop-stage-height,180px);min-height:150px;flex:none}
html[data-stacked="false"] .practice-pane .typing-stage[data-collapsed="true"]{height:48px;min-height:48px}
.article-pane,.word-card{position:relative}
.lesson-load-status{display:none;position:absolute;inset:0;z-index:5;background:var(--surface);padding:16px;text-align:center;align-items:center;justify-content:center;flex-direction:column;gap:12px;border-radius:inherit;overflow:auto}
#screen-game[data-load-state="loading"] .article-pane .lesson-load-status,#screen-game[data-load-state="error"] .article-pane .lesson-load-status{display:flex}
.lesson-spinner{width:32px;height:32px;border:3px solid #e4e4e7;border-top-color:#8a6800;border-radius:50%;animation:lesson-spin .8s linear infinite;flex:none}
.lesson-load-status strong{font-size:16px;line-height:1.5}
.lesson-load-detail{display:none;margin:0;color:var(--danger);font-size:15px;line-height:1.5;overflow-wrap:anywhere}
.lesson-load-retry{display:none;min-height:44px}
#screen-game[data-load-state="error"] .lesson-spinner{display:none}
#screen-game[data-load-state="error"] .lesson-load-detail,#screen-game[data-load-state="error"] .lesson-load-retry{display:block}
html[data-compact="true"] #screen-game[data-load-state="loading"] .word-card .lesson-load-status,html[data-compact="true"] #screen-game[data-load-state="error"] .word-card .lesson-load-status{display:flex;position:static;min-height:140px;width:100%}
html[data-compact="true"] #screen-game[data-load-state="loading"] .word-card>:not(.lesson-load-status),html[data-compact="true"] #screen-game[data-load-state="error"] .word-card>:not(.lesson-load-status){display:none}
@keyframes lesson-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.lesson-spinner{animation:none}}
@media(max-height:850px){
 html[data-stacked="false"] .word-card{min-height:118px;padding:10px 14px}
 html[data-stacked="false"] .current-english{min-height:1.4em}
 html[data-stacked="false"] .word-area{min-height:118px;margin-bottom:8px}
 html[data-stacked="false"] .input-area{padding:10px;gap:8px}
 html[data-stacked="false"] .feedback{min-height:88px;padding:8px 10px}
 html[data-stacked="false"] .feedback-idle{min-height:44px}
 html[data-stacked="false"] #typing{padding:11px 14px}
 html[data-stacked="false"] .hud{grid-auto-rows:minmax(48px,auto);gap:8px}
 html[data-stacked="false"] .tile{padding:8px 10px}
}

/* Approved shared brand shell. These rules do not style the worksheet. */
.site-header,.site-footer{--brand-font:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;font-family:var(--brand-font)}
.site-header .brand-copy small{font-family:var(--brand-font)}
.site-header .site-navigation{flex-wrap:nowrap}
.site-header .site-navigation a{display:inline-flex;gap:4px;white-space:nowrap}
.site-header .site-navigation svg{width:12px;height:12px;flex:none}
.site-header .brand-mark{width:42px;height:42px;border-radius:7px;box-shadow:none;background:#fff;object-fit:cover}
.site-header .brand-copy strong{font-family:Georgia,'Times New Roman',serif;font-size:17px;font-weight:700;line-height:1.1}
.site-header .brand-copy small{font-size:11px;line-height:1.1}
.site-header .site-navigation a{font-family:var(--brand-font);font-size:14px;font-weight:500;line-height:21px}
.site-footer .footer-inner{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:24px;padding:18px 0;flex-wrap:nowrap;text-align:left}
.site-footer .copyright{margin:0;padding:0;font-family:var(--brand-font);font-size:13px;line-height:1.5;letter-spacing:0;color:#53635f}
.site-footer .footer-links{display:flex;align-items:center;justify-content:flex-end;gap:0 18px;flex-wrap:wrap}
.site-footer .footer-links a,.site-footer .footer-links button{display:inline-flex;align-items:center;min-height:44px;border:0;padding:0;background:none;color:#53635f;font-family:var(--brand-font);font-size:14px;font-weight:500;line-height:21px;cursor:pointer}
.site-footer .footer-links a:hover,.site-footer .footer-links button:hover{color:#1f6454;text-decoration:underline;text-underline-offset:4px}
.brand-about-dialog{width:calc(100% - 28px);max-width:720px!important;max-height:calc(100dvh - 28px);overflow:auto;background:#fff;color:#17352f;line-height:1.6}
.brand-about-dialog h2{font-family:Georgia,serif;font-size:24px;line-height:1.2;padding-right:32px}
.brand-about-dialog h3{font-size:18px;font-weight:700;margin:8px 0}
.brand-about-dialog p{margin:0;font-size:16px}
.brand-about-dialog a{color:#1f6454;text-decoration:underline;text-underline-offset:3px}
.brand-about-dialog [data-slot=dialog-close]{width:44px;height:44px;display:grid;place-items:center;top:8px;right:8px}
.brand-social-links{display:flex;flex-wrap:wrap;gap:4px 18px}
.brand-social-links a{display:inline-flex;align-items:center;min-height:44px}
.brand-social-codes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px}
.brand-social-codes figure{margin:0;text-align:center}
.brand-social-codes img{display:block;width:min(240px,100%);height:auto;margin:0 auto 10px}
.brand-social-codes figcaption{font-size:14px}
@media(max-width:760px){.site-footer .footer-inner{flex-direction:column;align-items:flex-start;gap:6px}.site-footer .footer-links{justify-content:flex-start}}
@media(max-width:650px){.site-header .brand-mark{width:38px;height:38px}.site-header .brand-copy strong{font-size:17px}.brand-social-codes{grid-template-columns:1fr}}

@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:swap;src:url('assets/brand/inter-500.ttf') format('truetype')}
#brand-about-dialog{border:1px solid #e4e4e7;border-radius:18px;padding:28px;margin:auto;text-align:left}
#brand-about-dialog::backdrop{background:rgba(24,24,27,.44)}
#brand-about-dialog p{margin:14px 0}
#brand-about-dialog h3{margin:20px 0 8px}
#brand-about-dialog .brand-about-close{position:absolute;top:8px;right:8px;width:44px;height:44px;border:0;background:none;color:#17352f;font-size:28px;cursor:pointer}
#brand-about-dialog :focus-visible{outline:3px solid #1f6454;outline-offset:3px}
