/* Shared visual system. Reference timings and measurements: review/REFERENCE-MAP.md */
:root{font-family:Inter,"Segoe UI","Microsoft YaHei",system-ui,sans-serif;color:#f6f7f8;background:#08121e;--bg:#08121e;--panel:#172430;--panel-raised:#21303c;--muted:#95a3b0;--line:#ffffff0d;--accent:#8abfff;--ease:cubic-bezier(.2,.8,.2,1);--spring:cubic-bezier(.16,1,.3,1);--radius:20px;--visual-height:100dvh;color-scheme:dark}
html{scroll-behavior:auto;scrollbar-gutter:stable}body{overflow-x:clip}button,input,textarea{font:inherit}button{touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible{outline:2px solid #a4cdff;outline-offset:4px}::selection{background:#91bfff55;color:white}svg{width:24px;height:24px;flex:none;vertical-align:middle}h1{font-size:36px;font-weight:650;letter-spacing:-.055em;line-height:1.2}h2{font-size:24px;letter-spacing:-.035em;font-weight:650}h3{font-size:17px;letter-spacing:-.02em;font-weight:600}p{line-height:1.6}.muted{color:var(--muted)}.eyebrow{color:#9aacbc;font-size:11px;font-weight:600;letter-spacing:.08em;margin-bottom:10px}.tag{border:0;background:#ffffff0b;color:#a9b7c6;font-weight:500;padding:6px 10px}.tag.warn{color:#d9bd8c;background:#b38a4813}.tag.ok{color:#9cd7be;background:#72bb9912}.tag.error{color:#ffc2c2;background:#ca6b6b14}
.ambient{z-index:-2;background:radial-gradient(ellipse 65% 65% at 7% -10%,#173d66a8,transparent 75%),#08121e}.orb{filter:blur(90px);opacity:.18;will-change:transform;animation:atmosphere 38s ease-in-out infinite alternate}.orb-a{background:radial-gradient(circle,#337bad,transparent 67%);top:-26vw;left:-12vw}.orb-b{background:radial-gradient(circle,#685b95,transparent 70%);opacity:.1;bottom:-32vw;right:-15vw}.orb-c{background:radial-gradient(circle,#3c9b99,transparent 70%);opacity:.09;top:20%;left:48%}@keyframes atmosphere{to{transform:translate3d(9%,8%,0) scale(1.12)}}
.shell{display:grid;grid-template-columns:208px minmax(0,1fr);min-height:100dvh}.sidebar{position:sticky;top:0;height:100dvh;padding:26px 12px 20px;background:rgba(12,24,36,.62);border-right:1px solid #ffffff06;backdrop-filter:none;z-index:30}.brand{padding:0 10px 42px;gap:10px;justify-content:flex-start}.brand-mark{width:35px;height:35px;border-radius:12px;background:#edf3f8;color:#132132;font-size:19px;font-weight:800;box-shadow:none}.brand strong{font-size:13px;letter-spacing:-.04em}.brand small{font-size:10px;color:#7d90a1}.nav{gap:5px}.nav-item{padding:13px 15px;gap:13px;border-radius:12px;min-height:46px;justify-content:flex-start;font-size:13px;font-weight:500;color:#9dabb9;transition:color .24s}.nav-item.active{color:#fff}.nav-item.active:after{content:'';width:4px;height:4px;background:#d7e9ff;border-radius:50%;margin-left:auto}.nav-icon{width:20px;height:20px;flex:0 0 20px;color:inherit}.nav-icon svg{width:20px;height:20px}.nav-label{font-size:9px;letter-spacing:.1em;color:#677d91;padding:26px 15px 10px}.nav-glider{z-index:-1;left:0;right:auto;top:0;border-radius:12px;background:linear-gradient(110deg,#ffffff17,#ffffff0a);border:1px solid #ffffff08;box-shadow:inset 0 1px #ffffff0c;transition:transform .46s var(--spring),width .46s var(--spring),height .46s var(--spring),opacity .2s;will-change:transform}.sidebar-bottom{border:0;padding:16px 8px 0}.side-status{font-size:10px;color:#8495a4}.status-dot{width:5px;height:5px;box-shadow:none}.nav-full{display:block!important}.nav-short{display:none!important}
.content{width:100%;max-width:1440px;margin:auto;padding:0 38px 50px;align-self:start}.topbar{height:88px;margin:0 0 22px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #ffffff07}.topbar-left{font-size:14px;font-weight:600;color:#c9d2dc;display:flex;align-items:center;gap:10px}.topbar-right{gap:14px}.topbar .round-icon{width:36px;height:36px}.mobile-brand{display:none}.page{animation:surface-enter .35s var(--ease) both;min-width:0}@keyframes surface-enter{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}.glass{background:var(--panel);border:1px solid #ffffff05;border-radius:var(--radius);box-shadow:none;backdrop-filter:none}.card,.settings-card,.photo-card,.step-card,.formula-card{padding:26px}.section-head{margin:30px 0 15px;align-items:center}.section-head h2{font-size:20px;font-weight:600}.section-head>.muted{font-size:12px}.grid-3,.grid-2{gap:16px}
/* Material light: a broad soft lobe, clipped to the surface, separate from text. */
.light-sweep{position:relative;isolation:isolate;overflow:hidden}.light-sweep::before{content:'';position:absolute;z-index:-1;pointer-events:none;inset:-100% -60%;background:radial-gradient(ellipse 18% 60% at 50% 50%,#f4ffff2e 0%,#d9e8ff15 38%,#a1b7ce05 62%,transparent 78%);opacity:0;transform:translate3d(-45%,0,0) scaleX(.65);filter:blur(7px);animation:none;transition:opacity .2s}.light-sweep:is(:hover,:focus-visible,.sweeping)::before{animation:material-light 950ms var(--ease) both}.light-sweep>*{z-index:1;position:relative}.light-sweep:active{transform:scale(.987)}@keyframes material-light{0%{opacity:0;transform:translate3d(-38%,0,0) scaleX(.6)}20%{opacity:.75}55%{opacity:1;transform:translate3d(0,0,0) scaleX(1.25)}100%{opacity:0;transform:translate3d(40%,0,0) scaleX(.8)}}
.btn{position:relative;min-height:44px;padding:11px 21px;gap:9px;border:1px solid #ffffff07;border-radius:999px;background:#ffffff0d;color:#f2f5f8;font-size:13px;font-weight:600;box-shadow:inset 0 1px #ffffff05;transition:background .2s,transform .2s,opacity .2s}.btn:hover{background:#ffffff17;border-color:#ffffff0d;box-shadow:none;transform:none}.btn:active{transform:scale(.97)}.btn.primary{color:#111b23;background:#eff2f5;border-color:#eff2f5;box-shadow:none}.btn.primary:hover{background:#fff;box-shadow:none}.btn.primary::before{z-index:0;background:radial-gradient(ellipse 20% 70% at 50% 50%,#8dabc83a,transparent 75%)}.btn.small{min-height:34px;padding:7px 14px;border-radius:999px;font-size:11px}.btn.ghost{background:transparent;color:#9bafc0;border:0}.btn.danger{background:#ff797913;border-color:#ffadad12;color:#ffb0b0}.btn:disabled{opacity:.4;transform:none}.btn.active{background:#e6eef8;color:#142233}.round-icon{width:40px;height:40px;border:0;background:#ffffff08;box-shadow:none}.round-icon svg{width:18px;height:18px}.round-icon:hover{background:#ffffff15}.is-loading{color:transparent!important;pointer-events:none}.is-loading>*{opacity:0}.is-loading::after{content:'';position:absolute;left:calc(50% - 8px);top:calc(50% - 8px);width:16px;height:16px;border:1.8px solid #ffffff40;border-top-color:#fff;border-radius:50%;animation:spin .75s linear infinite}.is-loading.primary::after{border-color:#18212a33;border-top-color:#18212a}.spinner{border-width:1.8px;width:16px;height:16px}.btn.primary .spinner{border-color:#15202d33;border-top-color:#15202d}.loading-shine{background-size:250% 100%;animation:shimmer 2s ease-in-out infinite}
/* Home: balance-like summary, circular actions and separate working surface. */
.home-heading{margin:6px 0 30px}.home-heading h1{font-size:30px;margin:0}.home-overview{display:grid;grid-template-columns:1fr 1fr;gap:28px;align-items:stretch}.learning-balance{padding:24px 12px 20px}.learning-balance>.muted{font-size:13px}.balance-number{font-size:78px;font-weight:500;line-height:1.1;letter-spacing:-.06em;margin:12px 0 27px;font-variant-numeric:tabular-nums}.balance-number>span{font-size:12px;letter-spacing:0;display:inline-block;margin-left:14px;color:#91a4b6;font-weight:400}.quick-actions{display:flex;gap:22px}.quick-action{display:flex;flex-direction:column;align-items:center;gap:10px;border:0;background:none;color:#c1cbd5;padding:0;font-size:11px;max-width:85px;text-align:center}.quick-icon{width:48px;height:48px;display:grid;place-items:center;background:#ffffff0c;box-shadow:inset 0 1px #ffffff0b;border-radius:50%;transition:background .2s,transform .2s}.quick-action:hover .quick-icon{background:#ffffff1c;transform:translateY(-2px)}.quick-icon svg{width:21px;height:21px}.focus-card{padding:24px 28px;background:radial-gradient(ellipse at 90% -10%,#30577d6b,transparent 64%),#1a2a3a;display:flex;flex-direction:column;align-items:start;min-height:240px}.focus-label{display:flex;width:100%;align-items:center;justify-content:space-between;color:#aebdcc;font-size:12px}.focus-label svg{color:#91aaca;width:20px}.focus-expression{font-family:Georgia,"Times New Roman",serif;font-size:38px;letter-spacing:-.035em;margin:24px 0 6px}.focus-card p{font-size:12px;color:#90a5ba;margin-bottom:20px}.focus-card .btn{margin-top:auto;font-size:12px;min-height:38px}.subject-card{min-height:190px;padding:23px;background:#162430;position:relative;transition:background .25s,transform .25s;border-color:#ffffff04}.subject-card:hover{transform:translateY(-2px);background:#20313e;border-color:#ffffff0c}.subject-icon{border-radius:50%;width:42px;height:42px;margin-bottom:23px;background:#ffffff09;box-shadow:none;color:#c0d2e7}.subject-icon svg{width:21px;height:21px}.subject-card h3{font-size:17px;margin-bottom:7px}.subject-card p{color:#8f9fad;font-size:12px;line-height:1.55;max-width:85%}.card-arrow{position:absolute;right:22px;bottom:20px;font-size:20px;color:#b4c4d4}.subject-math .subject-icon{color:#a5c5ff}.subject-chinese .subject-icon{color:#a8d5c4}.subject-english .subject-icon{color:#d4c5ed}.tools-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.tool-card{min-height:96px;padding:20px;flex-direction:row;gap:13px;align-items:center;background:#14222e}.tool-card .subject-icon{margin:0;width:38px;height:38px;flex:none;border-radius:50%;background:#ffffff07}.tool-card h3{font-size:14px}.tool-card p{font-size:11px;line-height:1.5;color:#8799aa;max-width:92%}.tool-card .card-arrow{display:none}.tool-card:hover{transform:translateY(-2px);border-color:#ffffff0c}
/* Forms and mathematical working surfaces. */
.math-header{margin:6px 0 25px;align-items:center}.math-header h1{font-size:32px}.math-layout{grid-template-columns:minmax(0,1.32fr) minmax(300px,.85fr);gap:20px}.math-main,.math-side{gap:18px}.problem-switcher{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:22px}.problem-switcher button{padding:9px 13px;min-height:36px;border:0;background:#ffffff07;color:#91a5b7;border-radius:999px;font-size:12px}.problem-switcher button.active{background:#d7e7f61c;color:#e3effd;box-shadow:inset 0 0 0 1px #b1ceeb22}.mode-picker{gap:2px;background:#040b1380;padding:4px;border:1px solid #ffffff07;border-radius:999px}.mode-picker button{padding:9px 12px;background:transparent;border-radius:999px;color:#8097aa;font-size:11px;font-weight:600}.mode-picker button.active{background:#283b4c;color:#e8f1fa;box-shadow:inset 0 1px #ffffff13}.problem-card{padding:25px 28px;min-height:164px;background:linear-gradient(115deg,#20354a,#172b3e);border:0}.problem-card .math-expression{font-family:Georgia,"Times New Roman",serif;font-size:44px;font-weight:400;margin:21px 0 0;letter-spacing:-.025em}.formula-card>p{font-size:13px;margin-bottom:18px}.formula-options{gap:10px;margin:20px 0}.formula-option{min-height:88px;padding:16px 16px 16px 40px;border-radius:14px;border:1px solid #ffffff09;background:#ffffff04;position:relative}.formula-option:after{content:'';position:absolute;left:16px;top:21px;width:12px;height:12px;border:1px solid #6c8295;border-radius:50%;transition:.2s}.formula-option:hover{transform:none;background:#ffffff09;border-color:#ffffff20}.formula-option.selected{background:#6583a91c;border-color:#a3c2e54d;box-shadow:inset 0 1px #ffffff0d}.formula-option.selected:after{background:#dcecff;border:3px solid #314e69;box-shadow:0 0 0 1px #b3d5f7}.formula-option strong{font-size:13px;line-height:1.4}.formula-option small{color:#8299ad;font-size:11px}.formula-card .btn{min-height:43px}.step-counter{color:#7f9ab2;font-size:10px;margin-bottom:12px;letter-spacing:.07em}.step-card h3{font-size:16px;line-height:1.6}.step-actions{gap:9px;flex-wrap:wrap}.step-card textarea,.course-panel textarea,.course-compose textarea,.composer textarea,.photo-confirm textarea{border:1px solid #ffffff0b;border-radius:13px;background:#0c1722;color:#eff5f9;outline:none;padding:15px;font-size:14px;transition:border-color .2s,box-shadow .2s}.step-card textarea:focus,.course-panel textarea:focus,.course-compose textarea:focus,.photo-confirm textarea:focus{border-color:#8badce80;box-shadow:0 0 0 3px #9ac4ed0b}.hint-card{padding:24px}.hint-progress{gap:5px}.hint-progress span{background:#ffffff0c;height:3px;border-radius:10px}.hint-progress span.active{background:#8badcf}.hint-text{font-size:13px;color:#bac9d7;line-height:1.75;min-height:64px}.hint-card .btn{width:auto;margin-top:14px}.answer-link{display:block;color:#8da7bf;font-size:11px;margin-top:16px;background:none;border:0;padding:4px 0}.answer-box{background:#08121c80;border-radius:12px;border-color:#ffffff0b;padding:15px}.answer-box code{font-family:Georgia,serif;color:#d7e8f9;font-size:17px;line-height:1.8}.inline-draft{padding:22px}.draft-canvas{background-color:#101e2c;background-image:radial-gradient(#8babc02e .7px,transparent .7px);background-size:18px 18px;border:1px solid #ffffff08;border-radius:13px;touch-action:none}.draft-controls{gap:6px}.draft-controls .btn{min-height:34px;font-size:11px;padding:7px 12px}.notice{background:#152333;border:1px solid #8da4bf12;border-radius:14px;padding:15px 18px}.notice p{color:#829bb1;font-size:11px;line-height:1.7;margin:0}.feedback{border:1px solid #ffffff12;background:#263744cc;border-radius:18px;padding:13px 15px;gap:11px;align-items:center;max-width:100%;width:100%;box-shadow:0 9px 24px #00000012;animation:feedback-in .36s var(--spring)}.feedback.success{background:#233b37;border-color:#a4d2b918}.feedback.error{background:#3b2d34;border-color:#e7adad18}.feedback-icon{border-radius:50%;width:25px;height:25px;background:#f0f4f8;color:#213c4c}.feedback.success .feedback-icon{background:#eaf5ef;color:#2f6151}.feedback.error .feedback-icon{background:#fff0f0;color:#854b50}.feedback strong{font-size:12px;margin:0 0 3px}.feedback p{font-size:11px;color:#b6c2cd}.feedback.waiting .feedback-icon{background:transparent;color:white}.feedback svg path{animation:draw .42s .08s var(--ease) forwards}.feedback.error{animation:feedback-in .36s var(--spring),error-nudge .32s .1s}@keyframes feedback-in{from{opacity:0;transform:translateY(6px) scale(.97)}to{opacity:1;transform:none}}@keyframes error-nudge{25%{translate:-3px}60%{translate:3px}to{translate:0}}
/* Language menu: persistent surface and uninterrupted selection lens. */
.lang-wrap{position:relative;z-index:45}.lang-trigger{display:flex;align-items:center;gap:8px;border:0;border-radius:999px;min-height:36px;padding:8px 12px;background:#ffffff06;color:#b0c0ce;font-size:11px}.lang-trigger svg{width:15px;height:15px}.chevron{font-size:12px;color:#73899f;transition:transform .25s}.lang-trigger[aria-expanded=true] .chevron{transform:rotate(180deg)}.lang-menu{display:block!important;position:absolute;right:0;top:calc(100% + 10px);width:226px;padding:8px;border:1px solid #ffffff0e;border-radius:16px;background:#263542ed;backdrop-filter:blur(28px);box-shadow:0 22px 70px #0007;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(-5px) scale(.95);transform-origin:top right;transition:opacity .18s,transform .27s var(--spring),visibility .25s}.lang-menu.open{opacity:1;visibility:visible;pointer-events:auto;transform:none}.menu-title{font-size:10px;color:#8ca0b3;padding:9px 12px 13px;letter-spacing:.04em}.lang-options{position:relative;isolation:isolate}.lang-glider{position:absolute;left:0;right:0;top:0;height:44px;border-radius:10px;background:radial-gradient(ellipse at 22% 20%,#a6bac32b,transparent 75%),#9eafbc12;border:1px solid #ffffff06;transition:transform .32s var(--spring);z-index:-1}.lang-option{height:44px;width:100%;border:0;background:transparent;border-radius:10px;padding:0 13px;display:flex;align-items:center;justify-content:space-between;color:#ccd6df;font-size:12px;text-align:left}.lang-option.active{color:#fff}.language-check{color:#e3f0fc;font-size:13px}.lang-option:hover{background:none}
/* Courses, chat and utility pages use the same material scale. */
.course-hero{padding:0;min-height:0;border:0;background:transparent;margin:4px 0 28px}.course-hero h1{font-size:34px}.course-hero p{font-size:13px;color:#8b9fb2}.course-layout{grid-template-columns:minmax(240px,.8fr) minmax(0,1.2fr);gap:20px}.course-panel{padding:24px}.course-panel textarea{min-height:260px;line-height:1.7}.course-chat{min-height:560px;background:#14222f}.course-messages{padding:24px;min-height:200px}.course-compose{border-top:1px solid #ffffff08;padding:14px;gap:10px}.course-compose textarea{background:#0b1723;min-height:64px}.message{font-size:13px;line-height:1.75;padding:14px 16px;border-radius:17px;border:0;background:#ffffff07;color:#cbd9e5;white-space:pre-wrap;overflow-wrap:anywhere}.message.user{background:#344e67;color:#edf5fc;border:0}.message.error{background:#3c2b35;color:#e5bfc7}.empty-state{color:#8098ad;min-height:300px;padding:25px;font-size:13px}.empty-state p{max-width:320px}.empty-state .halo{background:#ffffff08;border-radius:50%;box-shadow:none;color:#aac0d4;width:62px;height:62px;font-size:28px}.chat-layout{grid-template-columns:200px minmax(0,1fr);height:calc(var(--visual-height) - 140px);min-height:480px;gap:16px}.chat-sidebar{background:#12212e;padding:14px;gap:15px}.chat-sidebar input{border:0;border-radius:10px;background:#ffffff06;min-height:38px;font-size:11px;color:#b6c5d3}.chat-item{padding:12px;border-radius:10px;font-size:12px}.chat-item.active,.chat-item:hover{background:#ffffff0b}.chat-main{background:#142330}.chat-heading{padding:16px 22px;border-color:#ffffff08;min-height:68px}.chat-heading strong{font-size:14px}.chat-heading .actions{gap:5px}.chat-heading .btn{font-size:10px;padding:7px 10px}.chat-stream{padding:28px}.chat-stream .message{max-width:85%}.composer{border-color:#ffffff08;padding:16px}.composer-box{background:#233443;border:1px solid #ffffff0a;border-radius:26px;padding:5px;align-items:center}.composer textarea{background:transparent;border:0;font-size:13px;min-height:42px;padding:11px}.composer textarea:focus{outline:none}.composer .btn{min-height:37px;padding:9px 17px}.composer-foot{color:#607b92;font-size:9px;line-height:1.5;margin:9px 8px 0}.voice-hero{max-width:760px;margin:24px auto;padding:50px 32px;background:radial-gradient(ellipse at 50% 5%,#3d63872b,transparent 65%),#132330}.voice-hero h1{font-size:30px}.voice-orb{width:144px;height:144px;background:radial-gradient(circle at 34% 28%,#d5e9f6,#82a9c4 29%,#345e7b 61%,#142b46 88%);box-shadow:inset 8px 8px 25px #e2f2ff6e,inset -18px -20px 34px #0a21398c,0 22px 60px #3f86b523}.voice-orb::after{border-color:#9ab8d11a;inset:-17px}.voice-subtitle{color:#8ba4b8;font-size:13px}.voice-note{max-width:500px}.photo-layout{gap:20px}.photo-drop{background:#0f1d29;border:1px dashed #89a4bc42;border-radius:15px;min-height:310px}.photo-drop .halo{color:#9db3c7}.photo-confirm textarea{min-height:260px}.photo-subjects{margin:14px 0}.history-grid,.settings-grid{gap:18px}.settings-grid{align-items:stretch}.settings-card h3{font-size:17px;margin-bottom:20px}.status-row{font-size:12px;gap:20px;padding:14px 0;border-color:#ffffff08;align-items:start}.status-row>span:last-child{text-align:right;overflow-wrap:anywhere;max-width:62%}.stat{background:#ffffff04;border:0;border-radius:15px;padding:20px}.stat strong{font-size:31px;font-weight:500;letter-spacing:-.04em}.stat small{font-size:10px;color:#8098ab}.history-list li{padding:17px 0;border-color:#ffffff08;line-height:1.8}.history-list .btn{margin-top:10px}.field{gap:8px;margin-bottom:18px}.field label{font-size:12px;font-weight:500;color:#a3b4c3}.field input,.field select{min-height:46px;padding:12px 14px;background:#0e1b27;border:1px solid #ffffff0b;border-radius:12px;color:#eff5fa;transition:border-color .2s,box-shadow .2s}.field input:focus{outline:none;border-color:#9bbbdb6b;box-shadow:0 0 0 3px #8bb6e00d}.field input[aria-invalid=true]{border-color:#e8a3aa70}.field-error{font-size:11px;color:#edb2b6;line-height:1.5;animation:feedback-in .25s var(--ease);display:block}.shake{animation:error-nudge .32s}.password-field{position:relative}.password-field input{padding-right:45px}.password-toggle{position:absolute;right:5px;top:4px;width:38px;height:38px;border:0;background:none;color:#7890a6;display:grid;place-items:center}.field input:-webkit-autofill{-webkit-text-fill-color:#eff4f8;box-shadow:0 0 0 1000px #253645 inset}
/* Auth has its own spatial layout, with a quiet companion surface. */
.auth{min-height:100dvh;padding:100px 36px 90px;display:grid;place-items:center;background:radial-gradient(ellipse 48% 55% at 0 8%,#124f853d,transparent 80%)}.auth-brand{position:absolute;top:29px;left:34px;display:flex;align-items:center;gap:11px}.auth-brand strong{font-size:14px;font-weight:600}.auth-brand .brand-mark{width:30px;height:30px;font-size:17px;border-radius:9px}.auth-layout{width:min(760px,100%);display:grid;grid-template-columns:350px 1fr;gap:90px;align-items:center}.auth-panel{width:100%;padding:0;border:0;background:none;box-shadow:none;backdrop-filter:none}.auth-panel h1{font-size:29px;letter-spacing:-.045em;margin-bottom:14px}.auth-panel p{font-size:13px;color:#93a8ba;line-height:1.6}.auth-panel .eyebrow{font-size:10px;color:#738ea6;margin-bottom:12px}.auth-panel .field{margin:28px 0 18px}.auth-panel .field input{min-height:48px;background:#2a3b49;border:1px solid #ffffff05;border-radius:12px}.auth-panel .btn{width:100%;min-height:45px}.auth-language{position:fixed;bottom:25px;left:28px;z-index:80}.auth-language .lang-menu{top:auto;bottom:calc(100% + 10px);left:0;right:auto;transform-origin:bottom left}.auth-footnote{display:flex;align-items:center;justify-content:center;gap:6px;font-size:10px;color:#58758e;margin-top:27px}.auth-footnote svg{width:13px;height:13px}.auth-companion{text-align:center;padding:24px 0}.auth-companion h2{font-size:22px;line-height:1.4;margin:26px 0 11px}.auth-companion p{font-size:12px;color:#7c94aa;line-height:1.8}.auth-emblem{width:105px;height:120px;margin:auto;display:grid;place-items:center;background:linear-gradient(150deg,#8ea9c73b,#2947653d);border:1px solid #ffffff18;box-shadow:inset 0 1px #ffffff2b,0 28px 48px #0002;border-radius:24px;color:#e7eff9;font-size:58px;letter-spacing:-.08em;font-weight:750;position:relative;transform:rotate(-7deg)}.auth-emblem span{position:absolute;font-size:31px;right:-13px;top:-16px;color:#c0d5eb}.auth-subjects{display:flex;justify-content:center;gap:19px;margin-top:24px}.auth-subjects span{display:flex;flex-direction:column;align-items:center;gap:8px;color:#8ba3b9;font-size:10px}.auth-subjects svg{width:19px;height:19px}
/* Native dialog provides focus trapping; motion stays on the inner surface. */
.ui-dialog{width:min(420px,calc(100vw - 36px));padding:28px;border:1px solid #ffffff14;border-radius:24px;background:linear-gradient(150deg,#263643,#182734);color:#f3f7fa;box-shadow:0 35px 100px #0007;overflow:visible;animation:dialog-in .36s var(--spring);max-height:calc(var(--visual-height) - 40px)}.ui-dialog::backdrop{background:#02091099;backdrop-filter:blur(5px);animation:backdrop-in .25s}.ui-dialog h2{font-size:23px;margin:0 0 15px}.ui-dialog p{font-size:13px;color:#a5b9c9;line-height:1.8;margin-bottom:25px}.ui-dialog textarea{width:100%;min-height:110px;resize:vertical;padding:13px;border:1px solid #ffffff18;border-radius:12px;background:#0a1825;color:white;outline:none;margin:5px 0 20px}.dialog-actions{display:flex;gap:10px;margin-top:24px}.dialog-actions .btn{flex:1}.sheet-grip{display:none}.ui-dialog.closing{animation:dialog-out .18s ease-in forwards}.ui-dialog.closing::backdrop{opacity:0;transition:opacity .18s}@keyframes dialog-in{from{opacity:0;transform:translateY(16px) scale(.94)}to{opacity:1;transform:none}}@keyframes dialog-out{to{opacity:0;transform:translateY(10px) scale(.96)}}@keyframes backdrop-in{from{opacity:0}to{opacity:1}}
.toast{display:flex;align-items:center;gap:10px;position:fixed;left:50%;right:auto;bottom:28px;max-width:min(480px,calc(100vw - 32px));width:max-content;padding:13px 20px;border:1px solid #ffffff20;border-radius:999px;background:linear-gradient(135deg,#3e5962e8,#233b47eb);box-shadow:inset 0 1px #ffffff13,0 15px 45px #0004;backdrop-filter:blur(24px);transform:translate(-50%,12px) scale(.92);font-size:12px;color:#f2f7f8;opacity:0;transition:opacity .22s,transform .35s var(--spring);z-index:150}.toast.show{opacity:1;transform:translate(-50%,0) scale(1)}.toast-symbol{display:grid;place-items:center;width:23px;height:23px;flex:none;border-radius:50%;background:#eaf2f4;color:#2c4a50}.toast-symbol svg{width:16px;height:16px}.toast.error .toast-symbol{color:#934a4f;background:#ffe9ec}.toast.show .toast-symbol path:not(.status-tick):not(.status-cross){stroke-dasharray:40;stroke-dashoffset:40;animation:draw .45s .15s ease forwards}
/* Tablet: full-width workspace plus a compact floating dock. */
@media(max-width:1100px){
 .shell{display:block}.content{padding:0 28px calc(115px + env(safe-area-inset-bottom));max-width:1020px}.topbar{height:76px;margin-bottom:23px}.topbar-left{font-size:14px}.mobile-brand{display:grid;place-items:center;background:#eaf2f6;color:#213547;width:29px;height:29px;border-radius:50%;font-size:15px;font-weight:800}
 .sidebar{position:fixed;left:50%;right:auto;top:auto;bottom:calc(14px + env(safe-area-inset-bottom));transform:translateX(-50%);width:min(430px,calc(100vw - 32px));height:66px;padding:5px;border:1px solid #ffffff38;border-radius:999px;background:linear-gradient(145deg,#77777752,#30303078 55%,#62626248);backdrop-filter:blur(24px) saturate(.45);-webkit-backdrop-filter:blur(24px) saturate(.45);box-shadow:inset 0 1px 1px #ffffff4a,inset 0 -1px 2px #070e1b70,0 12px 35px #0006;z-index:70;overflow:hidden}
 .sidebar .brand,.sidebar .secondary-nav,.sidebar-bottom,.sidebar .nav-label{display:none!important}.sidebar .primary-nav{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));height:100%;gap:0;isolation:isolate}.sidebar .nav-item{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;height:100%;min-height:0;padding:4px 0;border-radius:999px;z-index:1;font-size:10px;color:#c0cdd5}.sidebar .nav-item.active{color:#f4faff}.sidebar .nav-item:after{display:none}.sidebar .nav-icon{width:21px;height:21px;flex:0 0 21px}.sidebar .nav-icon svg{width:21px;height:21px;stroke-width:1.8}.sidebar .nav-item.active .nav-icon{color:#f2f2f2;filter:none}.sidebar .nav-full{display:none!important}.sidebar .nav-short{display:block!important;font-size:9px;font-weight:500;line-height:1.1;white-space:nowrap;max-width:100%;overflow:visible}
 .nav-glider{z-index:0;border-radius:999px;background:radial-gradient(ellipse at 40% 0%,#ffffff2c,transparent 65%),linear-gradient(135deg,#ffffff19,#ffffff09);border:1px solid #ffffff42;box-shadow:inset 0 1px 1px #ffffff55,inset 0 -1px 3px #0007,0 4px 12px #0006;transition:transform .45s var(--spring),width .35s,height .35s,opacity .2s}
 .math-layout{grid-template-columns:minmax(0,1.2fr) minmax(260px,.8fr);gap:16px}.formula-options{grid-template-columns:1fr}.home-overview{gap:20px}.quick-actions{gap:18px}.tools-grid{grid-template-columns:1fr}.tool-card{min-height:84px}.tool-card p{max-width:none}.toast{bottom:100px}.chat-layout{height:calc(var(--visual-height) - 180px);grid-template-columns:175px minmax(0,1fr)}
}
@media(max-width:700px){
 .content{padding:0 18px calc(104px + env(safe-area-inset-bottom));}.topbar{height:68px;margin-bottom:24px;border:0;position:relative;z-index:40}.topbar-left{font-size:12px}.topbar-right{gap:8px}.topbar .round-icon{width:34px;height:34px}.lang-trigger{padding:7px 9px;font-size:10px;gap:6px}.lang-trigger svg{width:13px;height:13px}.topbar-left .mobile-brand{width:28px;height:28px}
 h1{font-size:29px;letter-spacing:-.05em}.home-heading{margin:0 0 14px;text-align:center}.home-heading .eyebrow{display:none}.home-heading h1{font-size:23px;font-weight:600;letter-spacing:-.045em}.home-overview{display:flex;flex-direction:column;gap:28px}.learning-balance{padding:12px 0 0;text-align:center}.learning-balance>.muted{font-size:11px}.balance-number{font-size:70px;margin:10px 0 23px}.balance-number>span{display:block;font-size:10px;margin:7px 0 0}.quick-actions{justify-content:center;gap:27px}.quick-action{font-size:10px;max-width:65px;gap:8px}.quick-icon{width:43px;height:43px}.quick-icon svg{width:20px;height:20px}.focus-card{min-height:210px;padding:22px 24px}.focus-expression{font-size:36px;margin-top:20px}.focus-card .btn{width:100%;margin-top:12px;min-height:38px}.focus-card p{margin-bottom:0}.focus-label{font-size:11px}.section-head{margin:29px 0 14px}.section-head h2{font-size:18px}.section-head>.muted{font-size:10px}.subject-grid{display:flex;gap:11px;overflow-x:auto;margin-right:-18px;padding-right:18px;padding-bottom:5px;scroll-snap-type:x proximity;scrollbar-width:none}.subject-grid .subject-card{flex:0 0 160px;min-height:189px;padding:20px;scroll-snap-align:start}.subject-card h3{font-size:15px}.subject-card p{font-size:10px;max-width:100%}.subject-icon{width:36px;height:36px;margin-bottom:22px}.subject-icon svg{width:19px}.card-arrow{right:19px;bottom:17px;font-size:17px}.tools-grid{gap:10px}.tool-card{min-height:82px;padding:18px}.tool-card h3{font-size:14px}.tool-card p{font-size:10px}.glass{border-radius:18px}
 .sidebar{width:min(410px,calc(100vw - 28px));height:64px;bottom:calc(11px + env(safe-area-inset-bottom));padding:4px}.sidebar .nav-item{gap:4px}.sidebar .nav-short{font-size:9px}
 .math-header{align-items:flex-start;gap:19px;margin:3px 0 21px}.math-header h1{font-size:28px}.math-header .eyebrow{font-size:10px}.mode-picker{flex-wrap:nowrap;max-width:100%;overflow:auto;scrollbar-width:none}.mode-picker button{font-size:10px;padding:9px 12px;white-space:nowrap}.problem-switcher{gap:6px;margin-bottom:19px}.problem-switcher button{font-size:11px;padding:9px 11px;min-height:33px}.math-layout{grid-template-columns:1fr}.math-main,.math-side{gap:15px}.math-side{order:2}.problem-card{padding:25px;min-height:154px}.problem-card .math-expression{font-size:38px;margin-top:24px}.formula-card,.step-card,.hint-card,.card,.settings-card,.photo-card{padding:23px}.formula-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:20px 0}.formula-option{padding:16px 12px 14px;min-height:96px}.formula-option:after{position:relative;display:block;left:0;top:0;margin-top:12px;width:10px;height:10px}.formula-option strong{font-size:12px}.formula-option small{font-size:10px}.formula-card>p{font-size:12px}.formula-card h3{font-size:17px}.step-card textarea{font-size:16px;min-height:88px}.hint-text{font-size:13px}.feedback{border-radius:17px}.draft-controls .btn{padding:8px 12px;min-height:36px}.draft-canvas{height:230px}.inline-draft{padding:22px}.btn{min-height:44px;font-size:12px}.btn.small{min-height:36px}.step-actions .btn{flex:1}
 .course-hero{margin:0 0 22px}.course-hero h1{font-size:30px}.course-layout{grid-template-columns:1fr;gap:16px}.course-panel{padding:23px}.course-panel textarea{font-size:16px;min-height:180px}.course-chat{min-height:440px}.course-compose textarea{font-size:16px}.empty-state{min-height:240px}.course-messages{padding:20px}.photo-layout,.settings-grid,.history-grid{grid-template-columns:1fr;gap:15px}.photo-drop{min-height:230px}.photo-confirm textarea{font-size:16px;min-height:230px}.stat{padding:17px 13px}.stat strong{font-size:27px}.stat small{font-size:10px;line-height:1.5;display:block;margin-top:5px}.field input{font-size:16px}.status-row{font-size:11px;gap:14px}.voice-hero{padding:38px 23px;margin:8px 0}.voice-hero h1{font-size:27px}.voice-orb{width:130px;height:130px;margin-bottom:38px}.voice-note{margin-top:24px}.voice-actions{gap:9px}
 .chat-layout{height:calc(var(--visual-height) - 162px);min-height:470px;display:flex;flex-direction:column;gap:10px}.chat-sidebar{padding:9px;display:flex;flex-direction:row;align-items:center;gap:8px;min-height:54px;overflow:hidden}.chat-sidebar .btn{width:auto;min-height:34px;flex:none;padding:8px 12px;font-size:10px}.chat-sidebar input{width:112px;max-width:112px;min-height:34px;font-size:10px}.chat-list{flex:1;display:flex;overflow:auto;scrollbar-width:none}.chat-item{max-width:100px;width:auto;flex:none;font-size:10px;padding:8px}.chat-main{flex:1;border-radius:18px}.chat-heading{padding:12px 15px;min-height:55px}.chat-heading strong{font-size:12px}.chat-stream{padding:19px 15px}.chat-stream .message{max-width:92%;font-size:13px}.composer{padding:10px}.composer-box{border-radius:24px;gap:3px}.composer textarea{font-size:16px;min-height:44px}.composer .btn{font-size:10px;min-height:35px;padding:8px 12px}.composer .round-icon{width:31px;height:31px;margin:3px}.composer-foot{font-size:8px;margin-top:7px;max-height:25px;overflow:hidden}.keyboard-open .sidebar{transform:translate(-50%,120px);opacity:0;pointer-events:none}.keyboard-open .chat-layout{height:calc(var(--visual-height) - 82px);min-height:230px}.keyboard-open .content{padding-bottom:12px}.keyboard-open .toast{bottom:15px}
 .auth{padding:110px 28px 100px;align-items:center}.auth-layout{display:block;width:min(350px,100%)}.auth-companion{display:none}.auth-panel{padding:0;width:100%}.auth-panel h1{font-size:29px}.auth-brand{top:28px;left:26px}.auth-brand strong{font-size:13px}.auth-panel .field{margin-top:30px}.auth-language{left:20px;bottom:25px}.auth-footnote{margin-top:24px}.auth-panel .field input{font-size:16px;min-height:50px}.auth-panel .btn{min-height:47px}.ui-dialog{position:fixed;margin:0 auto;left:0;right:0;top:auto;bottom:12px;width:calc(100vw - 24px);padding:25px 24px calc(25px + env(safe-area-inset-bottom));border-radius:26px;animation:sheet-in .38s var(--spring)}.sheet-grip{display:block;width:34px;height:4px;border-radius:5px;background:#8da2b53b;margin:-12px auto 24px}.ui-dialog h2{font-size:23px}.ui-dialog textarea{font-size:16px}.ui-dialog.closing{animation:sheet-out .2s ease-in forwards}@keyframes sheet-in{from{opacity:0;transform:translateY(70px)}to{opacity:1;transform:none}}@keyframes sheet-out{to{opacity:0;transform:translateY(55px)}}.toast{bottom:calc(95px + env(safe-area-inset-bottom));font-size:11px;padding:12px 16px}
}
@media(max-width:375px){.content{padding-inline:14px}.topbar-right{gap:4px}.lang-trigger{font-size:9px}.home-heading h1{font-size:21px}.quick-actions{gap:21px}.math-header h1{font-size:25px}.formula-card,.step-card,.hint-card,.settings-card{padding:20px}.formula-option{padding:14px 10px}.formula-option strong{font-size:11px}.sidebar .nav-short{font-size:8px}.sidebar .nav-icon svg{width:19px}.sidebar .nav-icon{height:19px;flex-basis:19px}.chat-heading .btn{padding:7px 8px}.auth{padding-inline:25px}}
@media(max-height:500px) and (orientation:landscape){.sidebar{height:54px;bottom:8px;max-width:390px}.sidebar .nav-item{flex-direction:row;gap:6px}.auth{padding-block:90px}.auth-language{position:absolute;bottom:18px}.voice-hero{padding-top:25px}.voice-orb{width:90px;height:90px}.content{padding-bottom:80px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}.orb{display:none}}
/* Full-width tutor keeps the desktop workspace balanced. */
.math-tutor-section{margin-top:20px}.math-tutor-section .course-panel{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}.math-tutor-section h3,.math-tutor-section p{grid-column:1/-1;margin:0}.math-tutor-section textarea{width:100%;min-height:100px!important}.math-tutor-section #course-messages{grid-column:1/-1;grid-row:4;min-height:0}.math-tutor-section #course-messages:empty{display:none}.math-tutor-section .btn{justify-self:start}.math-tutor-section .message{margin-top:10px}
.math-ai-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.math-generated{margin:18px 0 20px;padding:20px 22px}.math-generated>div:first-child{margin-bottom:12px}.generated-list{display:grid;gap:8px}.generated-item{display:grid;grid-template-columns:38px minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px 14px;border:1px solid #ffffff0a;background:#ffffff04;border-radius:14px}.generated-index{color:#8fa9bd;font-size:11px;font-variant-numeric:tabular-nums}.generated-item strong,.generated-item small{display:block;overflow-wrap:anywhere}.generated-item strong{font-size:15px;font-weight:550}.generated-item small{margin-top:4px;color:#8fa1b0;font-size:11px}.generated-item .btn{white-space:nowrap}.generated-loading{display:flex;align-items:center;gap:10px;padding:10px 0;color:#a8b7c5;font-size:13px}
@media(max-width:700px){.math-tutor-section .course-panel{display:flex;flex-direction:column;gap:14px}.quick-actions{gap:0;justify-content:space-between;width:100%}.quick-action{flex:1;min-width:0;max-width:none;padding:0 4px}.quick-action>span:last-child{overflow-wrap:anywhere}.math-tutor-section #course-messages{width:100%}.generated-item{grid-template-columns:27px minmax(0,1fr);gap:8px}.generated-item .btn{grid-column:2;justify-self:start}.math-generated{padding:16px}}
@media(max-width:375px){.subject-grid{margin-right:-14px;padding-right:14px}}
.lang-menu.open{transition:opacity .18s,transform .27s var(--spring),visibility 0s}

