:root{--ink:#282937;--muted:#656573;--purple:#6c5bd1;--purple-dark:#5845bb;--lavender:#eeebfa;--paper:#fff;--bg:#f5f4f0;--border:#eae9ed;--sidebar:#282a3a;--radius:18px;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);font-size:14px;font-synthesis:none}
*{box-sizing:border-box}body{margin:0;background:var(--bg)}button,input,textarea,select{font:inherit}button{cursor:pointer}button,input,textarea,select{-webkit-tap-highlight-color:transparent}button{color:inherit}button:disabled{cursor:default;opacity:.5}a{color:inherit;text-decoration:none}h1,h2,h3,p{margin:0}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #a398ef;outline-offset:3px}input,textarea{outline-offset:0!important}[hidden]{display:none!important}.icon-definitions{position:absolute;width:0;height:0;overflow:hidden}.icon{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.button{display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:42px;padding:10px 18px;border:0;border-radius:11px;font-weight:600;transition:background .15s,transform .15s}.button:active:not(:disabled){transform:translateY(1px)}.primary{background:var(--purple);color:white}.primary:hover:not(:disabled){background:var(--purple-dark)}.secondary{background:var(--lavender);color:var(--purple)}.secondary:hover{background:#e4def8}.subtle{background:transparent;color:var(--muted);border:1px solid var(--border);font-size:12px}.subtle:hover{background:var(--bg);color:var(--ink)}.wide{width:100%}.icon-button{display:inline-flex;align-items:center;justify-content:center;background:none;border:0;border-radius:9px;width:36px;height:36px;color:var(--muted);flex:none}.icon-button:hover{background:var(--lavender);color:var(--purple)}.eyebrow{font-size:10px;letter-spacing:1.65px;font-weight:700;color:var(--muted)}.brand{display:flex;align-items:center;gap:12px;font-size:24px;font-weight:750;letter-spacing:-.6px;line-height:1.05}.brand-mark{width:45px;height:45px;border-radius:14px;background:var(--purple);color:white;font-size:28px;display:inline-flex;align-items:center;justify-content:center;font-weight:500;flex:none}.brand-caption{display:block;font-size:10px;letter-spacing:.7px;font-weight:400;color:var(--muted);margin-top:7px}.avatar{width:38px;height:38px;display:inline-flex;align-items:center;justify-content:center;border-radius:13px;font-weight:650;flex:none;font-size:14px}.lavender{background:#ebe5fa;color:#7560bc}.peach{background:#f8e3d8;color:#b78161}.sage{background:#e1eee4;color:#61876e}.blue{background:#e0eaf7;color:#6181b4}.rose{background:#f5e0eb;color:#b77b97}.boot{height:100dvh;display:flex;align-items:center;justify-content:center;gap:18px;color:var(--muted)}.boot .brand-mark{animation:breathe 1.4s infinite alternate}@keyframes breathe{to{opacity:.5;transform:translateY(-3px)}}
/* A quiet welcome, with the conversation as the visual anchor. */
.auth-layout{min-height:100dvh;display:grid;grid-template-columns:1.08fr 1fr}.auth-story{padding:48px 8%;display:flex;flex-direction:column;justify-content:space-between;position:relative;overflow:hidden}.auth-story:before{content:"";position:absolute;width:500px;height:500px;border:1px solid #e6e2f0;border-radius:50%;right:-290px;bottom:-220px;pointer-events:none}.auth-story:after{content:"";position:absolute;width:430px;height:430px;border:1px solid #e6e2f0;border-radius:50%;right:-255px;bottom:-185px;pointer-events:none}.story-main{padding:70px 0 60px;max-width:520px}.story-main>.eyebrow{color:var(--purple)}.story-main h1{font-size:clamp(30px,3.3vw,49px);letter-spacing:-2px;line-height:1.2;font-weight:650;margin:20px 0}.story-main h1>span{color:var(--purple)}.story-main>p{font-size:16px;line-height:1.8;color:#7b7b87;max-width:380px}.story-message{max-width:385px;margin-top:40px;transform:rotate(-2deg)}.sample-author{display:flex;align-items:center;gap:10px;margin:0 0 12px 4px;font-size:13px}.sample-author>span:last-child{margin-left:auto;color:var(--muted);font-size:11px}.sample-bubble{background:white;padding:22px 25px;border-radius:2px 20px 20px 20px;box-shadow:0 12px 44px #29243e06;line-height:1.7}.sample-bubble>.pinyin{margin:9px 0 3px}.sample-bubble .hanzi{font-size:20px}.sample-label{display:flex;align-items:center;gap:6px;color:#9994aa;border-top:1px solid var(--border);margin-top:15px;padding-top:13px;font-size:10px}.sample-label .icon{width:14px;height:14px}.story-footer{color:var(--muted);font-size:11px;letter-spacing:.2px}.auth-panel{background:white;display:flex;align-items:center;justify-content:center;padding:55px 50px;border-left:1px solid var(--border)}.auth-card{width:100%;max-width:370px}.auth-heading h2{font-size:30px;letter-spacing:-1px;margin:13px 0 9px;font-weight:650}.auth-heading p{color:var(--muted);line-height:1.7}.tabs{display:flex;background:#f5f4f8;padding:4px;border-radius:12px;margin:30px 0 24px;gap:3px}.tabs button{border:0;background:none;flex:1;padding:11px;border-radius:9px;color:var(--muted);font-weight:600}.tabs button.active{color:var(--ink);background:white;box-shadow:0 2px 5px #26223108}form label{display:flex;flex-direction:column;gap:8px;margin-bottom:18px;font-size:12px;font-weight:600}input:not([type=checkbox]),.modal input{width:100%;height:47px;border:1px solid #e4e3e9;border-radius:10px;padding:0 14px;background:white;color:var(--ink);font-size:13px}input::placeholder{color:#aaa8b5}input:hover{border-color:#c9c5d5}.auth-submit{margin-top:9px;width:100%;min-height:48px;justify-content:space-between}.auth-note{display:flex;gap:10px;font-size:11px;color:#9c99a7;line-height:1.65;margin-top:24px}.auth-note .icon{width:16px;height:16px;margin-top:2px}.field-hint{font-weight:400;font-size:11px;line-height:1.6;color:var(--muted)}.mode-switch{display:flex;gap:4px;margin:0 0 18px;border-bottom:1px solid var(--border)}.mode-switch button{flex:1;background:none;border:0;border-bottom:2px solid transparent;padding:11px 4px;color:var(--muted);font-size:12px}.mode-switch button.active{color:var(--purple);border-color:var(--purple)}.form-error{padding:10px 13px;color:#b55454;background:#fff3f1;border-radius:9px;font-size:12px;line-height:1.7;margin-bottom:16px}
/* Workspace */
.workspace{height:100dvh;display:flex;overflow:hidden;max-width:1920px;margin:auto}.sidebar{width:250px;flex:none;background:var(--sidebar);padding:30px 20px 0;display:flex;flex-direction:column;color:#e8e7ed}.sidebar-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:43px;padding:0 9px}.sidebar .brand-mark{background:#8170dd}.sidebar .brand-caption{color:#9b9bab}.sidebar-section-label{display:flex;align-items:center;justify-content:space-between;color:#858596;font-size:9px;letter-spacing:1.45px;font-weight:600;padding:0 11px;margin-bottom:15px;min-height:28px}.sidebar-section-label .icon-button{height:25px;width:25px;color:#a4a3b5}.sidebar-section-label .icon-button:hover{background:#3e3d51}.class-list{display:flex;flex-direction:column;gap:6px;overflow-y:auto;max-height:35vh;min-height:65px}.class-item{width:100%;border:1px solid transparent;background:none;color:#c1c0ce;border-radius:12px;display:flex;align-items:center;text-align:left;gap:12px;padding:12px 10px;min-height:65px}.class-item:hover{background:#333546}.class-item.active{background:#3e3b54;border-color:#585070;color:white}.class-monogram{width:34px;height:34px;border-radius:10px;background:#474357;color:#b7a6e6;display:flex;align-items:center;justify-content:center;font-size:18px;flex:none}.class-item.active .class-monogram{background:#7461bd;color:#efeaff}.class-item>span:last-child{overflow:hidden}.class-item b{font-size:12px;font-weight:550;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.class-item small{display:block;color:#9592a6;font-size:10px;margin-top:5px}.sidebar-divider{height:1px;background:#3b3c4c;margin:26px 10px 19px}.chat-nav{display:flex;align-items:center;gap:12px;background:#333546;border-radius:11px;padding:13px 12px;font-size:12px}.nav-icon{color:#a799d7}.chat-nav small{display:block;color:#9292a5;font-size:9px;margin-top:4px}.nav-dot{width:5px;height:5px;border-radius:50%;background:#a28cdc;margin-left:auto}.sidebar-bottom{margin-top:auto;padding-top:25px}.sidebar-quote{margin:0 11px 32px}.sidebar-quote>span{font-size:15px;color:#c4bada;letter-spacing:1px}.sidebar-quote p{font-size:10px;color:#8b889d;margin-top:9px}.profile{display:flex;align-items:center;gap:10px;border-top:1px solid #3b3c4c;padding:19px 3px 23px}.profile .avatar{width:33px;height:33px;border-radius:11px}.profile-text{flex:1;min-width:0}.profile-text b{font-size:12px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:500}.profile-text small{font-size:10px;color:#9692a6;display:block;margin-top:4px}.profile .icon-button{color:#8d8a9e;width:30px}.profile .icon-button:hover{background:#3c3b4e;color:#dad1f7}.chat-main{flex:1;min-width:0;display:flex;flex-direction:column;background:#fff}.chat-header{display:flex;align-items:center;min-height:112px;padding:24px 34px;gap:14px;flex:none}.chat-title{min-width:0}.chat-title>.eyebrow{font-size:9px;display:block;max-width:40vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-title h1{font-size:28px;letter-spacing:-1px;font-weight:600;margin-top:9px}.title-dot{color:var(--purple);margin-left:3px}.header-actions{display:flex;align-items:center;gap:10px;margin-left:auto}.language-pill{font-size:10px;font-weight:650;letter-spacing:.6px;white-space:nowrap;border:1px solid var(--border);border-radius:20px;padding:7px 11px;color:#747282;margin-right:4px}.language-pill>span{color:#b8b1c6;margin:0 7px}.header-actions .button{font-size:12px;min-height:38px;padding:9px 13px}.header-actions .button .icon{width:17px;height:17px}.chat-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:55px;padding:10px 34px;background:#fbfafc;border-top:1px solid var(--border);border-bottom:1px solid var(--border)}.translation-indicator{display:flex;align-items:center;gap:9px;color:#938aa8;font-size:11px;white-space:nowrap}.sparkle{font-size:25px;line-height:1;color:#9b85c9}.view-options{display:flex;align-items:center;gap:18px;color:#84818e;font-size:11px}.toggle-label{display:inline-flex;align-items:center;gap:7px;cursor:pointer}.toggle-label input{position:absolute;opacity:0;width:1px;height:1px}.toggle-track{width:24px;height:14px;position:relative;background:#dedbe5;border-radius:20px;transition:background .2s}.toggle-track:after{position:absolute;content:"";width:10px;height:10px;top:2px;left:2px;background:white;border-radius:50%;transition:transform .2s}.toggle-label input:checked+.toggle-track{background:#8b7acb}.toggle-label input:checked+.toggle-track:after{transform:translateX(10px)}.toggle-label input:focus-visible+.toggle-track{outline:3px solid #a398ef;outline-offset:3px}.view-options>.icon-button{width:26px;height:26px}.view-options>.icon-button .icon{width:16px;height:16px}.search-bar{display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--border);padding:7px 28px;background:#fcfbff}.search-bar input{border:0;background:none;height:34px}.search-bar>.icon{color:var(--muted);width:18px;height:18px}.connection-status{padding:10px 30px;background:#fff4dc;font-size:12px;color:#927338;flex:none}.connection-status.demo-status{background:#eeebfa;color:#7563af}.chat-body{display:flex;flex:1;min-height:0}.conversation{flex:1;min-width:0;display:flex;flex-direction:column;position:relative}.message-scroll{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#e6e3ec transparent;padding:0 34px 28px;scroll-behavior:auto}.conversation-intro{padding:30px 0 25px;text-align:center}.intro-glyph{font-size:25px;letter-spacing:5px;color:#afa0cc}.conversation-intro h2{font-size:13px;font-weight:500;margin-top:11px}.conversation-intro p{font-size:10px;color:#a19aa9;margin-top:7px}.older-wrap{text-align:center}.older-wrap .button{margin:0 0 15px}.date-separator{display:flex;align-items:center;gap:15px;margin:17px 0 27px;font-size:10px;color:#aaa4b2;justify-content:center}.date-separator:before,.date-separator:after{content:"";height:1px;background:#f0edf3;flex:1}.message{display:flex;align-items:flex-start;gap:11px;margin:0 0 24px;position:relative}.message>.avatar{width:33px;height:33px;border-radius:11px;margin-top:3px;font-size:12px}.message-content{min-width:0;width:100%;max-width:560px}.message-meta{display:flex;align-items:center;gap:8px;margin:2px 0 9px;font-size:11px;line-height:1.4}.message-author{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:75%}.message-time{color:#aba7b3;font-size:9px;white-space:nowrap}.message-you{font-size:9px;color:#b4a7ce}.message-bubble{background:#f7f6fa;border:1px solid #f0eef4;border-radius:2px 15px 15px 15px;padding:15px 18px;position:relative;font-size:13px;line-height:1.65;overflow-wrap:anywhere}.message.own .message-bubble{background:#f0edf9;border-color:#e9e3f5}.original-text,.translation-text,.pinyin{white-space:pre-wrap}.original-text[lang=zh]{font-size:19px;line-height:1.7;letter-spacing:.6px}.translation-lines{margin-top:11px;border-top:1px solid #e9e6ef;padding-top:10px}.pinyin{color:#9583b8;font-size:12px;line-height:1.7;font-style:normal;margin-bottom:4px}.translation-text{font-size:13px;color:#706a81;line-height:1.7}.translation-text[lang=zh]{font-size:18px;letter-spacing:.5px;color:#776388}.message-status{font-size:10px;color:#a398b8;line-height:1.7;margin-top:9px;display:flex;align-items:center;gap:7px;flex-wrap:wrap}.message-status.error{color:#b27e79}.retry-button{font-size:10px;border:0;padding:3px 7px;border-radius:5px;background:#ede7f3;color:#8068a7}.retry-button:hover{background:#e1d7ef}.pending-dot{width:4px;height:4px;background:#aa9ac6;border-radius:50%;animation:breathe .7s infinite alternate}.plain-note{font-size:9px;margin-top:7px;color:#b1a8be}.chat-empty{padding:55px 15px;text-align:center;color:#aaa1b6}.chat-empty>span{font-size:30px}.chat-empty h3{font-size:15px;color:#80748f;font-weight:500;margin:12px 0 8px}.chat-empty p{font-size:12px;line-height:1.7}.new-messages{position:absolute;bottom:190px;left:50%;transform:translateX(-50%);box-shadow:0 5px 25px #5e4c9920;font-size:11px;min-height:36px;white-space:nowrap;z-index:1}.new-messages:active:not(:disabled){transform:translateX(-50%) translateY(1px)}.composer-area{padding:0 28px 20px;flex:none;background:white}.composer{border:1px solid #e9e5ef;background:#fff;border-radius:15px;padding:16px 16px 12px;box-shadow:0 3px 15px #4a376104}.composer:focus-within{border-color:#c3b9de}.composer textarea{border:0;resize:none;width:100%;min-height:36px;max-height:140px;padding:0 2px;color:var(--ink);font-size:13px;line-height:1.7;background:none;outline:none!important;scrollbar-width:thin}.composer textarea::placeholder{color:#b2aabd}.composer-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:9px}.language-select{margin:0;display:block;font-weight:400}.language-select select{border:0;background:#f8f7fa;color:#948a9f;border-radius:7px;padding:7px 8px;max-width:185px;font-size:10px}.send-controls{display:flex;align-items:center;gap:12px}.character-count{font-size:9px;color:#b7adbf}.character-count.near-limit{color:#b87373}.send-controls .button{min-height:34px;padding:8px 12px;border-radius:9px;font-size:10px;gap:12px}.send-controls .icon{width:15px;height:15px}.composer-hint{display:flex;align-items:center;justify-content:space-between;font-size:9px;color:#b6adbd;margin:11px 4px 0;gap:6px}.composer-hint>span:last-child{display:flex;align-items:center;gap:4px;white-space:nowrap}.composer-hint .icon{width:12px;height:12px}.class-details{width:265px;flex:none;background:#fcfbf9;border-left:1px solid var(--border);padding:29px 24px;overflow:auto;scrollbar-width:thin}.details-top h2{font-size:22px;font-weight:500;letter-spacing:-.7px;line-height:1.3;margin:15px 0 10px;max-width:160px}.details-top h2>span{color:var(--purple)}.details-top p{font-size:11px;line-height:1.75;color:#9c939f}.translation-guide{border:1px solid #e9e2ee;border-radius:13px;background:#f6f2f9;margin:25px 0 30px;padding:16px 14px}.guide-header{display:flex;align-items:center;gap:8px;font-size:11px;color:#877598;margin-bottom:20px}.guide-header b{font-weight:500}.guide-header .sparkle{font-size:22px}.guide-line{display:flex;gap:10px;margin-bottom:17px}.guide-number{color:#ac98c3;font-size:10px;border:1px solid #dfd4e9;width:21px;height:21px;display:flex;align-items:center;justify-content:center;border-radius:7px;flex:none}.guide-line b{font-size:10px;font-weight:500;color:#84778e}.guide-line p{font-size:9px;color:#b0a5b8;margin-top:4px}.guide-footer{display:block;font-size:8px;color:#b6a9c0;border-top:1px solid #e7ddec;padding-top:12px}.members-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.members-heading .eyebrow{font-size:9px;letter-spacing:1.2px}.members-heading>span:last-child{font-size:10px;color:#aba4b0}.member-list{display:flex;flex-direction:column;gap:15px}.member{display:flex;align-items:center;gap:10px}.member .avatar{width:29px;height:29px;border-radius:10px;font-size:11px;position:relative}.member.online .avatar:after{content:"";position:absolute;right:-1px;bottom:-1px;width:7px;height:7px;border:2px solid #fcfbf9;background:#86ad93;border-radius:50%}.member-name{min-width:0;overflow:hidden}.member-name b{font-size:10px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}.member-name small{font-size:8px;color:#b2a9b9;display:block;margin-top:3px}.details-footer{display:flex;gap:10px;align-items:center;border-top:1px solid var(--border);margin-top:30px;padding-top:18px;color:#b2a9b9}.details-footer .icon{width:17px;height:17px}.details-footer p{font-size:9px;line-height:1.7}
.modal{border:1px solid #e8e3ed;border-radius:22px;padding:28px;max-width:420px;width:calc(100% - 36px);color:var(--ink);box-shadow:0 25px 100px #1c152333;max-height:calc(100dvh - 48px);overflow:auto}.modal::backdrop{background:#201d3580;backdrop-filter:blur(3px)}.modal-top{display:flex;justify-content:space-between;align-items:center;margin:-4px 0 8px}.modal h2{font-weight:600;font-size:24px;letter-spacing:-.7px;margin-bottom:20px;line-height:1.3}.modal>p{font-size:12px;line-height:1.8;color:var(--muted);margin-bottom:19px}.modal .brand-mark{margin-bottom:20px}.invite-code{font-size:24px;letter-spacing:3px;font-family:ui-monospace,monospace;color:var(--purple);background:var(--lavender);border-radius:13px;text-align:center;padding:25px 10px;margin:24px 0 15px;user-select:all}.invite-rotation{border-top:1px solid var(--border);margin-top:25px;padding-top:20px;text-align:center}.invite-rotation p{font-size:10px;line-height:1.7;color:var(--muted);margin-bottom:14px}.modal .member-list{max-height:50vh;overflow:auto;padding:6px 0}.modal .member-name b{font-size:13px}.modal .member-name small{font-size:10px}.modal .member .avatar{width:36px;height:36px}.toast{position:fixed;bottom:26px;left:50%;transform:translateX(-50%);background:#333144;color:#fff;border-radius:11px;box-shadow:0 8px 30px #27233420;padding:14px 22px;font-size:12px;line-height:1.6;z-index:10;max-width:calc(100% - 32px);text-align:center}.noscript{position:fixed;inset:0;background:white;display:grid;place-items:center}.mobile-only{display:none}body[data-pinyin="off"] .translation-lines>.pinyin{display:none}body[data-translation="off"] .translation-lines>.translation-text{display:none}body[data-pinyin="off"][data-translation="off"] .translation-lines{display:none}
@media(min-width:1550px){.sidebar{width:280px;padding-left:25px;padding-right:25px}.class-details{width:300px;padding:35px 30px}.message-scroll{padding-left:50px;padding-right:50px}.chat-header,.chat-toolbar{padding-left:50px;padding-right:50px}.composer-area{padding-left:44px;padding-right:44px}.message-content{max-width:720px}}
@media(max-width:1190px){.class-details{display:none}.sidebar{width:230px}.message-content{max-width:620px}.auth-story{padding:38px 7%}.auth-panel{padding:45px 35px}}
@media(max-width:820px){.sidebar{width:205px;padding-left:13px;padding-right:13px}.brand{font-size:21px}.brand-mark{width:38px;height:38px;font-size:24px;border-radius:12px}.chat-header{padding:24px;min-height:100px}.chat-toolbar{padding:10px 22px}.translation-indicator{font-size:10px}.view-options{gap:12px;font-size:10px}.message-scroll{padding-left:23px;padding-right:23px}.composer-area{padding:0 19px 17px}.language-pill{display:none}.header-actions{gap:4px}.story-main h1{font-size:32px;letter-spacing:-1.1px}.story-main>p{font-size:14px}.auth-layout{grid-template-columns:1fr 1fr}.auth-story{padding:35px 26px}.story-main{padding:55px 0}.sample-bubble{padding:18px}.sample-bubble>p:first-child{font-size:12px}.sample-bubble .pinyin{font-size:10px}.sample-bubble .hanzi{font-size:16px}.auth-panel{padding:40px 25px}}
@media(max-width:650px){.auth-layout{display:flex;flex-direction:column}.auth-story{padding:24px 26px 10px}.auth-story>.brand{font-size:21px}.story-main{padding:35px 0 20px;max-width:none}.story-main>.eyebrow{font-size:9px}.story-main h1{font-size:33px;margin:14px 0}.story-main>p{font-size:13px;max-width:340px}.story-message,.story-footer{display:none}.auth-panel{padding:25px 26px 40px;border-left:0;flex:1;border-top:1px solid var(--border)}.auth-card{max-width:420px}.auth-heading>.eyebrow{display:none}.auth-heading h2{font-size:24px;margin-top:0}.tabs{margin-top:20px}.workspace{min-height:420px}.sidebar{position:fixed;left:0;top:0;bottom:0;width:270px;z-index:5;transform:translateX(-100%);transition:transform .2s;padding:27px 20px 0}.sidebar.open{transform:translateX(0)}.sidebar-overlay{position:fixed;inset:0;background:#1b172766;z-index:4;border:0}.sidebar-top .icon-button{color:#b3a8cc}.mobile-only{display:inline-flex}.chat-header{min-height:84px;padding:17px 15px 17px 9px;gap:8px}.chat-title>.eyebrow{font-size:8px;letter-spacing:1px;max-width:42vw}.chat-title h1{font-size:23px;margin-top:6px}.header-actions .button{width:34px;height:34px;min-height:34px;padding:8px;border-radius:10px}.header-actions .button>span{display:none}.header-actions .icon-button{width:32px;height:32px}.chat-toolbar{padding:9px 17px;min-height:49px;gap:8px}.translation-indicator{font-size:9px;gap:5px;white-space:normal;max-width:130px;line-height:1.5}.translation-indicator .sparkle{font-size:21px}.view-options{gap:12px;font-size:9px}.toggle-label{gap:5px}.view-options>.icon-button{width:22px}.toggle-track{width:22px;height:13px}.toggle-track:after{width:9px;height:9px}.conversation-intro{padding:23px 0 15px}.conversation-intro h2{font-size:12px}.conversation-intro p{font-size:9px}.intro-glyph{font-size:22px}.message-scroll{padding:0 16px 17px}.message{gap:9px;margin-bottom:21px}.message>.avatar{width:29px;height:29px;font-size:11px}.message-meta{font-size:10px;gap:7px}.message-bubble{padding:12px 14px;font-size:13px}.message-copy{opacity:.6}.pinyin{font-size:11px}.translation-text{font-size:12px}.translation-text[lang=zh]{font-size:17px}.date-separator{margin:13px 0 21px;font-size:9px}.composer-area{padding:0 12px max(11px,env(safe-area-inset-bottom))}.composer{padding:13px 12px 10px;border-radius:13px}.composer textarea{font-size:16px;min-height:35px;line-height:1.55}.composer-hint{font-size:8px;margin-top:8px}.language-select select{font-size:10px;max-width:170px;padding:7px 5px}.send-controls{gap:6px}.send-controls .button{padding:8px 10px}.character-count{display:none}.search-bar{padding:7px 14px}.search-bar input{font-size:12px}.new-messages{bottom:165px}.connection-status{padding:8px 16px;font-size:11px}.modal{padding:24px}.modal h2{font-size:22px}.toast{bottom:20px}}
@media(max-width:360px){.view-options{gap:7px}.translation-indicator{max-width:100px}.composer-hint>span:last-child{display:none}.send-controls .button>span{display:none}.language-select select{max-width:160px}}
.toggle-label{position:relative;min-height:30px}.toggle-label input{inset:0;width:100%;height:100%;margin:0;z-index:1;cursor:pointer}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
/* Installed app controls and space around device cutouts. */
.pwa-install{margin-top:16px;font-size:12px}.sidebar .pwa-install{margin:0 0 20px;min-height:38px;background:#3c3a51;color:#e8e7ed}
.sidebar{min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scrollbar-width:thin}
.sidebar>*{flex-shrink:0}
/* The active class doubles as the disclosure for the class list. */
.class-switcher{display:flex;align-items:center;gap:6px}
.class-switcher-toggle{flex:1;min-width:0;width:auto}
.class-item.class-switcher-toggle,.class-item.class-switcher-toggle:hover{background:transparent;border-color:transparent;color:#e8e7ed}
.class-switcher-leading{display:flex;align-items:center;gap:6px;flex:none}
.class-switcher-back{width:14px;height:14px;color:#bcb9ca;background:transparent}
.class-switcher-text{flex:1;min-width:0}
.class-switcher-label{flex:1;font-size:12px;font-weight:600;letter-spacing:1.45px;line-height:1.6;color:#bcb9ca}
.class-switcher-chevron{display:flex;flex:none;color:#bcb9ca}.class-switcher-chevron .icon{width:18px;height:18px}
.class-switcher-toggle[aria-expanded=true]{min-height:44px;padding:8px 10px;background:transparent;border-color:transparent}
.class-switcher-toggle[aria-expanded=true]:hover{background:transparent}
.class-switcher>.icon-button{width:44px;height:44px;color:#bcb9ca}
.class-switcher>.icon-button:hover{background:#3e3d51;color:white}
.class-switcher+.class-list{margin-top:8px}
@media(prefers-reduced-motion:reduce){.class-switcher-toggle,.class-switcher-chevron{transition:none}}
@media(max-width:650px){.sidebar{height:100dvh;bottom:auto;max-width:calc(100vw - 44px);padding-bottom:max(16px,env(safe-area-inset-bottom))}.sidebar .class-list{max-height:none;overflow-y:visible}}
@media(display-mode:standalone){body{padding-top:env(safe-area-inset-top);padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}.workspace,.boot{height:calc(100dvh - env(safe-area-inset-top))}.auth-layout{min-height:calc(100dvh - env(safe-area-inset-top))}.sidebar{top:env(safe-area-inset-top);height:calc(100dvh - env(safe-area-inset-top))}}
/* Classroom tools */
.chat-content{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0}.space-nav{border:0;width:100%;text-align:left;color:#ddd9ea;cursor:pointer;background:transparent;margin-bottom:7px}.space-nav.active{background:#3c3a51}.space-nav:not(.active){opacity:.7}.space-nav:hover{opacity:1}.unread-count{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 6px;background:var(--purple);color:white;border-radius:20px;font-size:10px;margin-left:auto;flex:none}.unread-jump{text-align:center}.unread-jump .button{font-size:11px;margin:7px 0;min-height:30px;padding:5px 12px}.reply-quote{display:flex;flex-direction:column;gap:5px;text-align:left;border:0;border-left:3px solid #afa3e8;background:#6b5bd20a;padding:9px 11px;margin:0 20px 12px 0;max-width:100%;color:var(--ink);border-radius:0 7px 7px 0}.reply-quote b{font-size:11px;color:var(--purple)}.reply-quote span{font-size:12px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow-wrap:anywhere}.edited-note{font-size:9px;color:var(--muted)}.deleted-text{font-style:italic;color:var(--muted)}.message-highlight .message-bubble{outline:2px solid #a398ef;outline-offset:4px}.composer-context{display:flex;align-items:center;justify-content:space-between;padding:10px 13px;margin:0 2px 8px;background:var(--lavender);border-radius:10px;gap:10px}.composer-context>div{min-width:0;display:flex;flex-direction:column;gap:5px}.composer-context b{font-size:11px;color:var(--purple)}.composer-context span{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.recovery-link{margin-top:12px;border:0}.files-view{flex:1;overflow:auto;min-height:0;padding:28px 36px}.files-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:24px}.files-heading h2{font-size:21px;letter-spacing:-.5px;margin-bottom:10px}.file-search{margin:0;max-width:280px}.file-upload-form{background:white;border:1px solid var(--border);padding:22px;border-radius:16px;max-width:850px;display:grid;grid-template-columns:1fr 1fr;gap:0 20px}.file-upload-form input[type=file]{height:auto;min-height:47px;padding:9px;max-width:100%;font-size:12px}.file-upload-form .field-hint,.file-upload-form .form-error{grid-column:1/-1;margin:0 0 15px}.file-upload-form .button{justify-self:start}.file-upload-form .form-error{margin:15px 0 0}.file-list{margin-top:25px;max-width:1000px}.file-card{display:flex;gap:16px;padding:20px 0;border-bottom:1px solid var(--border);align-items:center}.file-symbol{font-size:28px;color:var(--purple);background:var(--lavender);border-radius:11px;width:46px;height:52px;display:grid;place-items:center;flex:none}.file-details{flex:1;min-width:0}.file-name{font-weight:600;overflow-wrap:anywhere;line-height:1.5}.file-name:hover{text-decoration:underline}.file-details p{font-size:12px;color:var(--muted);margin:5px 0;line-height:1.6;overflow-wrap:anywhere}.file-details small{font-size:10px;color:var(--muted)}.file-actions{display:flex;gap:8px;flex:none}.file-actions .button{font-size:11px;min-height:36px;padding:8px 12px}.files-empty{padding:60px 20px;text-align:center;color:var(--muted)}.files-empty>span{font-size:40px;color:var(--purple)}.files-empty h3{color:var(--ink);font-size:17px;margin:15px 0 10px}.files-empty p{font-size:12px;line-height:1.7}#more-files{margin-top:20px}.member-controls{display:flex;align-items:center;gap:8px;width:100%;padding-left:46px}.member-controls select,.invite-rotation select{font:inherit;border:1px solid var(--border);border-radius:7px;background:white;color:var(--ink);padding:8px;font-size:11px}.member-controls .button{padding:7px 10px;min-height:32px;font-size:10px}#dialog-member-list .member{flex-wrap:wrap;row-gap:8px}.removed-member .avatar{opacity:.5}.account-modal h3{font-size:16px;margin-bottom:12px}.notification-settings{border-top:1px solid var(--border);margin-top:26px;padding-top:22px}.notification-settings>p{line-height:1.7;margin-bottom:16px}.setting-checkbox{display:flex;flex-direction:row;align-items:center;gap:10px;margin-top:18px}.setting-checkbox input{width:17px;height:17px;accent-color:var(--purple)}.profile{gap:7px}.profile .icon-button{width:29px}.profile-text{flex:1;min-width:0}#email-feedback,#recovery-feedback{margin-top:14px;line-height:1.7}
@media(max-width:650px){.files-view{padding:20px 16px}.files-heading{flex-direction:column;align-items:stretch;gap:16px}.file-search{max-width:none}.file-upload-form{display:block;padding:17px}.file-upload-form label{min-width:0}.file-card{flex-wrap:wrap;gap:12px}.file-symbol{width:35px;height:42px;font-size:22px}.file-actions{padding-left:47px;width:100%}.reply-quote{margin-right:15px}.member-controls{padding-left:0}.member-controls select{max-width:155px}.composer-context{margin-bottom:7px}.files-heading h2{font-size:19px}}

/* Message menu, reply gesture and small interaction cues. */
.message-scroll{overflow-x:hidden}.message-meta{min-height:28px;margin-bottom:5px}.message-menu-trigger{margin-left:auto;width:28px;height:28px;color:#aaa0b9;opacity:.65;transition:opacity .15s,background .15s,transform .15s}.message:hover .message-menu-trigger,.message-menu-trigger:focus-visible,.message-menu-trigger[aria-expanded=true]{opacity:1}.message-menu-trigger[aria-expanded=true]{background:var(--lavender);color:var(--purple)}.message-menu-trigger:active{transform:scale(.9)}.message-menu-trigger .icon{width:18px;height:18px}
.message-context-menu{position:fixed;z-index:50;min-width:192px;max-width:calc(100vw - 16px);padding:6px;background:#fff;border:1px solid #e9e5ef;border-radius:14px;box-shadow:0 12px 36px #30254926,0 2px 8px #3025490a;animation:message-menu-in .15s ease-out;transform-origin:top center}.message-context-menu button{display:flex;align-items:center;gap:12px;width:100%;min-height:42px;padding:10px 12px;border:0;border-radius:9px;background:transparent;text-align:left;font-size:12px;transition:background .12s,transform .12s}.message-context-menu button:hover,.message-context-menu button:focus-visible{background:var(--lavender);outline:none;color:var(--purple)}.message-context-menu button:active{transform:scale(.97)}.message-context-menu button[data-delete-message]{color:#b65f64}.message-context-menu button[data-delete-message]:hover,.message-context-menu button[data-delete-message]:focus-visible{background:#fff0f1}.message-context-menu button[data-copy]{border-top:1px solid var(--border);border-radius:9px;margin-top:4px}.message-context-menu .icon{width:17px;height:17px}
.message-bubble{touch-action:pan-y pinch-zoom;-webkit-touch-callout:none}.message-content{position:relative;z-index:1;transform:translateX(var(--swipe-x,0px));transition:transform .24s cubic-bezier(.2,.8,.2,1)}.message-swiping .message-content{transition:none;user-select:none;-webkit-user-select:none;will-change:transform}.swipe-reply-indicator{position:absolute;left:var(--swipe-indicator-left,calc(100% - 32px));top:45px;width:32px;height:32px;display:grid;place-items:center;border-radius:50%;background:var(--lavender);color:var(--purple);opacity:var(--swipe-progress,0);transform:scale(calc(.65 + var(--swipe-progress,0) * .35));transition:opacity .18s,transform .18s,background .15s,color .15s;pointer-events:none}.swipe-reply-indicator .icon{width:17px;height:17px}.message-swiping .swipe-reply-indicator{transition:background .15s,color .15s}.message-swipe-ready .swipe-reply-indicator{background:var(--purple);color:white}.message-enter{animation:message-enter .2s ease-out}.composer{transition:border-color .18s,box-shadow .18s}.composer:focus-within{box-shadow:0 3px 18px #6b5bd20d}
@keyframes message-menu-in{from{opacity:0;transform:translateY(-4px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes message-enter{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:650px){.message-menu-trigger{width:32px;height:32px;opacity:1}.message-context-menu button{min-height:46px}.swipe-reply-indicator{top:48px}}

/* Bilingual lesson cards: teachers manage content, students track homework. */
.lessons-view{flex:1;overflow:auto;min-height:0;padding:24px 32px;background:#f8f7fa;scrollbar-width:thin}
.lesson-role{display:inline-flex;color:var(--purple);font-size:12px;margin-top:7px;white-space:nowrap}
.lessons-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:18px;max-width:1100px}
.lesson-search{margin:0;flex:1;min-width:200px}
.lesson-search input{height:43px;font-size:13px}
.lessons-tools>.button{font-size:12px;min-height:43px;white-space:nowrap}
.lessons-tools>.button .icon{width:16px;height:16px}
.lessons-list-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:20px;max-width:1100px;color:var(--muted);font-size:12px}
.lesson-filters{display:flex;gap:4px;flex-wrap:wrap}
.lesson-filters button{border:0;border-radius:8px;padding:9px 10px;color:var(--muted);background:transparent;font:inherit;font-size:12px;min-height:40px}
.lesson-filters button.active{background:var(--lavender);color:var(--purple)}
.lessons-layout{max-width:1100px;min-width:0}
.lesson-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.lesson-card{display:flex;flex-direction:column;gap:14px;min-width:0;padding:22px;border:1px solid var(--border);border-radius:14px;background:var(--paper);color:var(--ink);overflow-wrap:anywhere}
.lesson-card-top{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;color:var(--muted)}
.lesson-card-top time{font-size:12px}
.lesson-card-heading{display:flex;align-items:flex-start;gap:12px;min-width:0}
.lesson-card-number{color:var(--purple);font-size:30px;font-weight:500;line-height:1.2;letter-spacing:-1px;flex:none}
.lesson-card-title{font-size:19px;font-weight:600;line-height:1.45;margin:0}
.lesson-card-chinese{font-size:16px;color:#8c78a4;line-height:1.6;margin-top:4px}
.lesson-card-description{font-size:13px;line-height:1.8;color:#777184}
.lesson-card-description p,.lesson-card-homework p{overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;white-space:pre-line}
.lesson-card-description [lang=zh],.lesson-card-homework [lang=zh]{font-size:14px;color:#80718f;margin-top:6px}
.lesson-card-materials{display:flex;align-items:center;gap:7px;border-top:1px solid var(--border);padding-top:13px;font-size:12px;margin-top:auto}
.lesson-card-materials .icon{width:17px;height:17px;color:var(--purple)}
.lesson-card-homework{background:#fbfaf7;border-radius:10px;padding:13px;font-size:13px;line-height:1.8}
.lesson-card-homework h4{font-size:12px;font-weight:500;color:var(--muted);margin:0 0 5px}
.lesson-card-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.lesson-card-footer .button{font-size:12px;font-weight:500;padding:9px 12px;min-height:40px;max-width:100%}
.lesson-card-footer .icon{width:16px;height:16px}
.lesson-status{display:inline-flex;align-items:center;gap:6px;color:var(--muted);font-size:12px;line-height:1.5}
.lesson-homework-button{font-weight:500}
.lesson-homework-button.done{background:#edf4ef;color:#447959}
.lesson-detail{background:var(--paper);border:1px solid var(--border);border-radius:14px;padding:24px;min-width:0;overflow-wrap:anywhere;max-width:900px;margin:auto}
.lesson-detail-meta{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;font-size:12px;color:var(--muted);line-height:1.8;margin-bottom:16px}
.lesson-detail-meta b{font-weight:500;color:var(--purple)}
.lesson-detail h2{font-size:25px;line-height:1.5;margin:0 0 6px}
.lesson-detail-chinese{font-size:20px;line-height:1.6;color:#8c78a4;margin-bottom:12px}
.lesson-manage{display:flex;gap:8px;margin-top:14px;flex-wrap:wrap}
.lesson-manage .button{font-size:12px;min-height:40px}
.lesson-section{margin-top:20px;padding-top:18px;border-top:1px solid var(--border)}
.lesson-section h3{font-size:15px;font-weight:500;margin-bottom:12px;line-height:1.6}
.lesson-section h3 [lang=zh]{color:var(--muted)}
.lesson-section .field-hint{line-height:1.8;font-size:12px}
.lesson-homework-section{background:#fbfaf7;border:0;border-radius:10px;padding:18px}
.lesson-bilingual{display:grid;gap:9px;font-size:14px;line-height:1.8;white-space:pre-wrap}
.lesson-bilingual [lang=zh]{color:#7e6c91;font-size:16px}
.lesson-section [data-homework-toggle]{margin-top:16px;font-size:13px}
.lesson-materials{list-style:none;padding:0;margin:0}
.lesson-materials li{display:flex;align-items:center;gap:10px;padding:10px 0}
.lesson-materials li>div{min-width:0;flex:1}
.lesson-materials b{display:block;font-size:13px;font-weight:500;line-height:1.6;overflow-wrap:anywhere}
.lesson-materials small{display:block;color:var(--muted);font-size:12px;margin-top:4px}
.lesson-materials .file-symbol{width:32px;height:38px;font-size:20px}
.lesson-materials .button{font-size:12px;min-height:40px;padding:8px 12px;flex:none}
.lessons-empty{padding:45px 12px;text-align:center;color:var(--muted);grid-column:1/-1}
.lessons-empty h3{font-size:15px;font-weight:500;line-height:1.7;margin-bottom:10px}
.lesson-back{display:inline-flex;margin-bottom:20px}
.lessons-view.has-detail #lesson-list-pane,.lessons-view.has-detail .lessons-tools,.lessons-view.has-detail .lessons-list-heading{display:none}
#more-lessons{margin-top:20px;font-size:12px}
#lessons-feedback:empty,#lesson-upload-status:empty{display:none}
#lessons-feedback{margin:12px 0 18px;line-height:1.8;font-size:12px}
.lesson-modal{max-width:640px}
.lesson-modal .field-hint{line-height:1.8;margin-bottom:16px;font-size:12px}
.lesson-form-grid{display:grid;grid-template-columns:minmax(0,1fr) 180px;gap:0 16px}
.lesson-modal label{min-width:0;line-height:1.7}
.lesson-modal textarea{font:inherit;border:1px solid var(--border);border-radius:10px;padding:12px;width:100%;resize:vertical;background:var(--paper);min-height:80px;color:var(--ink)}
.lesson-material-picker{border:1px solid var(--border);border-radius:12px;padding:14px;margin:0 0 16px;min-width:0}
.lesson-material-picker legend{font-size:13px;padding:0 5px}
.lesson-upload-button{position:relative;display:inline-flex;font-size:12px;font-weight:400;margin:0 0 10px;cursor:pointer;overflow:hidden}
.lesson-upload-button input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}
.lesson-upload-button:focus-within{outline:2px solid var(--purple);outline-offset:2px}
.lesson-attached-file{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 0;font-size:12px;border-bottom:1px solid var(--border)}
.lesson-attached-file span{min-width:0;overflow-wrap:anywhere}
.lesson-attached-file button{flex:none}
.lesson-file-option{display:flex;align-items:center;gap:10px;font-weight:400;line-height:1.6;margin:0;padding:10px 0;font-size:12px}
.lesson-file-option input{width:18px;height:18px;flex:none;accent-color:var(--purple);margin:0}
.lesson-file-option span{min-width:0;overflow-wrap:anywhere}
.lesson-file-option small{display:block;font-size:12px;color:var(--muted)}
#lesson-file-options{max-height:210px;overflow:auto}
.lesson-modal summary{cursor:pointer;color:var(--purple);font-size:12px;padding:10px 0;line-height:1.8}
.lesson-translations{margin-bottom:12px}
.lesson-translations label{margin-top:10px}
.lesson-form-actions{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap;margin-top:18px}
.lesson-form-actions .button{font-size:13px}
.lesson-modal .form-error{line-height:1.8}
.lesson-filters button:focus-visible{outline:2px solid var(--purple);outline-offset:3px}
@media(max-width:1100px){.lessons-view{padding:20px}.lesson-card{padding:18px}.lessons-tools #refresh-lessons span{display:none}.lessons-tools #refresh-lessons{padding:10px 12px}}
@media(max-width:820px){.lesson-list{grid-template-columns:1fr}}
@media(max-width:650px){.lessons-view{padding:16px}.lesson-role{font-size:12px}.lessons-tools{gap:8px}.lesson-search{min-width:100%;max-width:none}.lessons-view[data-role=student] .lesson-search{min-width:0}.lesson-search input,.lesson-modal input,.lesson-modal textarea{font-size:16px}.lessons-tools>.button{min-height:44px}.lesson-filters button{font-size:12px;min-height:44px;padding:8px}.lessons-list-heading{gap:8px;margin-bottom:16px}.lesson-list{gap:14px}.lesson-card{padding:18px;gap:13px}.lesson-card-title{font-size:19px}.lesson-card-footer{flex-direction:column;align-items:stretch}.lesson-card-footer .button{width:100%;min-height:44px}.lesson-card-footer .lesson-status{text-align:center;justify-content:center}.lesson-detail{padding:18px 16px}.lesson-detail h2{font-size:22px}.lesson-detail-meta{font-size:12px}.lesson-back{min-height:44px}.lesson-materials li{flex-wrap:wrap}.lesson-materials li>div{flex-basis:calc(100% - 42px)}.lesson-materials .button{margin-left:42px;min-height:44px}.lesson-form-grid{grid-template-columns:1fr}.lesson-modal h2{font-size:21px}.lesson-material-picker{padding:12px}.lesson-attached-file .icon-button{width:44px;height:44px}.lesson-form-actions .button{min-height:44px}.lesson-modal .lesson-file-option input[type=checkbox]{width:20px;height:20px}.lesson-file-option{min-height:44px}.lesson-manage .button{min-height:44px}}

/* Character practice uses bundled stroke data and a touch-friendly writing grid. */
.hanzi-view{flex:1;min-height:0;overflow:auto;padding:28px 32px;background:#f8f7fa;scrollbar-width:thin}
.hanzi-intro{display:flex;align-items:center;justify-content:space-between;gap:24px;max-width:1200px;margin:0 auto 26px}
.hanzi-intro h2{font-size:24px;font-weight:500;line-height:1.45;margin:10px 0}
.hanzi-intro p{font-size:13px;color:var(--muted);line-height:1.8}
.hanzi-progress{flex:none;padding:15px 22px;border:1px solid var(--border);border-radius:14px;background:var(--paper);display:grid;gap:5px}
.hanzi-progress b{font-size:26px;font-weight:500;color:var(--purple)}
.hanzi-progress span,.hanzi-progress small{font-size:12px;color:var(--muted)}
.hanzi-progress small{font-size:11px;margin-top:3px}
.hanzi-layout{display:grid;grid-template-columns:240px minmax(280px,1fr) 220px;align-items:start;gap:22px;max-width:1200px;margin:auto}
.hanzi-catalog,.hanzi-practice{border:1px solid var(--border);border-radius:16px;background:var(--paper);padding:20px;min-width:0}
.hanzi-catalog label{font-size:12px;margin-bottom:16px}
.hanzi-catalog input,.hanzi-catalog select{font:inherit;font-size:13px;min-height:43px;width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:9px;background:var(--paper);color:var(--ink)}
.hanzi-character-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.hanzi-character{position:relative;display:grid;gap:5px;text-align:center;border:1px solid var(--border);border-radius:10px;background:var(--paper);padding:10px 3px;min-height:70px;color:var(--ink)}
.hanzi-character>span{font-size:25px;line-height:1.2;font-family:"Kaiti SC","STKaiti","KaiTi",serif}
.hanzi-character small{font-size:11px;color:var(--muted)}
.hanzi-character.active{border-color:var(--purple);background:var(--lavender);color:var(--purple)}
.hanzi-character b{position:absolute;right:4px;top:3px;font-size:10px;color:#447959}
.hanzi-character:focus-visible{outline:2px solid var(--purple);outline-offset:2px}
.hanzi-character-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}
.hanzi-character-heading>div{display:flex;align-items:center;gap:14px}
#hanzi-current-char{font-family:"Kaiti SC","STKaiti","KaiTi",serif;font-size:44px;line-height:1.2;color:var(--purple)}
.hanzi-character-heading h3{font-size:21px;font-weight:500;margin:0 0 5px}
.hanzi-character-heading p,.hanzi-stroke-count{font-size:12px;line-height:1.5;color:var(--muted)}
.hanzi-stroke-count{white-space:nowrap;background:#f8f7fa;border-radius:8px;padding:8px}
.hanzi-board{position:relative;width:100%;max-width:360px;aspect-ratio:1;margin:auto;border:1px solid #ddd4e5;border-radius:14px;overflow:hidden;background:#fdfbf8;touch-action:none;user-select:none;-webkit-user-select:none}
.hanzi-board::before,.hanzi-board::after{content:"";position:absolute;inset:0;pointer-events:none}
.hanzi-board::before{background:linear-gradient(45deg,transparent calc(50% - .5px),#e7e0eb 50%,transparent calc(50% + .5px)),linear-gradient(-45deg,transparent calc(50% - .5px),#e7e0eb 50%,transparent calc(50% + .5px))}
.hanzi-board::after{inset:50% 0 auto;height:0;border-top:1px dashed #ddd4e5}
#hanzi-target{position:absolute;inset:0}
#hanzi-target::before{content:"";position:absolute;inset:0 50% 0 auto;border-left:1px dashed #ddd4e5;pointer-events:none}
#hanzi-target svg{display:block;position:relative;touch-action:none}
#hanzi-user-ink{position:absolute;top:0;left:0;pointer-events:none;z-index:2}
#hanzi-user-ink path{fill:none;stroke:#d18128;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;opacity:.5}
.hanzi-feedback{text-align:center;min-height:48px;font-size:13px;line-height:1.7;color:var(--purple);margin:16px 0 12px;overflow-wrap:anywhere}
.hanzi-results{margin:0 0 18px;padding:16px;background:#f8f6fc;border:1px solid #e7e0ef;border-radius:14px}
.hanzi-result-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:0;text-align:center}
.hanzi-result-metrics dt{font-size:12px;color:var(--muted)}
.hanzi-result-metrics dd{margin:5px 0 0;font-size:24px;font-weight:600;color:var(--purple);overflow-wrap:anywhere}
.hanzi-result-metrics .hanzi-record{grid-column:1/-1;border-top:1px solid #e7e0ef;padding-top:12px}
.hanzi-record dd{font-size:18px}.hanzi-record small{display:block;font-size:12px;font-weight:400;color:var(--purple);margin:5px 0 0}
.hanzi-result-explanation{font-size:11px;line-height:1.6;color:var(--muted);margin:12px 0 0;text-align:center}
.hanzi-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:6px}
.hanzi-actions .button,.hanzi-pagination .button{font-size:12px;min-height:42px;padding:10px 12px}
.hanzi-outline{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:9px;margin:16px 0 22px;font-size:12px;color:var(--muted)}
.hanzi-outline input{width:17px;height:17px;accent-color:var(--purple)}
.hanzi-pagination{display:flex;align-items:center;justify-content:space-between;gap:8px;border-top:1px solid var(--border);padding-top:18px}
.hanzi-tips{padding:20px 0;color:var(--muted);font-size:12px;line-height:1.8}
.hanzi-tips h3{font-size:21px;font-weight:500;color:var(--ink);line-height:1.5;margin:12px 0 20px}
.hanzi-tips ol{padding-left:20px;margin:0 0 18px}
.hanzi-tips li{padding-left:4px;margin-bottom:12px}
.hanzi-tip-note{border-top:1px solid var(--border);margin-top:22px;padding-top:20px;display:flex;gap:12px;align-items:flex-start}
.hanzi-tip-note>span{font-size:34px;color:#c2b0cd;line-height:1.2}
#hanzi-empty{line-height:1.8;margin-top:12px}
@media(max-width:1250px){.hanzi-layout{grid-template-columns:210px minmax(280px,1fr)}.hanzi-tips{grid-column:1/-1;padding:4px 0}.hanzi-tips h3 br{display:none}.hanzi-tips ol{display:flex;flex-wrap:wrap;gap:8px 30px}.hanzi-tip-note{display:none}}
@media(max-width:820px){.hanzi-view{padding:20px}.hanzi-layout{gap:14px;grid-template-columns:180px minmax(0,1fr)}.hanzi-catalog,.hanzi-practice{padding:16px}.hanzi-intro h2{font-size:21px}.hanzi-intro{gap:15px}.hanzi-progress{padding:12px 16px}.hanzi-pagination{flex-wrap:wrap}.hanzi-pagination .field-hint{order:3;width:100%;text-align:center}}
@media(max-width:650px){.hanzi-view{padding:16px}.hanzi-intro{align-items:stretch;flex-direction:column;gap:14px;margin-bottom:16px}.hanzi-intro h2{font-size:21px}.hanzi-progress{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:12px 16px}.hanzi-progress b{font-size:22px}.hanzi-progress small{width:100%;margin:0}.hanzi-layout{display:flex;flex-direction:column}.hanzi-catalog,.hanzi-practice,.hanzi-tips{width:100%}.hanzi-catalog{padding:14px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}.hanzi-catalog label{margin:0;font-size:11px}.hanzi-catalog input,.hanzi-catalog select{font-size:16px;padding:10px 8px}.hanzi-character-list{grid-column:1/-1;grid-template-columns:repeat(5,minmax(0,1fr));max-height:170px;overflow:auto;padding:3px}.hanzi-character{min-height:66px}.hanzi-catalog #hanzi-empty{grid-column:1/-1}.hanzi-character-heading{margin-bottom:16px}.hanzi-practice{padding:16px 12px}.hanzi-actions .button,.hanzi-pagination .button{min-height:44px}.hanzi-outline{min-height:44px;margin:8px 0 16px}.hanzi-feedback{min-height:44px}.hanzi-tips{padding:8px}.hanzi-tips h3{margin-bottom:14px}.hanzi-tips ol{display:block}}

/* Vocabulary sets, with classroom sharing and printable writing sheets. */
.dictionary-view{padding:26px 28px}
.dictionary-layout{display:grid;grid-template-columns:220px minmax(0,1fr);gap:26px;max-width:1340px;margin:auto;align-items:start}
.dictionary-sidebar{min-width:0;background:var(--paper);border:1px solid var(--border);border-radius:16px;padding:18px}
.dictionary-sidebar>.button{font-size:12px;min-height:44px}
.dictionary-sidebar-heading{display:flex;align-items:center;justify-content:space-between;gap:6px;margin:18px 0 8px}
.dictionary-sidebar .eyebrow{font-size:9px;letter-spacing:.9px;display:block;line-height:1.6}
.dictionary-set-list{display:grid;gap:5px;margin:8px 0 22px}
.dictionary-set-list>.field-hint{font-size:12px;line-height:1.8;padding:5px}
.dictionary-set{display:flex;flex-direction:column;gap:5px;background:transparent;border:1px solid transparent;border-radius:10px;padding:11px 12px;text-align:left;min-height:58px;min-width:0}
.dictionary-set span{font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.dictionary-set small{font-size:11px;color:var(--muted)}
.dictionary-set.active{background:var(--lavender);border-color:#ddd4ed;color:var(--purple)}
.dictionary-set:hover{background:#f5f2fa}
.dictionary-set:focus-visible{outline:2px solid var(--purple);outline-offset:2px}
.dictionary-privacy{font-size:11px;color:var(--muted);line-height:1.8;border-top:1px solid var(--border);padding-top:15px}
.dictionary-main{min-width:0}
.dictionary-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:24px}
.dictionary-heading>div:first-child{min-width:0}
.dictionary-heading h2{font-size:26px;font-weight:500;line-height:1.5;margin:8px 0 6px;overflow-wrap:anywhere}
.dictionary-heading p{font-size:13px;line-height:1.8;color:var(--muted);white-space:pre-line;overflow-wrap:anywhere}
.dictionary-heading-actions{display:flex;align-items:center;gap:7px;flex:none;margin-top:12px}
.dictionary-heading-actions .button{font-size:12px;min-height:44px;white-space:nowrap}
.dictionary-tabs{display:flex;gap:6px;border-bottom:1px solid var(--border);padding-bottom:12px;margin-bottom:22px}
.dictionary-tabs button{border:0;border-radius:9px;background:transparent;padding:11px 16px;font-size:13px;min-height:44px;color:var(--muted)}
.dictionary-tabs button.active{background:var(--lavender);color:var(--purple)}
.dictionary-tools{display:flex;gap:9px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.dictionary-tools label{flex:1;min-width:170px;margin:0}
.dictionary-tools input{font-size:13px;min-height:44px}
.dictionary-tools .button{font-size:12px;min-height:44px}
#dictionary-feedback:empty{display:none}
#dictionary-feedback{font-size:12px;line-height:1.8;margin-bottom:18px}
#dictionary-word-count{font-size:12px;margin-bottom:14px}
.dictionary-word-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
.dictionary-word{display:flex;flex-direction:column;justify-content:space-between;gap:18px;border:1px solid var(--border);border-radius:14px;padding:20px 18px;background:var(--paper);min-width:0}
.dictionary-word-chinese{display:block;font-family:"Kaiti SC","STKaiti","KaiTi",serif;font-size:38px;color:var(--purple);line-height:1.4;overflow-wrap:anywhere}
.dictionary-word-pinyin{display:block;font-size:14px;margin:6px 0 12px;color:#7f6ba1}
.dictionary-word-main p{font-size:13px;line-height:1.7;overflow-wrap:anywhere;color:var(--muted)}
.dictionary-word-actions{display:flex;align-items:center;gap:5px;border-top:1px solid var(--border);padding-top:14px}
.dictionary-word-actions .button{font-size:12px;min-height:40px;padding:9px 13px;margin-right:auto}
.dictionary-word-empty{padding:50px 16px;color:var(--muted);font-size:13px;line-height:1.8;text-align:center}
.dictionary-modal textarea,.dictionary-modal select{font:inherit;color:var(--ink);width:100%;padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--paper)}
.dictionary-modal textarea{resize:vertical}
.dictionary-modal .field-hint{font-size:12px;line-height:1.7;font-weight:400}
#dictionary-pinyin-button{margin:-5px 0 20px;font-size:12px}
.dictionary-view .hanzi-layout{grid-template-columns:175px minmax(0,1fr);gap:18px}
.dictionary-view .hanzi-tips{display:none}
.dictionary-view .hanzi-intro{gap:14px;align-items:flex-start}
.dictionary-view .hanzi-intro h2{font-size:19px;margin-top:8px}
.dictionary-view .hanzi-intro .eyebrow{font-size:9px;letter-spacing:1px}
.dictionary-view .hanzi-intro p{font-size:12px}
.dictionary-view .hanzi-progress{padding:12px 14px}
.dictionary-view .hanzi-progress b{font-size:22px}
@media(max-width:1250px){.dictionary-word-list{grid-template-columns:repeat(2,minmax(0,1fr))}.dictionary-layout{grid-template-columns:190px minmax(0,1fr);gap:18px}.dictionary-view{padding:20px}.dictionary-sidebar{padding:14px}.dictionary-view .hanzi-layout{grid-template-columns:145px minmax(0,1fr);gap:12px}.dictionary-view .hanzi-catalog{padding:12px}.dictionary-view .hanzi-intro{flex-direction:column}.dictionary-view .hanzi-progress{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.dictionary-view .hanzi-progress small{margin:0}}
@media(max-width:950px){.dictionary-layout{grid-template-columns:165px minmax(0,1fr);gap:14px}.dictionary-word-list{grid-template-columns:1fr}.dictionary-heading{flex-direction:column;gap:4px}.dictionary-heading-actions{margin-top:6px}.dictionary-view .hanzi-layout{display:flex;flex-direction:column}.dictionary-view .hanzi-catalog,.dictionary-view .hanzi-practice{width:100%}.dictionary-view .hanzi-catalog{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}.dictionary-view .hanzi-catalog label{margin:0}.dictionary-view .hanzi-character-list{grid-column:1/-1;grid-template-columns:repeat(6,minmax(0,1fr));max-height:156px;overflow:auto;padding:3px}}
@media(max-width:650px){.dictionary-view{padding:16px}.dictionary-layout{display:flex;flex-direction:column;gap:20px}.dictionary-sidebar{width:100%;padding:14px}.dictionary-sidebar>.button{width:auto;min-width:150px}.dictionary-sidebar-heading{margin-top:14px}.dictionary-set-list{display:flex;gap:8px;overflow:auto;margin:8px 0 16px;padding:3px;scrollbar-width:thin}.dictionary-set{min-width:145px;max-width:210px;flex:none;border-color:var(--border);min-height:62px;padding:9px 12px}.dictionary-set-list>.field-hint{padding:0}.dictionary-privacy{font-size:11px;padding-top:10px}.dictionary-main{width:100%}.dictionary-heading h2{font-size:23px}.dictionary-heading{gap:8px;margin-bottom:18px}.dictionary-tabs{margin-bottom:16px}.dictionary-tools label{min-width:100%;max-width:none}.dictionary-tools input,.dictionary-modal input,.dictionary-modal textarea,.dictionary-modal select{font-size:16px}.dictionary-word-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.dictionary-word{padding:16px 12px;gap:13px}.dictionary-word-chinese{font-size:32px}.dictionary-word-pinyin{font-size:13px}.dictionary-word-main p{font-size:12px}.dictionary-word-actions{flex-wrap:wrap;gap:3px;padding-top:10px}.dictionary-word-actions .button{width:100%;min-height:44px}.dictionary-word-actions .icon-button{width:44px;height:44px}.dictionary-view .hanzi-character-list{grid-template-columns:repeat(5,minmax(0,1fr))}.dictionary-view .hanzi-catalog input,.dictionary-view .hanzi-catalog select{font-size:16px}.dictionary-view .hanzi-intro{margin-bottom:16px}.dictionary-view .hanzi-progress small{width:100%}}
.dictionary-sidebar-top{display:flex;align-items:center;gap:8px}
.dictionary-sidebar-top>.button{font-size:12px;min-height:44px}
@media(max-width:650px){.dictionary-sidebar.is-collapsed #dictionary-set-browser{display:none}.dictionary-sidebar-top>#dictionary-create-set{width:auto;flex:1}.dictionary-sidebar-top>#dictionary-toggle-sets{flex:none;white-space:nowrap;font-size:12px;padding:10px 13px}}

/* Set overview and a single editor for bulk word entry. */
.dictionary-overview{max-width:1200px;margin:auto}
.dictionary-overview-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:24px}
.dictionary-overview-heading h2{font-size:28px;font-weight:500;line-height:1.5;margin:8px 0}
.dictionary-overview-heading p{font-size:13px;line-height:1.8;color:var(--muted)}
.dictionary-overview-actions{display:flex;flex-wrap:wrap;gap:10px;flex:none;margin-top:12px}
.dictionary-overview-actions .button{font-size:12px;min-height:44px}
.dictionary-set-search{max-width:500px;margin-bottom:24px}
.dictionary-set-search input{font-size:13px;min-height:44px}
.dictionary-set-group{margin:26px 0}
.dictionary-set-group h3{font-size:16px;font-weight:500;margin-bottom:16px}
.dictionary-set-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.dictionary-set-card{background:var(--paper);border:1px solid var(--border);border-radius:14px;padding:22px;display:flex;flex-direction:column;justify-content:space-between;gap:20px;min-width:0}
.dictionary-set-card h4{font-size:20px;font-weight:500;line-height:1.5;margin:8px 0;overflow-wrap:anywhere}
.dictionary-set-card p{font-size:13px;color:var(--muted);line-height:1.8;white-space:pre-line;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.dictionary-set-card small{display:block;margin-top:14px;color:var(--muted);font-size:12px}
.dictionary-set-card-actions{display:flex;gap:8px;flex-wrap:wrap;border-top:1px solid var(--border);padding-top:16px}
.dictionary-set-card-actions .button{font-size:12px;min-height:42px;padding:10px 13px}
.dictionary-back{margin-bottom:22px;font-size:12px;min-height:44px}
.dictionary-heading-actions{flex-wrap:wrap;flex:0 1 auto;min-width:0;max-width:100%}
#dictionary-home-feedback:empty{display:none}
#dictionary-home-feedback{font-size:12px;line-height:1.8;margin-bottom:20px}
.dictionary-set-modal{max-width:900px;width:calc(100vw - 32px)}
.dictionary-set-meta{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 18px}
.dictionary-set-meta label{min-width:0}
.dictionary-bulk{border:1px solid var(--border);border-radius:12px;background:#faf9fc;padding:16px;margin:4px 0 22px}
.dictionary-bulk label{margin-bottom:9px;font-size:13px}
.dictionary-bulk textarea{min-height:110px;margin-bottom:10px;line-height:1.7}
.dictionary-bulk .field-hint{margin:8px 0 12px}
.dictionary-bulk .field-hint:last-child{margin-bottom:0}
.dictionary-bulk .button{font-size:12px;min-height:42px}
.dictionary-draft-heading{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.dictionary-draft-heading h3{font-size:16px;font-weight:500}
.dictionary-draft-table-wrap{max-height:370px;overflow:auto;scrollbar-width:thin;border:1px solid var(--border);border-radius:10px}
.dictionary-draft-table{border-collapse:collapse;width:100%;table-layout:fixed;font-size:12px}
.dictionary-draft-table th{position:sticky;top:0;z-index:1;text-align:left;background:#f8f6fb;padding:12px 10px;color:var(--muted);font-weight:500}
.dictionary-draft-table th:nth-child(1){width:22%}.dictionary-draft-table th:nth-child(2){width:28%}.dictionary-draft-table th:last-child{width:44px}
.dictionary-draft-table td{padding:7px 5px;border-top:1px solid var(--border);vertical-align:top;overflow-wrap:anywhere}
.dictionary-draft-table input{width:100%;padding:9px 8px;min-height:40px;font-size:13px}
.dictionary-draft-table input[lang=zh]{font-size:18px}
.dictionary-draft-table td:last-child{padding:6px 2px;text-align:center}
.dictionary-draft-invalid{background:#fff6f5}
.dictionary-draft-invalid input[lang=zh]{border-color:#cc807e}
.dictionary-draft-error{display:block;color:#a84947;line-height:1.7;margin:6px 4px;font-size:11px}
#dictionary-draft-empty{padding:22px 14px;line-height:1.8}
.dictionary-draft-actions{display:flex;flex-wrap:wrap;gap:8px;margin:14px 0}
.dictionary-draft-actions .button{font-size:12px;min-height:42px}
#dictionary-draft-status:empty{display:none}
#dictionary-draft-status{line-height:1.8;margin:12px 0 18px}
@media(max-width:1100px){.dictionary-overview-heading{flex-direction:column;gap:6px}.dictionary-overview-actions{margin-top:6px}.dictionary-set-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){.dictionary-overview-heading h2{font-size:24px}.dictionary-overview-heading{margin-bottom:18px}.dictionary-overview-actions{width:100%}.dictionary-overview-actions .button{flex:1;white-space:nowrap;font-size:11px;padding:10px}.dictionary-set-search{max-width:none}.dictionary-set-search input{font-size:16px}.dictionary-set-cards{grid-template-columns:1fr;gap:12px}.dictionary-set-card{padding:18px}.dictionary-set-card h4{font-size:20px}.dictionary-set-group{margin:22px 0}.dictionary-set-modal{width:calc(100vw - 20px);padding:22px 16px}.dictionary-set-meta{grid-template-columns:1fr;gap:0}.dictionary-bulk{padding:12px}.dictionary-draft-heading{align-items:flex-start}.dictionary-draft-heading .field-hint{font-size:11px}.dictionary-draft-table,.dictionary-draft-table tbody{display:block;width:100%}.dictionary-draft-table thead{display:none}.dictionary-draft-table tr{display:grid;grid-template-columns:minmax(0,1fr) 44px;padding:10px 5px;border-top:1px solid var(--border)}.dictionary-draft-table tr:first-child{border-top:0}.dictionary-draft-table td{grid-column:1;border:0;padding:5px;min-width:0}.dictionary-draft-table td[data-label]::before{content:attr(data-label);display:block;color:var(--muted);font-size:11px;margin-bottom:4px}.dictionary-draft-table td:last-child{grid-column:2;grid-row:1/4;padding-top:25px}.dictionary-draft-table input{font-size:16px;min-height:44px}.dictionary-draft-table .icon-button{width:44px;height:44px}.dictionary-draft-table-wrap{max-height:400px}.dictionary-draft-actions .button{min-height:44px}.dictionary-heading-actions .button{white-space:normal}}
.dictionary-overview-tools{display:flex;gap:12px;align-items:center;margin-bottom:22px}
.dictionary-overview-tools .dictionary-set-search{flex:1;margin:0}
.dictionary-overview-tools .button{font-size:12px;min-height:44px}
@media(max-width:650px){.dictionary-overview-tools{flex-wrap:wrap;gap:8px}.dictionary-overview-tools .dictionary-set-search{min-width:100%;max-width:none}}
.build-version{display:block;border:0;background:transparent;color:var(--muted);font:inherit;font-size:11px;line-height:1.6;min-height:36px;padding:6px 0;cursor:pointer;text-align:left;text-decoration:underline;text-underline-offset:4px}
.build-version:hover{color:var(--purple)}
.build-version:focus-visible{outline:2px solid var(--purple);outline-offset:3px;border-radius:4px}
.sidebar .build-version{color:#c8c0de;margin:4px 0}
.sidebar .build-version:hover{color:white}
.changelog-modal{width:calc(100vw - 32px);max-width:620px;max-height:85dvh;overflow:auto}
.changelog-release{padding:20px 0;border-top:1px solid var(--border);overflow-wrap:anywhere}
.changelog-release h3{font-size:16px;line-height:1.6;margin:0 0 5px}
.changelog-release p{font-size:12px;color:var(--muted);margin:0 0 12px}
.changelog-release ul{padding-left:20px;margin:0;font-size:13px;line-height:1.8}
.changelog-release li+li{margin-top:8px}

/* Clear reading hierarchy and reliable touch targets. */
:root{font-size:15px}
.button{min-height:44px}.icon-button{width:44px;height:44px}
.eyebrow{font-size:12px;letter-spacing:1px}
input::placeholder,textarea::placeholder{color:#70707e;opacity:1}
.field-hint,.dictionary-modal .field-hint{font-size:13px;line-height:1.65}
.dictionary-view p,.dictionary-word-main p,.dictionary-heading p,.dictionary-set-card p,.dictionary-overview-heading p{font-size:15px;line-height:1.65}
.dictionary-view .button,.dictionary-modal .button{font-size:14px;min-height:44px}
.dictionary-view .eyebrow{font-size:12px}
.dictionary-layout{display:block;max-width:1120px}
.dictionary-sidebar,.dictionary-tabs{display:none}
.dictionary-heading{align-items:center}.dictionary-heading-actions{margin-top:0;flex-wrap:nowrap}
.dictionary-heading h2{font-size:26px}.dictionary-back{margin-bottom:14px}
.dictionary-set-menu{position:relative;flex:none}
.dictionary-set-menu>summary{list-style:none;display:grid;place-items:center;border:1px solid var(--border);border-radius:11px;width:44px;height:44px;font-size:25px;line-height:1;cursor:pointer;background:white}
.dictionary-set-menu>summary::-webkit-details-marker{display:none}
summary:focus-visible{outline:3px solid #a398ef;outline-offset:3px}
.dictionary-menu-items{position:absolute;right:0;top:52px;z-index:4;display:grid;gap:4px;width:210px;padding:8px;border:1px solid var(--border);border-radius:13px;background:white;box-shadow:0 10px 30px #28293720}
.dictionary-menu-items .button{justify-content:flex-start;text-align:left;border:0;background:white;white-space:normal}
.dictionary-menu-items .button:hover{background:var(--lavender)}.dictionary-menu-items .danger{color:#a33d49}
.dictionary-completeness{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 16px;flex-wrap:wrap}
.dictionary-completeness #dictionary-word-count{margin:0;font-size:14px}
.dictionary-completeness label{margin:0}.dictionary-completeness select{padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:white;color:var(--ink);min-height:44px}
.dictionary-word-list{grid-template-columns:repeat(3,minmax(0,1fr))}
.dictionary-word-pinyin{color:#695383;font-size:16px}
.dictionary-word-actions .button{min-height:44px}
.dictionary-overview-heading{margin-bottom:18px}.dictionary-overview-actions{flex:0 1 auto}
.dictionary-set-group{margin:20px 0}.dictionary-set-group h3{margin-bottom:12px;font-size:18px}
.dictionary-set-card{padding:18px;gap:12px}.dictionary-set-card h4{font-size:21px;margin:6px 0}.dictionary-set-card p{-webkit-line-clamp:2;font-size:14px}
.dictionary-set-card small{font-size:14px;margin-top:9px}.dictionary-set-card-actions{padding-top:12px}
.dictionary-practice-summary{display:block;font-size:13px;color:var(--muted);line-height:1.6;margin-top:6px}
.dictionary-resume{display:flex;justify-content:space-between;align-items:center;gap:16px;background:var(--lavender);border:1px solid #ddd4ed;border-radius:14px;padding:18px;margin-bottom:20px}
.dictionary-resume b{font-size:17px}.dictionary-resume p{margin-top:6px}
/* A focused practice screen keeps the board first. */
.is-practicing .dictionary-heading,.is-practicing .dictionary-back,.is-practicing .hanzi-intro{display:none}
.practice-heading{display:flex;align-items:center;gap:18px;margin-bottom:16px;position:relative}
.practice-heading>div{flex:1;min-width:0}.practice-heading b{display:block;overflow-wrap:anywhere;font-size:17px}.practice-heading>div>span{display:block;margin-top:3px;color:var(--muted);font-size:13px}
.practice-picker>summary{padding:12px;border:1px solid var(--border);border-radius:10px;cursor:pointer;font-size:14px;min-height:44px;list-style:none}
.practice-picker>summary::-webkit-details-marker{display:none}
#practice-picker-content{position:absolute;right:0;top:56px;width:340px;max-width:100%;z-index:3;box-shadow:0 10px 35px #28293725;border-radius:16px;background:white;max-height:55dvh;overflow:auto}
.dictionary-view #practice-picker-content .hanzi-catalog{display:block;width:100%}
.dictionary-view #practice-picker-content .hanzi-character-list{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));max-height:220px;overflow:auto}
.is-practicing .hanzi-layout{display:block;max-width:640px;margin:auto}
.is-practicing .hanzi-practice{padding:20px;max-width:640px;margin:auto}
.hanzi-word-context,.dictionary-view .hanzi-word-context{font-size:22.5px;color:var(--ink);line-height:1.6;margin:0 0 12px;text-align:center;overflow-wrap:anywhere}
.hanzi-character-heading{margin-bottom:14px}.hanzi-character-heading h3{font-size:22px}.hanzi-character-heading p{font-size:14px}
.hanzi-character-heading>div>span{font-size:48px}.hanzi-stroke-count{font-size:14px}
.hanzi-feedback{font-size:14px;min-height:24px;margin:12px 0;line-height:1.5}
.hanzi-results{padding:12px;margin-bottom:12px}.hanzi-result-metrics{grid-template-columns:1fr 1fr 1.5fr;gap:10px}
.hanzi-result-metrics dt{font-size:13px}.hanzi-result-metrics dd{font-size:22px}
.hanzi-result-metrics .hanzi-record{grid-column:auto;padding:0;border:0}.hanzi-record dd{font-size:16px}.hanzi-record small{font-size:12px}
.hanzi-result-explanation{font-size:13px;margin-top:10px}.hanzi-result-explanation summary{cursor:pointer;min-height:44px;display:grid;place-items:center}
.hanzi-result-explanation p{font-size:13px}.hanzi-actions .button,.hanzi-pagination .button{font-size:14px;min-height:44px}
.hanzi-outline{font-size:14px;margin:8px 0;min-height:44px}.hanzi-pagination{padding-top:12px}
.is-complete .hanzi-pagination{background:#f8f6fc;border-radius:10px;padding:10px;margin-top:10px}
/* The editor has one scroll area; controls remain within reach. */
.dictionary-set-modal[open]{display:flex;flex-direction:column;padding:24px;max-height:calc(100dvh - 32px)}
.dictionary-set-modal{overflow:hidden}.dictionary-set-modal .modal-top,.dictionary-set-modal>h2{flex:none}
.dictionary-set-modal>h2{font-size:24px;margin-bottom:16px}
#dictionary-set-form{overflow:auto;min-height:0;padding:3px 5px 0;scrollbar-width:thin;overscroll-behavior:contain}
.dictionary-draft-table-wrap{max-height:none;overflow:visible}
.dictionary-draft-table th{font-size:14px}.dictionary-draft-table input{font-size:15px;min-height:44px}
.dictionary-bulk>summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:600;font-size:15px}
.dictionary-bulk textarea{margin-top:10px}
.dictionary-editor-footer{position:sticky;bottom:0;background:white;border-top:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0 3px;margin-top:18px;z-index:2}
.dictionary-editor-footer>div{display:flex;flex-direction:column;align-items:flex-start;min-width:0}
#dictionary-autosave{font-size:13px;color:var(--muted);line-height:1.5}
#dictionary-discard-draft{border:0;padding:6px 0;font-size:13px}
.dictionary-editor-footer>.button{flex:none}
.lesson-card{gap:12px;padding:20px}.lesson-card-description{font-size:15px}.lesson-card-description p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.lesson-card-homework{border:0;padding:0;background:none;margin:0}.lesson-card-homework .lesson-status{font-size:13px}.lesson-status.done{color:#3f7051}
.lesson-card-title{font-size:20px}.lesson-card-materials,.lesson-card-chinese{font-size:14px}
.lesson-card-footer .button,.lessons-tools .button,.lesson-filters button{font-size:14px;min-height:44px}
/* Reading text in chat, files and shared navigation. */
.message-bubble,.translation-text,.file-details p{font-size:15px;line-height:1.65}
.pinyin{color:#705b8a;font-size:14px}.message-time,.message-you,.edited-note,.file-details small{font-size:12px;color:var(--muted)}
.message-status,.composer-hint,.character-count{font-size:12px;color:var(--muted)}
.translation-indicator,.view-options,.language-select select{font-size:13px;color:var(--muted)}
.message-menu-trigger{width:44px;height:44px;opacity:1;color:var(--muted)}
.sidebar .space-nav:not(.active){opacity:1}.sidebar .space-nav small{color:#bcb9ca}.sidebar .eyebrow{color:#bcb9ca}
.build-version{font-size:13px;min-height:44px}.profile .icon-button{width:44px}
@media(max-width:950px){.dictionary-word-list{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:650px){
 .icon-button,.header-actions .icon-button,.header-actions .button,.view-options>.icon-button{width:44px;height:44px;min-height:44px}
 .chat-header{min-height:80px;padding:12px 10px;gap:4px}.chat-title{min-width:0;flex:1}.chat-title h1{font-size:21px}.header-actions{gap:0}.chat-title>.eyebrow{font-size:11px}
 .chat-toolbar{flex-wrap:wrap;gap:4px;padding:8px 14px}.translation-indicator{max-width:none;flex:1;font-size:12px}.view-options{gap:12px;font-size:13px}.toggle-label{min-height:44px}
 .send-controls .button{min-height:44px}.language-select select{min-height:44px;font-size:13px;max-width:170px}
 .dictionary-view{padding:14px}.dictionary-layout{display:block}.dictionary-heading{align-items:flex-start;gap:12px}.dictionary-heading-actions{width:100%}.dictionary-heading-actions>#dictionary-train-set{flex:1}
 .dictionary-overview-heading h2{font-size:26px}.dictionary-overview-actions{display:grid;grid-template-columns:1fr;width:100%}.dictionary-overview-actions .button{font-size:14px}
 .dictionary-set-cards{grid-template-columns:1fr}.dictionary-set-card{padding:16px}.dictionary-set-card-actions{flex-wrap:nowrap}.dictionary-set-card-actions .button{flex:1;font-size:14px}
 .dictionary-resume{flex-wrap:wrap}.dictionary-resume>.button{width:100%}
 .dictionary-tools label{min-width:100%}.dictionary-tools input,.dictionary-completeness select{font-size:16px}
 .dictionary-word-list{grid-template-columns:repeat(2,minmax(0,1fr))}.dictionary-word{padding:14px 10px}.dictionary-word-main p{font-size:15px}.dictionary-word-pinyin{font-size:15px}
 .practice-heading{gap:8px;flex-wrap:wrap;margin-bottom:10px}.practice-heading>.button{padding:10px;font-size:14px}.practice-heading>div{flex:1}.practice-heading b{font-size:15px}.practice-heading>div>span{font-size:12px}
 .practice-picker{width:100%}.practice-picker>summary{font-size:14px;min-height:44px;padding:10px 12px}#practice-picker-content{top:100%;width:100%;margin-top:6px}
 .is-practicing .hanzi-practice{padding:12px 10px;border-radius:12px}.hanzi-word-context{margin-bottom:8px}.hanzi-character-heading{margin-bottom:10px}.hanzi-character-heading>div>span{font-size:38px}.hanzi-character-heading h3{font-size:20px}
 .hanzi-board{max-width:min(360px,calc(100dvh - 360px));min-width:220px}.hanzi-feedback{font-size:14px;min-height:24px;margin:10px 0}.hanzi-actions{gap:5px}.hanzi-actions .button{padding:10px;font-size:13px}
 .hanzi-result-metrics{grid-template-columns:1fr 1fr}.hanzi-result-metrics .hanzi-record{grid-column:1/-1;border-top:1px solid #e7e0ef;padding-top:8px}.hanzi-record small{font-size:13px}
 .hanzi-pagination{flex-wrap:wrap}.hanzi-pagination .field-hint{order:0;width:auto;flex:1;text-align:center}.hanzi-pagination .button{font-size:13px;padding:10px}.hanzi-pagination .button:last-child{margin-left:auto}
 .dictionary-set-modal[open]{width:100%;max-width:none;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;padding:12px 14px max(0px,env(safe-area-inset-bottom))}
 .dictionary-set-modal>h2{font-size:22px;margin-bottom:12px}#dictionary-set-form{padding:2px 2px 0}.dictionary-set-meta{display:block}.dictionary-set-meta label{font-size:14px}
 .dictionary-draft-table tr{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px;gap:4px;padding:8px 4px}.dictionary-draft-table td{grid-column:auto;padding:3px;min-width:0}.dictionary-draft-table td:nth-child(3){grid-column:1/3}.dictionary-draft-table td:last-child{grid-column:3;grid-row:1/3;padding:17px 0 0}.dictionary-draft-table td[data-label]::before{font-size:13px}.dictionary-draft-table input{font-size:16px}.dictionary-draft-table-wrap{max-height:none}
 .dictionary-editor-footer{gap:8px;flex-wrap:wrap;padding:10px 0 max(10px,env(safe-area-inset-bottom))}.dictionary-editor-footer>div{flex:1}#dictionary-autosave{font-size:12px}.dictionary-editor-footer>.button{font-size:14px;padding:10px 12px}
 .lesson-card{padding:17px;gap:10px}.lesson-card-description p{font-size:15px}.lesson-card-footer{gap:8px}.lesson-card-footer .button{font-size:13px;padding:10px}.lesson-card-title{font-size:20px}
}
@media(max-width:360px){.header-actions .button{width:44px}.chat-title h1{font-size:19px}.hanzi-pagination .field-hint{width:100%;order:-1}.hanzi-board{min-width:200px}.dictionary-editor-footer>.button{width:100%}}

@media(max-width:650px){
 .hanzi-board{max-width:min(320px,calc(100dvh - 460px))}
 .hanzi-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.hanzi-actions .button{padding:9px 4px;font-size:13px;gap:0}
 .hanzi-pagination{margin-top:12px}.is-complete .hanzi-actions{display:flex;justify-content:flex-start}.is-complete .hanzi-actions>button:not(#hanzi-restart){display:none}
}

.sidebar .chat-nav{font-size:14px}.sidebar .chat-nav small{font-size:12px;line-height:1.5}.sidebar-section-label{font-size:12px;color:#bcb9ca;line-height:1.6}
.class-item b{font-size:14px}.class-item small{font-size:12px}.profile-text b{font-size:14px}.profile-text small{font-size:12px;color:#bcb9ca}
@media(max-width:650px){
 .dictionary-overview-actions{grid-template-columns:1fr 1fr}.dictionary-overview-actions .button{padding:10px 8px;white-space:normal}
 .dictionary-overview-tools{flex-wrap:nowrap}.dictionary-overview-tools .dictionary-set-search{min-width:0}.dictionary-overview-tools>.button{width:44px;padding:10px;flex:none}.dictionary-overview-tools>.button>span{display:none}
}
@media(max-width:360px){.dictionary-overview-actions{grid-template-columns:1fr}}

/* Compact mode buttons: name, two counters and progress share one touch target. */
.dictionary-set-card{gap:0;padding:18px;justify-content:flex-start}
.dictionary-set-card-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.dictionary-set-card-top h4{font-size:18px;line-height:1.4;margin:0;min-width:0}
.dictionary-set-open{display:block;text-align:left;font:inherit;font-weight:500;border:0;background:transparent;padding:0;color:var(--ink);overflow-wrap:anywhere}
.dictionary-set-open:hover{color:var(--purple)}
.dictionary-set-scope{font-size:12px;line-height:1.5;color:var(--muted);white-space:nowrap;flex:none;padding-top:2px}
.dictionary-view .dictionary-set-card-meta{display:block;font-size:13px;line-height:1.5;margin:6px 0 16px;white-space:normal}
.dictionary-set-modes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:auto}
.dictionary-mode{--mode-color:var(--purple);display:block;width:100%;min-width:0;min-height:66px;padding:10px;border:1px solid var(--border);border-radius:11px;background:var(--paper);text-align:left;color:var(--ink);transition:background .12s,border-color .12s,transform .12s}
.dictionary-mode-writing{--mode-color:#327a66}
.dictionary-mode:hover:not(:disabled){background:#f5f1fc;border-color:var(--mode-color)}
.dictionary-mode-writing:hover:not(:disabled){background:#edf6f0}
.dictionary-mode:active:not(:disabled){transform:translateY(1px)}
.dictionary-mode:focus-visible{outline:3px solid var(--mode-color);outline-offset:3px}
.dictionary-mode-body{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.dictionary-mode-title{display:inline-flex;align-items:center;gap:6px;font-size:14px;font-weight:500;min-width:0}
.dictionary-mode-title>.icon{width:16px;height:16px;color:var(--mode-color);flex:none}
.dictionary-mode-counts{display:inline-flex;gap:9px;font-size:12px;line-height:1.5;white-space:nowrap;font-variant-numeric:tabular-nums}
.dictionary-mode-counts>span:first-child{color:var(--mode-color)}
.dictionary-mode-counts>span:last-child{color:#9a5e1e}
.dictionary-mode-progress{display:flex;gap:2px;height:6px;margin-top:8px}
.dictionary-mode-segment{flex:1;min-width:0;border-radius:1px;background:#e8e3ed}
.dictionary-mode-segment.is-complete{background:var(--mode-color)}
.dictionary-mode-segment.needs-repeat{background:#bc7a2e}
.dictionary-tabs{display:flex;flex-wrap:wrap}
.is-practicing .dictionary-tabs{display:none}
.dictionary-flashcards{max-width:680px;margin:auto}
.dictionary-flashcards .practice-heading{margin-bottom:20px}
#dictionary-cards-position{text-align:center;margin-bottom:12px}
.dictionary-flashcard{border:1px solid var(--border);border-radius:18px;background:var(--paper);text-align:center;padding:32px 24px;margin-bottom:16px;min-width:0}
.dictionary-flashcards .dictionary-flashcard-chinese{font-family:"Kaiti SC","STKaiti","KaiTi",serif;font-size:clamp(40px,8vw,72px);line-height:1.5;color:var(--purple);overflow-wrap:anywhere;margin:4px 0 24px}
#dictionary-card-pinyin{color:#695383;font-size:18px;margin-bottom:8px}
#dictionary-card-meaning{font-size:20px;margin-bottom:28px;white-space:pre-line;overflow-wrap:anywhere}
.dictionary-card-rating{display:flex;justify-content:center;gap:12px;flex-wrap:wrap}
.dictionary-card-rating .button{min-width:120px}
#dictionary-cards-result h3{font-size:21px;font-weight:500;margin-bottom:10px}
#dictionary-cards-result p{margin-bottom:20px;color:var(--muted)}
#dictionary-cards-status{min-height:22px;text-align:center}
@media(max-width:650px){.dictionary-set-card{padding:16px}.dictionary-mode{min-height:76px}.dictionary-tabs button{padding:10px 12px;font-size:14px}.dictionary-flashcard{padding:24px 16px}.dictionary-card-rating{gap:8px}.dictionary-card-rating .button{flex:1;min-width:0}}
@media(prefers-reduced-motion:reduce){.dictionary-mode{transition:none}}
.dictionary-scope-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:4px;border:1px solid var(--border);border-radius:13px;background:var(--paper);max-width:560px}
.dictionary-scope-tabs>button{display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;min-height:44px;padding:9px 10px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-size:14px}
.dictionary-scope-tabs>button.active{background:var(--lavender);color:var(--purple);font-weight:600}
.dictionary-scope-count{display:inline-flex;align-items:center;justify-content:center;min-width:22px;padding:1px 6px;border-radius:6px;background:#f0eef4;color:#625c70;font-size:12px;font-weight:500;font-variant-numeric:tabular-nums}
.dictionary-scope-tabs>.active .dictionary-scope-count{background:var(--purple);color:white}
.dictionary-view .dictionary-scope-hint{font-size:12px;margin:8px 0 18px;color:var(--muted)}
@media(max-width:380px){.dictionary-scope-tabs>button{gap:4px;padding:9px 4px;font-size:13px}.dictionary-scope-count{padding:1px 4px;min-width:20px;font-size:11px}}

/* Memory practice keeps the current answer concealed. */
.hanzi-hidden-character{display:inline-block;width:1em;height:1em;background:var(--ink);vertical-align:-.12em;user-select:none}
.hanzi-settings{padding:0 16px 16px}
.hanzi-settings label{display:flex;align-items:center;justify-content:flex-start;gap:10px;min-height:44px;margin:4px 0;font-size:14px;color:var(--ink)}
.hanzi-settings input{width:18px;height:18px;accent-color:var(--purple);flex:none}
.hanzi-settings .field-hint{font-size:13px;line-height:1.6;margin-top:8px;color:var(--muted)}
.hanzi-settings .hanzi-outline:has(input:disabled){color:var(--muted)}
.is-profi .hanzi-actions{display:flex;justify-content:center}

/* Vocabulary rows keep reading and both kinds of progress together. */
.dictionary-heading{margin-bottom:14px}
.dictionary-heading h2{font-size:25px;line-height:1.35;margin:4px 0}
.dictionary-heading p{font-size:14px;line-height:1.5}
.dictionary-tabs{gap:4px;margin-bottom:14px}
.dictionary-tabs button{min-height:44px;padding:9px 14px;font-size:14px}
.dictionary-tools{gap:8px;margin-bottom:10px}
.dictionary-tools label{max-width:none}
.dictionary-completeness{margin-bottom:10px;gap:8px}
.dictionary-completeness #dictionary-word-count,.dictionary-list-summary{font-size:12px;line-height:1.6;margin:0}
.dictionary-view .dictionary-list-summary{font-size:12px;line-height:1.6;margin:0 0 10px}
.dictionary-completeness select{min-height:40px;padding:8px;font-size:12px}
.dictionary-word-list{grid-template-columns:minmax(0,1fr);gap:6px}
.dictionary-word-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:12px;padding:10px 12px;border-radius:11px}
.dictionary-word-main{min-width:0}
.dictionary-word-label{display:flex;align-items:baseline;gap:6px 12px;flex-wrap:wrap}
.dictionary-word-row .dictionary-word-chinese{font-size:28px;line-height:1.25}
.dictionary-word-row .dictionary-word-pinyin{font-size:14px;line-height:1.4;margin:0;color:#705b8a}
.dictionary-word-row .dictionary-word-main p{font-size:14px;line-height:1.45;margin:3px 0 0}
.dictionary-word-progress{display:flex;align-items:stretch;gap:6px;min-width:0}
.dictionary-word-progress button{display:flex;align-items:center;justify-content:center;gap:6px;min-width:100px;min-height:44px;padding:6px 9px;font:inherit;font-size:12px;border:1px solid #ded8e8;border-radius:8px;background:#f7f4fc;color:#70568e;white-space:nowrap}
.dictionary-word-progress .icon{height:15px;width:15px;flex:none}
.dictionary-word-memory.is-known{color:#63448b;background:#eee7f7;border-color:#d4c6e5}
.dictionary-word-memory.needs-repeat{color:#935a1c;background:#fff5e7;border-color:#e8cfaa}
.dictionary-word-progress .dictionary-word-writing{display:flex;flex-direction:column;align-items:stretch;gap:5px;color:#327a66;background:#f1f7f4;border-color:#d0e2d9;min-width:114px}
.dictionary-word-writing-label{display:flex;align-items:center;justify-content:center;gap:6px;font-variant-numeric:tabular-nums}
.dictionary-word-repeat{color:#935a1c}
.dictionary-word-segments{display:flex;gap:2px;height:4px}
.dictionary-word-segment{flex:1;min-width:0;border-radius:1px;background:#dfe6e2}
.dictionary-word-segment.is-complete{background:#327a66}
.dictionary-word-segment.is-repeat{background:#bc7a2e}
.dictionary-word-progress button:hover:not(:disabled){border-color:currentColor;filter:brightness(.98)}
.dictionary-word-progress button:focus-visible,.dictionary-character:focus-visible{outline:3px solid var(--purple);outline-offset:2px}
.dictionary-word-row .dictionary-word-actions{flex-wrap:nowrap;gap:0;border:0;padding:0}
.dictionary-word-row .dictionary-word-actions .icon-button{width:44px;height:44px;min-height:44px}
.dictionary-character-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:8px}
.dictionary-character{display:flex;align-items:center;gap:10px;min-width:0;min-height:66px;text-align:left;padding:9px 12px;border:1px solid var(--border);border-radius:10px;background:var(--paper);color:var(--ink)}
.dictionary-character:hover{border-color:var(--purple);background:#faf8fd}
.dictionary-character-glyph{font-family:"Kaiti SC","STKaiti","KaiTi",serif;font-size:30px;line-height:1.2;color:var(--purple);flex:none}
.dictionary-character-info{display:flex;flex-direction:column;gap:3px;flex:1;min-width:0;font-size:14px;color:#705b8a}
.dictionary-character-info small{font-size:12px;line-height:1.5;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dictionary-character-status{display:grid;place-items:center;flex:none;width:22px;height:22px;border-radius:7px;background:#f1eef5;font-size:14px;color:#898193}
.dictionary-character.is-complete .dictionary-character-status{color:#327a66;background:#e6f1eb}
.dictionary-character.is-repeat .dictionary-character-status{color:#935a1c;background:#fff0d9}
.dictionary-view #practice-picker-content .hanzi-character-list{gap:5px;padding:3px}
.dictionary-view #practice-picker-content .hanzi-character{min-height:54px;padding:5px 2px;border-radius:8px}
.dictionary-view #practice-picker-content .hanzi-character>span{font-size:25px;line-height:1.2}
.dictionary-view #practice-picker-content .hanzi-character small{font-size:12px;margin-top:3px}
.dictionary-view #practice-picker-content .hanzi-character b{top:3px;right:4px;font-size:11px;color:#898193}
.dictionary-view #practice-picker-content .hanzi-character.is-complete b{color:#327a66}
.dictionary-view #practice-picker-content .hanzi-character.is-repeat b{color:#935a1c}
.dictionary-view #practice-picker-content .hanzi-character.is-repeat{border-color:#e5ccab;background:#fff8ee}
.dictionary-view #practice-picker-content .hanzi-character.active{border-color:var(--purple);box-shadow:0 0 0 1px var(--purple)}
#hanzi-list-progress{grid-column:1/-1;font-size:12px;line-height:1.5;margin:0 0 8px}
@media(max-width:950px){.dictionary-word-row{gap:8px}.dictionary-word-progress button{min-width:88px}.dictionary-word-progress .dictionary-word-writing{min-width:110px}}
@media(max-width:650px){
 .dictionary-heading{gap:8px;margin-bottom:12px}.dictionary-heading h2{font-size:23px}.dictionary-heading p:empty{display:none}
 .dictionary-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px}.dictionary-tabs button{font-size:12px;padding:9px 2px}
 .dictionary-tools{flex-wrap:nowrap}.dictionary-tools label{min-width:0}.dictionary-tools input{padding:10px;font-size:16px}.dictionary-tools .button{font-size:12px;padding:10px;width:44px;height:44px;flex:none}.dictionary-tool-label{display:none}
 .dictionary-completeness{align-items:flex-start}.dictionary-completeness #dictionary-word-count{flex:1}.dictionary-completeness select{max-width:132px;font-size:12px}
 .dictionary-word-row{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:9px 10px}
 .dictionary-word-row .dictionary-word-chinese{font-size:27px}.dictionary-word-row .dictionary-word-pinyin{font-size:13px}.dictionary-word-row .dictionary-word-main p{font-size:13px}
 .dictionary-word-progress{grid-column:1/-1;grid-row:2}.dictionary-word-progress button{flex:1;min-width:0}.dictionary-word-progress .dictionary-word-writing{min-width:0}
 .dictionary-word-row .dictionary-word-actions{grid-column:2;grid-row:1;align-self:start}
 .dictionary-word-row .dictionary-word-actions .icon-button{width:40px}
 .dictionary-character-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 .dictionary-character{gap:7px;min-height:62px;padding:8px}.dictionary-character-glyph{font-size:28px}.dictionary-character-info{font-size:13px}.dictionary-character-info small{font-size:11px}.dictionary-character-status{width:18px;height:20px;font-size:12px}
}

/* Invitations: a scannable class card and a link with the code already included. */
.invite-modal{max-width:660px;padding:30px;border-radius:26px;background:var(--paper)}
.invite-modal .modal-top{margin:-6px -8px 14px 0;gap:12px}
.invite-modal .modal-top .eyebrow{color:var(--purple);font-size:9px;letter-spacing:1.2px;line-height:1.8}
.invite-modal h2{font-size:29px;line-height:1.2;letter-spacing:-1px;margin:0 0 12px;max-width:480px}
.invite-modal>#invite-description{font-size:13px;line-height:1.7;margin-bottom:22px}
.invite-class{display:flex;align-items:center;gap:12px;padding:14px 16px;background:#f8f7fc;border:1px solid #eeebf5;border-radius:14px;margin-bottom:22px;min-width:0}
.invite-class-icon{display:grid;place-items:center;flex:none;width:40px;height:40px;border-radius:12px;background:var(--lavender);color:var(--purple)}
.invite-class>div{min-width:0;display:flex;flex-direction:column;gap:5px}
.invite-class>div>span{font-size:8px;letter-spacing:1.3px;color:var(--muted);font-weight:600}
.invite-class b{font-size:14px;font-weight:600;overflow-wrap:anywhere;line-height:1.4}
.invite-layout{display:grid;grid-template-columns:240px minmax(0,1fr);gap:26px;align-items:center}
.invite-qr-card{margin:0;padding:12px 12px 18px;border:1px solid #e7e2f3;border-radius:20px;background:linear-gradient(145deg,#f5f2ff,#faf9fc);text-align:center}
.invite-qr{display:grid;place-items:center;aspect-ratio:1;background:#fff;border-radius:12px;color:var(--muted);font-size:12px;line-height:1.8;overflow:hidden}
.invite-qr>svg{display:block;width:100%;height:auto}
.invite-qr:has(svg){padding:4px}
.invite-qr:not(:has(svg)){padding:20px}
.invite-qr-card figcaption{display:flex;flex-direction:column;gap:6px;margin-top:14px;line-height:1.5}
.invite-qr-card figcaption b{font-size:11px;font-weight:600}
.invite-qr-card figcaption span{font-size:10px;color:var(--muted)}
.invite-share{min-width:0}
.invite-share .invite-link-label{font-size:15px;font-weight:600;margin:0;display:block}
.invite-share-hint{font-size:12px;line-height:1.7;color:var(--muted);margin:8px 0 14px}
.invite-share .invite-link{width:100%;height:42px;min-width:0;background:#faf9fc;border:1px solid var(--border);border-radius:10px;padding:10px 12px;font-size:12px;color:var(--muted);text-overflow:ellipsis;margin:0 0 10px}
.invite-share .button{font-size:12px;min-height:44px;padding:10px 12px}
.invite-share .button .icon{width:17px;height:17px}
.invite-divider{display:flex;align-items:center;gap:9px;margin:22px 0 12px;color:var(--muted);font-size:10px;white-space:nowrap}
.invite-divider:before,.invite-divider:after{content:"";height:1px;background:var(--border);flex:1}
.invite-code-row{display:flex;align-items:center;justify-content:space-between;gap:4px;padding:6px 8px 6px 12px;background:var(--lavender);border:1px solid #e4dff7;border-radius:11px}
.invite-code-row .invite-code{font-size:16px;font-weight:600;letter-spacing:1px;line-height:1.5;background:none;margin:0;padding:0;border-radius:0;white-space:nowrap}
.invite-code-row .icon-button{color:var(--purple);width:34px;height:34px}
.invite-code-row .icon{width:17px;height:17px}
.invite-manual-hint{font-size:10px;line-height:1.6;color:var(--muted);text-align:center;margin-top:8px}
.invite-modal>.invite-status{display:flex;align-items:center;justify-content:center;gap:8px;background:#f2f7f3;color:#4d7059;padding:10px 12px;border-radius:10px;font-size:11px;line-height:1.6;margin:22px 0 0;text-align:center}
.invite-status:before{content:"";width:6px;height:6px;background:#6b987b;border-radius:50%;flex:none}
.invite-modal>.invite-status.inactive{background:#fff5e9;color:#88612e}
.invite-status.inactive:before{background:#b98a4c}
.invite-modal .invite-rotation{border-top:1px solid var(--border);margin-top:20px;padding-top:0;text-align:left}
.invite-rotation summary{display:flex;align-items:center;gap:9px;cursor:pointer;list-style:none;padding:17px 0 0;font-size:11px;color:var(--muted);min-height:44px;border-radius:5px}
.invite-rotation summary::-webkit-details-marker{display:none}
.invite-rotation summary>.icon{width:15px;height:15px}
.invite-rotation summary>span{margin-left:auto;font-size:18px;line-height:1}
.invite-rotation[open] summary>span{transform:rotate(45deg)}
.invite-settings{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:14px;margin-top:14px}
.invite-settings>p{grid-column:1/-1;font-size:11px;line-height:1.7;margin:0}
.invite-settings label{font-size:11px;margin:0;gap:8px;min-width:0}
.invite-settings select{display:block;width:100%;min-height:42px;margin-top:8px;font-size:12px}
.invite-settings .button{font-size:11px;min-height:42px}
.invite-settings .button .icon{width:16px;height:16px}
@media(max-width:580px){
  .invite-modal{width:calc(100% - 24px);padding:22px;max-height:calc(100dvh - 24px);border-radius:22px}
  .invite-modal h2{font-size:25px;max-width:300px;letter-spacing:-.7px}
  .invite-modal>#invite-description{font-size:12px;margin-bottom:16px}
  .invite-class{margin-bottom:18px;padding:11px 12px}
  .invite-layout{grid-template-columns:minmax(0,1fr);gap:20px}
  .invite-qr-card{width:216px;max-width:100%;justify-self:center;padding:10px 10px 14px}
  .invite-qr-card figcaption{margin-top:10px;gap:4px}
  .invite-share .invite-link-label,.invite-share-hint{text-align:center}
  .invite-share-hint{margin:6px 0 12px}
  .invite-divider{margin-top:18px}
  .invite-code-row{justify-content:center;gap:12px}
  .invite-code-row .invite-code{font-size:18px}
  .invite-modal>.invite-status{margin-top:18px;font-size:10px}
  .invite-settings{grid-template-columns:minmax(0,1fr)}
  .invite-settings .button{width:100%}
}
.composer-media-tools{display:flex;align-items:center;gap:6px;margin:4px 0 8px;flex-wrap:wrap}.composer-media-tools .button{min-height:40px;padding:7px 12px;font-size:13px}.composer-media-tools>span{font-size:12px;color:var(--muted)}.composer-media-tools [aria-pressed=true]{color:#a42e47;background:#fff0f3}.media-draft{display:flex;align-items:flex-start;gap:12px;padding:10px;margin-bottom:10px;background:var(--lavender);border-radius:10px}.media-draft-content{flex:1;min-width:0}.media-draft-content>span{display:block;font-size:13px;line-height:1.5;color:var(--muted)}#media-preview img{display:block;max-width:100%;width:auto;max-height:130px;border-radius:8px;margin-bottom:6px}.message-photo{display:block;max-width:360px;margin-bottom:8px}.message-photo img{display:block;max-width:100%;width:auto;max-height:360px;border-radius:10px;object-fit:contain}.message-voice{max-width:100%}.message-bubble .original-text:empty{display:none}@media(max-width:650px){.composer-media-tools .button{min-height:44px}.composer-media-tools>span{font-size:11px}.media-draft{padding:8px}.message-voice{width:240px}.message-photo img{max-height:280px}.composer-bottom{flex-wrap:wrap;gap:4px}.composer-bottom .send-controls{margin-left:auto}}@media(max-width:360px){.composer-media-tools>span{max-width:130px}.message-voice{width:200px}}
.voice-player{--voice-progress:0%;display:flex;align-items:center;gap:12px;min-width:0;width:100%;padding:2px 0;color:var(--purple)}
.voice-player audio,#media-preview .voice-player audio{display:none}
.voice-toggle{width:46px;height:46px;flex:0 0 46px;display:grid;place-items:center;border:0;border-radius:50%;padding:0;background:var(--purple);color:white;transition:background .15s,transform .15s;touch-action:manipulation}
.voice-toggle:hover{background:var(--purple-dark)}.voice-toggle:active{transform:scale(.94)}
.voice-toggle svg{width:24px;height:24px;fill:currentColor;grid-area:1/1}.voice-play-icon{margin-left:2px}.voice-toggle .voice-pause-icon{display:none}
.is-playing .voice-toggle .voice-play-icon{display:none}.is-playing .voice-toggle .voice-pause-icon{display:block}
.voice-body{min-width:0;flex:1}.voice-wave{height:32px;position:relative;min-width:0;border-radius:5px}
.voice-wave svg{display:block;width:100%;height:32px;fill:currentColor;pointer-events:none}.voice-wave-track{opacity:.28}.voice-wave-fill{clip-path:inset(0 calc(100% - var(--voice-progress)) 0 0)}
.voice-player .voice-seek{position:absolute;inset:0;width:100%;height:100%;min-height:0;padding:0;border:0;margin:0;opacity:0;cursor:pointer;touch-action:pan-y}
.voice-seek:disabled{cursor:default}.voice-wave:has(.voice-seek:focus-visible){outline:2px solid var(--purple);outline-offset:3px}
.voice-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:23px;font-size:12px;line-height:1.2}
.voice-time{font-variant-numeric:tabular-nums;color:var(--muted)}.voice-speed{border:0;border-radius:8px;min-width:37px;min-height:26px;background:transparent;color:var(--purple);padding:4px 5px;font-size:12px;font-weight:650;font-variant-numeric:tabular-nums;touch-action:manipulation}.voice-speed:hover{background:#6c5bd112}
.voice-toggle:focus-visible,.voice-speed:focus-visible{outline:2px solid var(--purple);outline-offset:3px}
.is-buffering .voice-toggle{background:var(--purple-dark)}.is-buffering .voice-toggle:after{content:"";grid-area:1/1;width:32px;height:32px;border:2px solid #ffffff55;border-top-color:white;border-radius:50%;animation:voice-buffer .8s linear infinite}
.message-voice{width:280px;margin:0}.message-voice .voice-player{margin:0}#media-preview .voice-player{max-width:340px;margin:0 0 5px}
@keyframes voice-buffer{to{transform:rotate(360deg)}}
@media(max-width:650px){.message-voice{width:240px}.voice-player{gap:10px}.voice-speed{min-width:44px;min-height:30px}}
@media(max-width:360px){.message-voice{width:200px}.voice-toggle{width:42px;height:42px;flex-basis:42px}.voice-player{gap:9px}}
@media(prefers-reduced-motion:reduce){.voice-toggle{transition:none}.is-buffering .voice-toggle:after{animation:none}}

.message-bubble:has(>.message-voice){width:fit-content;max-width:100%}
.composer.composer-compact{position:relative;padding:6px;border-radius:28px;overflow:visible}
.composer-entry{display:flex;align-items:flex-end;gap:5px;min-width:0}
.composer.composer-compact textarea{flex:1;min-width:0;min-height:44px;max-height:140px;width:100%;padding:10px 3px;margin:0;font-size:16px;line-height:24px;resize:none}
.composer-action{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-height:44px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--muted);touch-action:manipulation}
.composer-action .icon{width:21px;height:21px}.composer-action:hover{background:var(--lavender)}
.composer-action.primary{background:var(--purple);color:white}.composer-action.primary:hover{background:var(--purple-dark)}.composer-action:disabled{opacity:.45;cursor:default}
.composer-action[aria-pressed=true]{background:#b24b65}.composer-action[aria-pressed=true]:hover{background:#963b51}
#composer-more[aria-expanded=true]{background:var(--lavender);color:var(--purple)}#composer-more[aria-expanded=true] .icon{transform:rotate(45deg)}
.composer-menu{position:absolute;bottom:calc(100% + 10px);left:0;z-index:6;width:min(280px,100%);padding:7px;border:1px solid var(--border);border-radius:17px;background:var(--paper);box-shadow:0 8px 28px #2829371a}
.composer-menu>button{display:flex;align-items:center;gap:12px;width:100%;min-height:44px;padding:11px 12px;border:0;border-radius:10px;background:transparent;text-align:left;font-size:14px;line-height:22px;color:var(--ink)}
.composer-menu>button .icon{flex:none;width:20px;height:20px;color:var(--purple)}.composer-menu>button:hover{background:var(--lavender)}.composer-menu>button:disabled{opacity:.45;cursor:default}
.composer-language{display:flex;flex-direction:column;gap:6px;margin:2px 0 0;padding:8px 12px 10px;color:var(--muted);font-size:12px;line-height:18px}
.composer-language select{width:100%;min-width:0;min-height:44px;padding:8px 10px;border:1px solid var(--border);border-radius:10px;background:#f7f6fa;color:var(--ink);font-size:14px}
.compact-count{display:block;padding:5px 13px 0;text-align:right;font-size:12px}
.composer-compact .media-draft{margin:4px 4px 7px;border-radius:18px}.composer-compact .media-draft-content{overflow:hidden}
@media(max-width:650px){.composer-area{padding-bottom:max(11px,env(safe-area-inset-bottom))}.composer-entry{gap:3px}.composer-language select{font-size:16px}.composer-menu{max-width:calc(100vw - 24px)}}
/* Follow the mobile visual viewport, including keyboard height and Safari panning. */
body.chat-viewport-active{overflow:hidden}
body.chat-viewport-active .workspace{position:fixed;top:calc(var(--chat-viewport-top,0px) + env(safe-area-inset-top,0px));left:env(safe-area-inset-left,0px);right:env(safe-area-inset-right,0px);height:calc(var(--chat-viewport-height,100dvh) - env(safe-area-inset-top,0px));min-height:0;margin:0;width:auto}
body.chat-viewport-active .sidebar{top:calc(var(--chat-viewport-top,0px) + env(safe-area-inset-top,0px));height:calc(var(--chat-viewport-height,100dvh) - env(safe-area-inset-top,0px))}
body.chat-keyboard-open .composer-area{padding-bottom:8px}
body.chat-viewport-active .composer-menu{max-height:calc(var(--chat-viewport-height,100dvh) - 100px);overflow-y:auto;overscroll-behavior:contain}
.chat-options{position:relative;flex:none}
.chat-options-panel{position:absolute;right:0;top:calc(100% + 8px);z-index:9;width:230px;max-width:calc(100vw - 24px);padding:7px;background:var(--paper);border:1px solid var(--border);border-radius:16px;box-shadow:0 8px 28px #2829371a}
.chat-options-panel .toggle-label{display:flex;flex-direction:row;align-items:center;justify-content:space-between;position:relative;min-height:44px;margin:0;padding:10px 12px;border-radius:10px;font-size:14px;font-weight:400;color:var(--ink)}
.chat-options-panel .toggle-label:hover{background:var(--lavender)}.chat-options-panel .toggle-track{flex:none;width:28px;height:16px}
.chat-options-panel .toggle-track:after{width:12px;height:12px}
.chat-options-search{display:flex;align-items:center;gap:11px;width:100%;min-height:44px;padding:11px 12px;margin-top:4px;border:0;border-top:1px solid var(--border);border-radius:0 0 10px 10px;background:transparent;color:var(--ink);font-size:14px;text-align:left}
.chat-options-search:hover{background:var(--lavender)}.chat-options-search .icon{width:18px;height:18px;color:var(--purple)}
.members-heading-actions{display:flex;align-items:center;gap:8px}.members-heading-actions>span{font-size:12px;color:var(--muted)}
.members-heading-actions .icon-button,.members-dialog-heading .icon-button{width:44px;height:44px;color:var(--purple)}
.members-dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}.members-dialog-heading h2{margin:0;min-width:0}.members-dialog-heading .icon-button{flex:none;background:var(--lavender);border-radius:12px}
