:root{color-scheme:dark;--bg:#141516;--panel:#202226;--panel2:#292c31;--ink:#f3f4f6;--muted:#a1a9b6;--faint:#838d9e;--line:#32363e;--blue:#8eb3ff;--solid:#517ef2;--soft:#25334f;--nav:rgba(25,27,31,.96);--radius:14px;--font:-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei UI",sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}button,input,textarea,select{font:inherit}button{cursor:pointer;color:inherit;border:0;background:none}button,input,select,textarea{touch-action:manipulation}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid var(--blue);outline-offset:3px}button:disabled{opacity:.55;cursor:default}svg.icon{height:21px;width:21px;stroke:currentColor;fill:none;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}p,h1,h2,h3{margin:0}#app{height:100dvh;display:flex;flex-direction:column;max-width:680px;margin:auto;padding-top:env(safe-area-inset-top)}.statusbar{display:none;height:48px;min-height:48px;align-items:center;justify-content:space-between;padding:0 27px;font-size:14px;font-weight:650;position:relative}.framed .statusbar{display:flex}.island{position:absolute;width:112px;height:29px;border-radius:30px;background:#08090a;top:8px;left:50%;transform:translateX(-50%)}.status-icons{display:flex;align-items:center;gap:5px}.status-icons svg{height:11px;width:14px;fill:currentColor}.status-icons svg:last-child{width:25px;height:13px}#screen{flex:1;min-height:0;overflow:auto;scrollbar-width:none;scroll-behavior:smooth}.home-indicator{height:21px;min-height:21px;display:none;position:relative;background:var(--nav)}.framed .home-indicator{display:block}.home-indicator:after{content:"";width:126px;height:5px;border-radius:8px;background:var(--ink);position:absolute;top:9px;left:50%;transform:translateX(-50%)}.topbar{padding:6px 22px 0;display:flex;align-items:center;justify-content:space-between;height:50px}.brand{display:flex;align-items:center;gap:7px;min-height:44px;padding:0;font-size:15px;font-weight:650;letter-spacing:-.4px}.brand svg{width:27px;height:18px;fill:none;stroke:var(--blue);stroke-width:3.5}.sample-pill{font-size:9px;letter-spacing:0;color:var(--muted);background:var(--panel2);padding:3px 5px;border-radius:4px;margin-left:3px;font-weight:450}.top-actions{display:flex;gap:2px}.icon-button{min-width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%}.blue{color:var(--blue)}.add-top{width:32px;height:32px;display:grid;place-items:center;background:var(--soft);border-radius:50%}.add-top svg{width:19px}.page{padding:12px 22px 23px}.page-heading{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:23px}.page-heading h1{font-size:33px;font-weight:700;line-height:1.2;letter-spacing:-1.25px}.eyebrow{font-size:11px;color:var(--faint);margin-bottom:7px}.heading-meta{font-size:12px;color:var(--muted);margin-bottom:4px}.daily-progress{display:flex;align-items:center;gap:11px;color:var(--muted);font-size:11px;margin-bottom:20px}.progress-track{height:4px;flex:1;background:var(--panel2);border-radius:5px;overflow:hidden}.progress-track>i{display:block;width:40%;height:100%;background:var(--blue);border-radius:5px}.daily-progress strong{color:var(--ink);font-weight:500}.section-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.section-title h2{font-size:17px;font-weight:650;letter-spacing:-.3px}.text-button{font-size:12px;color:var(--blue);display:inline-flex;align-items:center;gap:3px;min-height:44px;padding:0 3px}.text-button svg{height:14px;width:14px}.continue-card{background:#202b40;border:1px solid #334361;border-radius:var(--radius);padding:18px 18px 16px;overflow:hidden}.card-topline{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:#a3bbeb;margin-bottom:20px}.audio-tag{display:flex;align-items:center;gap:6px}.audio-tag svg{width:15px;height:15px}.lesson-title{font-size:27px;line-height:1.18;font-weight:570;letter-spacing:-.7px;max-width:270px;margin-bottom:9px;color:#f2f5ff}.lesson-subtitle{font-size:12px;color:#a8b8d1}.waveform{height:38px;display:flex;align-items:center;gap:4px;margin:21px 0 14px;overflow:hidden}.waveform i{height:var(--h);flex:1;border-radius:5px;background:#9ebeff;max-width:4px;opacity:.8}.waveform i:nth-child(n+15){background:#506589;opacity:.75}.card-bottom{display:flex;align-items:center;justify-content:space-between;margin-top:12px}.lesson-time{font-size:11px;color:#a9bbd9}.continue-button{display:flex;align-items:center;gap:7px;min-height:44px;border-radius:9px;background:#91b4ff;color:#132544;padding:0 16px;font-size:13px;font-weight:650}.continue-button svg{width:14px;height:14px;fill:currentColor;stroke-width:0}.practice-row{display:grid;grid-template-columns:1fr 1fr;gap:11px;margin:15px 0 16px}.practice-tile{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);text-align:left;padding:13px;display:flex;align-items:center;gap:10px;min-height:74px}.tile-icon{width:34px;height:37px;display:grid;place-items:center;color:var(--blue);flex-shrink:0}.practice-tile strong{font-size:13px;font-weight:600;display:block;margin-bottom:5px}.practice-tile small{font-size:10px;color:var(--muted)}.material-list{border-top:0}.material-row{display:flex;align-items:center;gap:12px;text-align:left;width:100%;min-height:78px;padding:10px 0;border-bottom:0}.material-art{display:grid;place-items:center;width:43px;height:48px;border-radius:9px;flex-shrink:0;background:#2b3543;color:#a8c2e7}.material-art.tan{background:#3a342c;color:#d3b896}.material-row strong{display:block;font-size:13px;font-weight:560;margin-bottom:6px}.material-row small{font-size:11px;color:var(--muted)}.row-content{flex:1;min-width:0}.chevron{color:var(--faint);width:15px!important}#nav{min-height:64px;padding:6px 12px calc(5px + env(safe-area-inset-bottom));display:flex;justify-content:space-around;gap:4px;background:var(--nav);border-top:0;backdrop-filter:blur(18px);flex-shrink:0}#nav button{flex:1;min-width:44px;min-height:50px;color:var(--faint);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;font-size:10px;position:relative}#nav button.active{color:var(--blue)}#nav button.active:before{content:"";position:absolute;top:-7px;width:22px;height:2px;background:var(--blue)}#nav button.ai-tab svg{color:var(--blue)}.light{color-scheme:light;--bg:#f4f5f8;--panel:#fff;--panel2:#e9ecf2;--ink:#202638;--muted:#727b8c;--faint:#828c9c;--line:#e4e7ed;--blue:#3569df;--solid:#3569df;--soft:#eaf0fd;--nav:rgba(251,252,254,.95);--radius:21px}.light .page-heading h1{font-size:36px;letter-spacing:-1.6px}.light .page{padding-top:15px}.light .page-heading{margin-bottom:19px}.light .daily-progress{background:var(--panel);padding:12px;border-radius:12px;margin-bottom:18px}.light .continue-card{background:#fff;border:0;padding:20px;border-radius:23px;box-shadow:0 4px 16px #253f7010}.light .card-topline{color:#7b869c;margin-bottom:19px}.light .audio-tag{color:#3f6fcc;background:#edf2ff;padding:5px 8px;border-radius:6px}.light .lesson-title{color:#26334d;font-size:28px;font-weight:600}.light .lesson-subtitle{color:#7b879a}.light .waveform{margin:18px 0 13px;height:31px}.light .waveform i{background:#6390f3}.light .waveform i:nth-child(n+15){background:#d8e3fa}.light .lesson-time{color:#7c879a}.light .continue-button{background:#3569df;color:white;border-radius:22px;padding:0 18px}.light .practice-tile{border:0;border-radius:18px;padding:12px 10px}.light .tile-icon{background:#edf2ff;border-radius:12px}.light .practice-row{gap:12px;margin-top:14px}.light .material-list{border:0;background:white;border-radius:18px;padding:0 13px}.light .material-row:last-child{border:0}.light .material-art{background:#edf2fa;color:#6087bb}.light .material-art.tan{background:#f7f0e5;color:#a57c45}.light #nav{border-top:0}.light #nav button.active:before{display:none}.light #nav button.active svg{stroke-width:2.2}.segmented{display:flex;background:var(--panel2);border-radius:10px;padding:4px;gap:3px;margin:10px 0 20px}.segmented button{flex:1;font-size:12px;min-height:44px;border-radius:7px;color:var(--muted);padding:6px}.segmented button.selected{background:var(--panel);color:var(--ink);box-shadow:0 1px 4px #00000012}.search{display:flex;align-items:center;gap:9px;background:var(--panel2);padding:0 13px;border-radius:12px;height:46px;margin:18px 0 12px;color:var(--muted)}.search input{background:none;border:0;min-width:0;flex:1;color:var(--ink);font-size:16px;width:100%}.search input::placeholder{font-size:14px;color:var(--muted)}.search .icon{width:18px}.filters{display:flex;gap:8px;margin-bottom:18px}.filters select{min-height:44px;background:var(--panel);border:1px solid var(--line);border-radius:9px;color:var(--muted);padding:0 10px;font-size:12px;min-width:0;max-width:52%}.word-list{background:var(--panel);border-radius:var(--radius);padding:0 15px}.word-row{width:100%;display:flex;align-items:center;justify-content:space-between;padding:16px 0;min-height:78px;border-bottom:0;text-align:left}.word-row:last-child{border:0}.word-row strong{display:block;font-size:21px;letter-spacing:-.4px;font-weight:550;margin-bottom:6px}.word-row small{font-size:12px;color:var(--muted)}.word-row>span{color:var(--faint)}.count-label{font-size:11px;color:var(--faint);margin-bottom:13px}.review-summary{display:flex;align-items:center;gap:20px;background:var(--panel);border-radius:var(--radius);padding:20px;margin:20px 0}.ring{height:68px;width:68px;flex-shrink:0;border-radius:50%;background:conic-gradient(var(--blue) 0 120deg,var(--panel2) 120deg);position:relative;display:grid;place-items:center}.ring:before{content:"";position:absolute;inset:5px;background:var(--panel);border-radius:50%}.ring strong{position:relative;font-size:19px;font-weight:550}.review-summary p{font-size:14px;line-height:1.8}.review-summary small{color:var(--muted);font-size:11px}.primary{display:flex;justify-content:center;align-items:center;gap:8px;width:100%;min-height:48px;border-radius:11px;color:#fff;background:var(--solid);font-size:14px;font-weight:550}.primary svg{width:17px}.review-card{margin:19px 0;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:23px 20px}.review-card .category{color:var(--blue);font-size:11px}.review-card h2{font-size:27px;line-height:1.3;font-weight:520;margin:26px 0 13px;letter-spacing:-.5px}.review-card p{font-size:13px;color:var(--muted);line-height:1.8}.review-actions{display:flex;gap:10px;margin-top:22px}.review-actions button{flex:1;min-height:44px;border:1px solid var(--line);border-radius:10px;font-size:13px}.review-actions button:last-child{color:var(--blue);background:var(--soft);border-color:transparent}.date-strip{display:flex;justify-content:space-between;gap:5px;margin:21px 0}.day{display:flex;flex-direction:column;align-items:center;gap:10px;min-width:34px;flex:1;padding:10px 0;border-radius:13px;color:var(--muted);font-size:10px}.day strong{font-size:15px;font-weight:550;color:var(--ink)}.day.today{background:var(--solid);color:#dce7ff}.day.today strong{color:#fff}.day i{height:3px;width:3px;background:var(--blue);border-radius:50%}.day.today i{background:white}.day.empty i{background:transparent}.reader-top{display:flex;align-items:center;justify-content:space-between;padding:5px 10px;height:53px;border-bottom:0;flex-shrink:0}.reader-title{text-align:center;min-width:0}.reader-title strong{font-size:13px;font-weight:550;display:block}.reader-title small{font-size:10px;color:var(--muted);display:block;margin-top:5px}.reader-layout{height:100%;display:flex;flex-direction:column}.reader-text{flex:1;min-height:0;overflow:auto;padding:10px 23px 18px;scrollbar-width:none}.reader-tabs{margin:0 0 22px}.paragraph{padding:0 0 25px}.paragraph+.paragraph{border-top:0;padding-top:25px}.sentence-number{font-size:10px;color:var(--faint);display:block;margin-bottom:11px}.english{font-family:Georgia,"Times New Roman",serif;font-size:25px;line-height:1.63;letter-spacing:-.3px;color:var(--muted)}.paragraph.current .english{color:var(--ink)}.english button{font:inherit;padding:0;color:inherit;display:inline;min-height:44px;line-height:1.5;vertical-align:baseline;border-radius:3px}.english button.focus-word{color:var(--blue);background:var(--soft);padding:0 3px}.english button.concealed{color:transparent;background:var(--panel2);user-select:none}.translation{font-size:13px;line-height:1.9;color:var(--muted);margin-top:12px}.translation mark{color:var(--blue);background:none}.reader-tools{padding:9px 20px 14px;border-top:0;background:var(--bg);flex-shrink:0}.reader-options{display:flex;align-items:center;justify-content:space-between;margin-bottom:7px;color:var(--muted);font-size:10px}.reader-options button{font-size:11px;min-height:44px;display:flex;align-items:center;gap:5px}.reader-options .icon{height:15px;width:15px}.playback-track{display:flex;align-items:center;gap:12px;font-size:10px;color:var(--faint)}.playback-track>div{height:3px;border-radius:4px;background:var(--line);flex:1}.playback-track i{height:3px;display:block;width:34%;background:var(--blue);position:relative}.playback-track i:after{content:"";width:7px;height:7px;background:var(--blue);border-radius:50%;position:absolute;right:0;top:-2px}.player{display:flex;align-items:center;justify-content:space-between;margin:12px 0}.player button{min-height:44px;min-width:44px;display:grid;place-items:center;color:var(--muted)}.player .big-play{width:53px;height:53px;border-radius:50%;background:var(--ink);color:var(--bg)}.big-play .icon{fill:currentColor;width:21px;height:21px;stroke-width:0;margin-left:3px}.play-speed{font-size:13px;font-weight:550}.record-button{display:flex;justify-content:center;align-items:center;gap:8px;min-height:45px;width:100%;background:var(--soft);color:var(--blue);border-radius:11px;font-size:13px}.reader-footnote{font-size:10px;text-align:center;color:var(--faint);margin-top:9px}.empty-state{text-align:center;padding:25px 12px;color:var(--muted);font-size:13px;line-height:1.8}.ai-mark{display:grid;place-items:center;width:65px;height:65px;background:var(--soft);color:var(--blue);border-radius:20px;margin:24px auto 18px}.ai-mark .icon{width:31px;height:31px}.ai-intro{text-align:center}.ai-intro h2{font-size:22px;margin-bottom:12px}.ai-intro p{font-size:12px;color:var(--muted);line-height:1.8;margin:0 12px 23px}.prompt{width:100%;min-height:58px;background:var(--panel);text-align:left;display:flex;align-items:center;justify-content:space-between;padding:14px 16px;margin:10px 0;border-radius:var(--radius);font-size:13px;gap:12px}.prompt .icon{width:17px;color:var(--blue)}.asset-tabs{display:flex;gap:10px}.asset-tabs button{flex:1;min-height:44px;color:var(--muted);font-size:13px;border-bottom:0}.asset-tabs button.selected{color:var(--blue);border-color:var(--blue)}.note-box{font-size:12px;line-height:1.9;padding:15px;border-radius:12px;background:var(--panel2);color:var(--muted);margin:18px 0}dialog{background:var(--panel);color:var(--ink);border:1px solid var(--line);border-radius:25px 25px 0 0;padding:25px 23px calc(28px + env(safe-area-inset-bottom));position:fixed;bottom:0;top:auto;left:0;right:0;margin:0 auto;width:100%;max-width:680px;max-height:87dvh;overflow:auto;box-shadow:0 -10px 60px #00000035}dialog::backdrop{background:#040a1666;backdrop-filter:blur(4px)}.sheet-handle{width:36px;height:4px;background:var(--faint);opacity:.5;border-radius:5px;position:absolute;top:9px;left:50%;transform:translateX(-50%)}.close-sheet{position:absolute;right:10px;top:14px;color:var(--muted)}#sheet-body h2{font-size:26px;letter-spacing:-.5px;margin:12px 0 12px;padding-right:23px;font-weight:600}#sheet-body .ipa{font-size:12px;color:var(--muted);margin-bottom:22px}.word-meaning{font-size:14px;color:var(--ink);padding:13px 0;border-top:0}.word-meaning small{color:var(--muted);margin-right:8px;font-size:11px}.example{margin:15px 0 23px;background:var(--bg);padding:17px;border-radius:12px}.example p{font-family:Georgia,serif;font-size:20px;line-height:1.6;margin-bottom:12px}.example small{display:block;font-size:12px;line-height:1.8;color:var(--muted)}mark{background:var(--soft);color:var(--blue);border-radius:3px;padding:1px 2px}.sheet-note{font-size:11px;color:var(--muted);line-height:1.8;margin:12px 0 20px}.sheet-row{display:flex;align-items:center;justify-content:space-between;min-height:55px;border-bottom:0;font-size:13px;width:100%;text-align:left;gap:12px}.sheet-row span{color:var(--muted);font-size:12px}.sheet-row>div{display:flex;align-items:center;gap:10px}.draft-label{display:block;font-size:12px;margin:20px 0 9px;color:var(--muted)}.draft-input{display:block;width:100%;padding:13px;background:var(--bg);border:1px solid var(--line);border-radius:10px;font-size:16px;color:var(--ink);resize:vertical;min-height:48px}#toast{position:fixed;z-index:20;bottom:110px;left:50%;transform:translate(-50%,12px);width:max-content;max-width:86%;border-radius:12px;padding:13px 17px;background:var(--ink);color:var(--bg);font-size:12px;line-height:1.6;pointer-events:none;opacity:0;transition:opacity .2s,transform .2s;box-shadow:0 6px 24px #0003}#toast.visible{opacity:1;transform:translate(-50%,0)}.light .review-card{border:0}.light .reader-tools,.light .reader-text,.light .reader-top{background:#fbfcff}.light .english{color:#7b879a}.light .paragraph.current .english{color:#2a354c}.light .topbar .sample-pill{background:#e7ebf1}.light dialog{border-color:#e2e6ee}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}@media(max-width:350px){.page{padding-left:16px;padding-right:16px}.topbar{padding-left:16px;padding-right:16px}.practice-tile{padding:10px 7px}.tile-icon{width:25px}.practice-tile strong{font-size:12px}.lesson-title{font-size:25px}.reader-text{padding:10px 17px 16px}.english{font-size:23px}}@media(min-width:600px){.page{padding-left:32px;padding-right:32px}.topbar{padding-left:32px;padding-right:32px}.continue-card{padding:24px}.lesson-title{max-width:400px;font-size:34px}.material-row{min-height:88px}}
/* Left settings directory, inspired by the user-selected reference app. */
dialog.settings-drawer{position:fixed;inset:0 auto 0 max(0px,calc((100vw - 680px)/2));margin:0;padding:0;width:min(74vw,310px);min-width:236px;max-width:calc(100vw - 40px);height:100dvh;max-height:100dvh;border:0;border-right:0;border-radius:0 24px 24px 0;background:var(--bg);color:var(--ink);overflow:hidden;box-shadow:18px 0 55px #00000035;touch-action:pan-y}
dialog.settings-drawer[open]{display:flex;flex-direction:column}
dialog.settings-drawer::backdrop{background:#00000060;backdrop-filter:none}
.light dialog.settings-drawer::backdrop{background:#15213b38}
.drawer-header{display:flex;align-items:center;gap:5px;padding:calc(17px + env(safe-area-inset-top)) 10px 8px 20px;flex-shrink:0}
.framed .drawer-header{padding-top:48px}
.drawer-header h2{font-size:22px;line-height:1.3;letter-spacing:-.5px;font-weight:650;margin:0;flex:1}
.drawer-header:has([data-setting="root"]){padding-left:6px}
.drawer-header:has([data-setting="root"]) h2{font-size:17px;letter-spacing:-.25px}
.drawer-close{color:var(--muted)}
.drawer-body{min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;padding:0 14px 15px}
.drawer-profile{display:flex;width:100%;align-items:center;gap:10px;text-align:left;padding:14px 6px 18px;min-height:84px}
.drawer-avatar{height:42px;width:42px;flex-shrink:0;border-radius:13px;display:grid;place-items:center;color:var(--blue);background:var(--soft);font-size:14px;font-weight:650;letter-spacing:-.5px}
.drawer-profile>span:nth-child(2){flex:1;min-width:0}
.drawer-profile strong{display:block;font-size:16px;font-weight:600;margin-bottom:6px}
.drawer-profile small{display:block;font-size:10px;color:var(--muted);line-height:1.5}
.drawer-group{margin:3px 0 17px}
.drawer-group h3{font-size:11px;font-weight:500;color:var(--faint);padding:6px 10px 7px;letter-spacing:.3px}
.drawer-row{display:flex;align-items:center;gap:10px;width:100%;min-height:46px;padding:7px 10px;border-radius:10px;text-align:left}
.drawer-row:hover{background:var(--panel2)}
.drawer-row:active{background:var(--soft)}
.drawer-row-icon{height:23px;width:21px;display:grid;place-items:center;color:var(--muted);flex-shrink:0}
.drawer-row .icon{height:19px;width:19px}
.drawer-row-label{flex:1;font-size:13px;line-height:1.5;min-width:0}
.drawer-row>small{color:var(--faint);font-size:11px;min-width:14px;text-align:right}
.drawer-row>.chevron{height:13px!important;width:13px!important}
.appearance-group{margin-top:6px;margin-bottom:20px}
.appearance-picker{display:flex;gap:5px;background:var(--panel2);padding:4px;border-radius:12px;margin:3px 6px 0}
.appearance-picker button{position:relative;display:flex;align-items:center;justify-content:center;gap:7px;min-height:44px;min-width:0;flex:1;border-radius:9px;font-size:12px;color:var(--muted);padding:6px}
.appearance-picker button[aria-pressed="true"]{background:var(--panel);color:var(--blue);box-shadow:0 1px 6px #0000000c}
.appearance-symbol{display:flex;align-items:center}
.appearance-symbol .icon{height:17px;width:17px}
.appearance-check{width:12px;height:12px}
.appearance-check .icon{height:12px;width:12px;stroke-width:2.5}
.drawer-footer{display:flex;align-items:center;gap:6px;padding:15px 22px calc(19px + env(safe-area-inset-bottom));font-size:10px;color:var(--faint);flex-shrink:0}
.framed .drawer-footer{padding-bottom:28px}
.drawer-footer>span:last-child{margin-left:auto;font-size:9px}
.drawer-footer-logo{font-size:20px;line-height:14px;letter-spacing:-1px;color:var(--blue)}
.settings-detail{padding:13px 8px 20px}
.settings-account-mark{display:grid;place-items:center;width:54px;height:54px;border-radius:16px;background:var(--soft);color:var(--blue);margin:8px 0 20px}
.settings-account-mark .icon{height:26px;width:26px}
.settings-panel-title{font-size:20px;line-height:1.4;font-weight:600;margin:14px 0 10px}
.settings-description{font-size:12px;color:var(--muted);line-height:1.9;margin:10px 8px 21px 0;overflow-wrap:anywhere}
.drawer-body>.settings-description{padding:14px 8px 0}
.settings-fact{display:flex;justify-content:space-between;align-items:center;gap:12px;min-height:53px;font-size:11px;border-bottom:0}
.settings-fact span{color:var(--muted)}
.settings-fact strong{font-size:11px;font-weight:500;text-align:right}
.settings-small-note{font-size:10px;color:var(--muted);line-height:1.9;margin-top:18px}
.settings-detail .primary{font-size:12px;margin-top:24px;min-height:46px}
.drawer-caption{display:block;font-size:12px;margin:12px 0;color:var(--muted)}
.settings-choice{display:flex;gap:3px;background:var(--panel2);padding:3px;border-radius:10px;margin-bottom:25px}
.settings-choice button{flex:1;min-width:44px;min-height:44px;font-size:12px;border-radius:8px;color:var(--muted)}
.settings-choice button[aria-pressed="true"]{background:var(--panel);color:var(--blue)}
.settings-select{width:100%;min-height:46px;background:var(--panel);border:1px solid var(--line);border-radius:10px;color:var(--ink);font-size:16px;padding:0 12px}
.light .settings-drawer{background:#f8f9fc}
.light .drawer-profile{padding-bottom:20px}
.light .appearance-picker{background:#e9edf4}
.light .drawer-row:hover{background:#edf1f8}
@media(prefers-reduced-motion:no-preference){.settings-drawer[open]{animation:settings-enter .2s cubic-bezier(.2,.7,.3,1)}@keyframes settings-enter{from{transform:translateX(-100%)}to{transform:translateX(0)}}}
@media(max-width:350px){dialog.settings-drawer{width:76vw;min-width:236px}.drawer-body{padding-left:10px;padding-right:10px}.drawer-row{gap:8px;padding-left:8px;padding-right:8px}.drawer-profile{gap:8px}.appearance-picker button{gap:5px}.drawer-header h2{font-size:21px}}


/* v3: real local workspace; shared dark and light tokens from styles.css. */
:root{--radius:18px}#app{max-width:460px}.page{padding-top:17px}.topbar{height:58px}.page-heading{margin-bottom:24px}.page-heading h1{font-size:34px;letter-spacing:-1.2px}.heading-meta{max-width:130px;text-align:right;font-size:11px}.brand{font-size:16px}.brand svg{width:29px}.topbar .top-actions{gap:2px}.activity-summary{display:grid;grid-template-columns:repeat(3,1fr);margin:0 0 27px;gap:12px}.activity-summary>div{display:flex;flex-direction:column;gap:7px}.activity-summary strong{font-size:26px;font-weight:560;letter-spacing:-.8px}.activity-summary span{font-size:11px;color:var(--muted)}.continue-card{padding:20px;background:linear-gradient(135deg,#263551,#1d273a);border-color:#36476b}.card-topline{margin-bottom:18px}.lesson-title{font-size:30px;line-height:1.22;max-width:100%;overflow-wrap:anywhere}.excerpt{line-height:1.8;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:42px}.real-progress{height:3px;margin:25px 0 18px;background:#3a4b69;border-radius:9px;overflow:hidden}.real-progress i{height:100%;display:block;background:#a7c4ff;border-radius:9px}.empty-workspace{background:var(--panel);padding:25px 22px;border-radius:20px;border:1px solid var(--line);margin:8px 0 20px}.empty-icon{width:48px;height:48px;display:grid;place-items:center;color:var(--blue);background:var(--soft);border-radius:15px;margin-bottom:22px}.empty-icon .icon{width:25px;height:25px}.empty-workspace h2{font-size:23px;letter-spacing:-.6px;line-height:1.4;margin-bottom:12px}.empty-workspace p{font-size:13px;color:var(--muted);line-height:1.9;margin-bottom:24px}.empty-workspace .primary{font-size:14px}.sample-link{display:flex;align-items:center;justify-content:center;gap:5px;width:100%;min-height:44px;font-size:12px;color:var(--muted)}.sample-link .icon{width:14px}.storage-caption{display:flex;align-items:center;justify-content:center;gap:6px;color:var(--faint);font-size:10px;line-height:1.6;margin:24px 0 6px}.storage-caption .icon{height:13px;width:13px}.material-row strong,.word-row strong{overflow-wrap:anywhere}.row-content strong{line-height:1.6}.practice-row{margin-top:16px;margin-bottom:24px}.practice-tile{min-height:81px;border-color:transparent}.section-title h2{font-size:18px}.filters{gap:12px}.filters select{min-width:0;max-width:55%;height:44px}.word-row{min-height:88px;padding:15px 0}.word-row>div{min-width:0;flex:1}.word-row strong{font-size:20px}.word-row small{line-height:1.7;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.word-trailing{display:flex;gap:7px;align-items:center}.word-trailing .icon{height:15px;width:15px;color:var(--blue)}.heat{color:var(--muted);font-size:11px;min-width:25px;text-align:right}.load-more{border:1px solid var(--line);width:100%;min-height:46px;border-radius:12px;margin:16px 0;color:var(--blue)}.meaning-index{display:flex;gap:8px;overflow-x:auto;margin:16px 0 26px;padding-bottom:5px}.meaning-index button{flex-shrink:0;font-size:12px;min-height:44px;padding:8px 12px;background:var(--panel2);border-radius:10px;max-width:250px}.meaning-heading{display:flex;align-items:flex-start;gap:10px;justify-content:space-between;margin:24px 0 15px}.meaning-heading h3{font-size:18px;line-height:1.65;flex:1;padding-top:7px}.meaning-heading h3 small{font-size:11px;display:block;font-weight:400;color:var(--muted);margin-bottom:5px}.meaning-group{border-top:0;padding-bottom:12px}.meaning-group summary{min-height:48px;padding:15px 0;font-size:14px}.usage h4{font-size:16px;line-height:1.7;font-weight:550;margin:18px 0 5px}.usage>p{font-size:13px;line-height:1.8}.usage-context{color:var(--muted);margin-top:8px!important;font-size:11px!important}.usage .example{margin:13px 0 18px;padding:16px}.usage .example p{font-size:18px}.usage .example small{font-size:13px}.word-source{font-size:11px;color:var(--muted);line-height:1.8;padding-top:15px}.word-source summary{min-height:44px}.word-source p{margin:10px 0}.assets-content{margin-top:22px}.secondary{margin-top:23px;background:var(--soft)!important;color:var(--blue)!important}.spaced{margin-top:28px}.activity-row{display:flex;gap:12px;padding:15px 0;border-bottom:0;align-items:flex-start}.activity-dot{background:var(--blue);width:6px;height:6px;border-radius:50%;margin-top:7px;flex-shrink:0}.activity-row div{min-width:0}.activity-row strong{display:block;font-size:13px;font-weight:500;overflow-wrap:anywhere;line-height:1.6}.activity-row small{display:block;font-size:11px;color:var(--muted);margin-top:7px}.date-strip .day{min-width:36px;min-height:64px;border-radius:12px;padding:8px 0}.review-summary{gap:23px;padding:25px 0}.due-count{width:90px;min-width:90px;height:90px;border-radius:50%;background:var(--soft);display:flex;flex-direction:column;align-items:center;justify-content:center}.due-count strong{font-size:33px;color:var(--blue);font-weight:550;line-height:1.2}.due-count span{font-size:10px;color:var(--blue);margin-top:5px}.review-topline{display:flex;align-items:center;justify-content:space-between;margin-bottom:15px;font-size:12px;color:var(--muted)}.review-card{min-height:330px;padding:25px}.review-card h2{font-size:25px;line-height:1.6;overflow-wrap:anywhere}.review-card .example p{font-size:27px;overflow-wrap:anywhere}.review-actions button{min-height:66px;flex:1}.review-actions small{display:block;font-size:10px;color:var(--muted);margin-top:5px}.reveal-answer{margin-top:65px}.translation-missing{font-size:11px;line-height:1.7;color:var(--faint);margin:14px 0 20px}.reader-layout{height:100%;overflow:hidden}.reader-top{min-height:66px;gap:3px}.reader-title{min-width:0}.reader-title strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px;display:block}.reader-text{padding:5px 22px 20px;scroll-padding-top:20px}.paragraph{scroll-margin-top:15px;margin:0 0 24px;padding:10px 0 20px}.paragraph-heading{display:flex;align-items:center;justify-content:space-between;color:var(--muted)}.paragraph-heading>button{min-height:44px;font-size:10px;padding:0 3px}.paragraph-heading .icon-button{padding:0;min-width:44px}.paragraph-heading .icon{width:17px;height:17px}.english{font-size:25px;line-height:1.75;overflow-wrap:anywhere}.english button{font:inherit;padding:0;line-height:inherit;text-align:left;border-radius:4px;vertical-align:baseline}.english button:focus-visible{outline-offset:1px}.paragraph.current .english{color:var(--ink)}.translation{font-size:14px;line-height:1.9;margin-top:12px}.reader-tools{padding:11px 20px calc(12px + env(safe-area-inset-bottom));box-shadow:0 -8px 25px #0000000a}.reader-options{gap:7px}.reader-options button{min-height:40px;font-size:11px;gap:5px}.reader-options .icon{width:15px;height:15px}.reader-options span{font-size:10px}.reading-controls{display:flex;gap:7px;align-items:center;margin-top:8px}.reading-controls .icon-button{min-width:44px}.complete-button{display:flex;align-items:center;justify-content:center;gap:8px;flex:1;min-height:46px;border-radius:12px;background:var(--soft);color:var(--blue);font-size:13px}.complete-button .icon{height:17px;width:17px}.reader-audio{padding:10px 0}.reader-audio small{font-size:11px;color:var(--muted)}audio{width:100%;height:42px;display:block}.audio-caption{display:flex;justify-content:space-between;gap:8px;font-size:10px;color:var(--muted);margin-top:8px;line-height:1.5}.audio-caption label{min-height:28px;display:flex;align-items:center;gap:4px}.reader-audio input{accent-color:var(--blue)}.record-status{color:var(--blue);font-size:16px;font-variant-numeric:tabular-nums;text-align:center;margin:24px 0}.file-button{position:relative;display:flex;align-items:center;justify-content:center;gap:7px;min-height:46px;padding:12px;background:var(--soft);color:var(--blue);font-size:13px;border-radius:10px;overflow:hidden;cursor:pointer}.file-button input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}.file-button:focus-within{outline:2px solid var(--blue);outline-offset:3px}.translation-editor{margin:20px 0}.translation-editor summary{font-size:13px;color:var(--muted);min-height:44px;cursor:pointer}.draft-input:read-only{opacity:.7}.draft-input{line-height:1.6}.danger{color:#f7a19a}.service-status{display:flex;gap:7px;align-items:center;justify-content:center;font-size:11px;color:var(--muted);margin-top:25px}.service-status span{width:6px;height:6px;background:var(--faint);border-radius:50%}.restore-button{margin-top:16px}.settings-fact strong{font-weight:500}.settings-description{line-height:1.9}#sheet-body h2{overflow-wrap:anywhere}.light .continue-card{background:linear-gradient(140deg,#e7efff,#dbe7ff);border:1px solid #d1def8}.light .continue-card .card-topline,.light .continue-card .lesson-subtitle,.light .continue-card .lesson-time{color:#526a93}.light .continue-card .lesson-title{color:#243c67}.light .continue-button{background:#406be2;color:white}.light .real-progress{background:#c3d3f1}.light .real-progress i{background:#527de3}.light .empty-workspace{background:#fff;border-color:#e3e7ef}.light .practice-tile{background:#fff}.light .paragraph.current .english{color:#27344c}.light .review-card{background:#fff}.light .danger{color:#b93434}.light .activity-dot{background:#5079de}
@media(min-width:700px){body{background:#0e0f11}body.light{background:#e9edf4}#app{border-left:0;border-right:0;box-shadow:0 0 90px #0002;background:var(--bg)}.page{padding-left:24px;padding-right:24px}.topbar{padding-left:24px;padding-right:24px}dialog{max-width:460px}.settings-drawer{left:max(0px,calc((100vw - 460px)/2))!important}}
@media(max-width:350px){.activity-summary{gap:6px}.activity-summary strong{font-size:24px}.activity-summary span{font-size:10px}.empty-workspace{padding:21px 17px}.empty-workspace h2{font-size:21px}.reader-tools{padding-left:12px;padding-right:12px}.reader-title strong{max-width:185px}.reader-options button{font-size:10px}.reading-controls{gap:3px}.complete-button{font-size:12px}.word-row strong{font-size:18px}}

.reader-tabs{position:sticky;top:0;z-index:2;box-shadow:0 -8px 0 8px var(--bg)}.light .reader-tabs{box-shadow:0 -8px 0 8px #fbfcff}

/* 1.2 — calendar and personal learning lists */
.v12-page { padding: 12px 18px 25px; }
.v12-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin: 2px 0 17px; }
.v12-title h1 { margin: 0; font-size: 32px; line-height: 1.16; letter-spacing: -1px; }
.v12-title time { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.v12-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border-radius: 11px; color: var(--muted); }
.v12-icon .icon { width: 17px; height: 17px; }
.v12-icon.v12-accent { background: var(--soft); color: var(--blue); }
.v12-icon.v12-accent .icon { width: 20px; height: 20px; }
.v12-pill { padding: 0 10px; min-height: 34px; border-radius: 10px; font-size: 12px; background: var(--panel); white-space: nowrap; }
.calendar-controls { display: flex; align-items: center; gap: 1px; margin-right: -3px; }
.calendar-controls .v12-icon { width: 33px; }
.calendar-controls .v12-icon:active, .v12-pill:active { background: var(--soft); color: var(--blue); }

.day-strip { --day-gap: 8px; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * var(--day-gap)) / 3); gap: var(--day-gap); position: relative; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory; scrollbar-width: none; }
.day-strip::-webkit-scrollbar { display: none; }
.day-strip.is-dragging { scroll-snap-type: none; cursor: grabbing; user-select: none; }
.day-column { min-width: 0; scroll-snap-align: start; }
.day-heading { position: relative; padding: 10px 10px 8px; margin-bottom: 9px; min-height: 65px; border-radius: 13px; background: var(--panel); }
.day-heading span { display: block; margin-bottom: 2px; font-size: 11px; color: var(--muted); }
.day-heading time { display: block; font-size: 25px; line-height: 1; font-weight: 680; font-variant-numeric: tabular-nums; letter-spacing: -.7px; }
.day-heading time small { margin-left: 3px; font-size: 10px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.is-today .day-heading { background: var(--soft); color: var(--blue); }
.is-today .day-heading span { color: var(--blue); }
.day-add { position: absolute; right: 3px; bottom: 3px; width: 32px; height: 32px; display: grid; place-items: center; color: var(--faint); border-radius: 8px; }
.is-today .day-add, .day-add:active { color: var(--blue); }
.day-add .icon { width: 14px; height: 14px; }
.day-body { display: grid; align-content: start; gap: 7px; }
.day-card { min-width: 0; width: 100%; padding: 10px 9px; min-height: 96px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; background: var(--panel); border-radius: 12px; text-align: left; }
.day-card > .icon { width: 14px; height: 14px; color: var(--blue); }
.day-card strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; font-size: 13px; line-height: 1.24; font-weight: 650; letter-spacing: -.15px; }
.day-card small, .day-empty { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.day-empty { padding: 8px 10px; }
.day-event { width: 100%; min-width: 0; min-height: 32px; display: flex; align-items: center; gap: 4px; padding: 3px 4px; border-radius: 8px; text-align: left; color: var(--muted); font-size: 10px; }
.day-event .icon { width: 12px; height: 12px; flex: none; color: var(--faint); }
.day-event span { overflow-wrap: anywhere; }
.day-card:active, .day-event:active { background: var(--soft); }

.v12-continue { display: grid; justify-items: start; gap: 9px; padding: 16px; margin-bottom: 20px; }
.v12-continue .card-topline { width: 100%; }
.v12-continue .lesson-title { margin: 0; font-size: 24px; letter-spacing: -.5px; }
.v12-continue .lesson-subtitle { margin: 0; }
.v12-continue progress { appearance: none; width: 100%; height: 4px; border: none; border-radius: 4px; background: var(--line); color: var(--blue); }
.v12-continue progress::-webkit-progress-bar { background: var(--line); border-radius: 4px; }
.v12-continue progress::-webkit-progress-value { background: var(--blue); border-radius: 4px; }
.v12-continue progress::-moz-progress-bar { background: var(--blue); border-radius: 4px; }
.v12-continue .continue-button { justify-self: end; min-height: 35px; }
.v12-section { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 9px; }
.v12-section h2 { font-size: 17px; margin: 0; }
.v12-section span { color: var(--muted); font-size: 11px; }
.v12-search { margin: 0 0 10px; min-height: 42px; }
.v12-materials { display: grid; gap: 6px; }
.v12-materials .material-row { padding: 8px; min-height: 56px; border: 0; border-radius: 12px; }
.v12-materials .material-art { flex: none; width: 36px; height: 36px; border-radius: 10px; }
.v12-materials .material-row:active { background: var(--panel); }
.v12-empty { color: var(--muted); font-size: 13px; margin: 15px 2px; }

.v12-quick { display: flex; gap: 7px; margin-bottom: 10px; }
.v12-quick button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 10px; border-radius: 9px; background: var(--panel); font-size: 12px; }
.v12-quick small { font-size: 10px; color: var(--muted); }
.v12-quick .icon, .v12-source .icon { width: 14px; height: 14px; color: var(--blue); }
.v12-filters { display: flex; gap: 5px; margin-bottom: 11px; }
.v12-filters button { padding: 5px 9px; min-height: 33px; border-radius: 9px; color: var(--muted); font-size: 12px; }
.v12-filters button[aria-pressed="true"] { color: var(--blue); background: var(--soft); }
.v12-entries { display: grid; gap: 8px; }
.v12-entry { padding: 11px 12px 9px; border-radius: 13px; background: var(--panel); }
.v12-entry-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; }
.v12-entry-content { display: grid; gap: 3px; text-align: left; min-width: 0; }
.v12-entry-content strong { font-size: 17px; line-height: 1.25; font-weight: 650; overflow-wrap: anywhere; }
.v12-entry-content span, .v12-entry-content small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.v12-entry-content small { font-size: 11px; line-height: 1.5; }
.v12-entry-content .entry-correction { display: flex; align-items: flex-start; gap: 4px; color: var(--blue); }
.entry-correction .icon { flex: none; width: 13px; height: 13px; }
.mastery-toggle { display: flex; flex: none; align-items: center; gap: 2px; min-height: 30px; padding: 4px 6px; border-radius: 8px; font-size: 11px; color: var(--muted); }
.mastery-toggle[aria-pressed="true"] { color: var(--blue); background: var(--soft); }
.mastery-toggle .icon { width: 12px; height: 12px; }
.v12-source { display: flex; align-items: center; gap: 3px; min-height: 28px; margin-top: 3px; font-size: 11px; color: var(--muted); }
.v12-form-source { font-size: 12px; color: var(--muted); margin: 5px 0 10px; }

body #nav { border-top-color: transparent; }
#nav button.active::before { display: none; }
#nav button.active .icon { stroke-width: 2.1; }
body.light .day-heading, body.light .day-card, body.light .v12-entry { background: #fff; }
body.light .is-today .day-heading { background: #e6ecff; }

@media (max-width: 380px) {
  .v12-page { padding-inline: 15px; }
  .day-strip { --day-gap: 6px; }
  .day-heading, .day-card { padding-inline: 8px; }
}

/* Compact 1.2: one title row, independent three-day columns. */
#screen:has(.calendar-page), #screen:has(.ai-page) { display:flex; flex-direction:column; overflow:hidden; }
.v12-page { padding:2px 16px 18px; }
.compact-topbar { min-height:52px; height:52px; display:flex; align-items:center; gap:9px; padding:0 16px; flex:none; }
.v12-page .compact-topbar { padding:0; margin-bottom:8px; }
.compact-topbar h1 { font-size:21px; font-weight:680; letter-spacing:-.55px; line-height:1.25; margin:0; flex:1; }
.compact-topbar .brand { width:32px; height:42px; min-width:32px; display:grid; place-items:center; padding:0; flex:none; }
.compact-topbar .brand svg { width:26px; height:22px; }
.compact-title { display:flex; flex:1; min-width:0; align-items:center; gap:clamp(8px, 2vw, 14px); }
.compact-title h1 { flex:none; white-space:nowrap; }
.compact-title .official-entry { padding-inline:9px; border:1px solid var(--line); border-radius:var(--radius); }
.compact-title .official-entry:hover { background:var(--soft); }
.compact-actions { display:flex; align-items:center; gap:3px; }
.compact-actions .v12-icon { width:40px; height:40px; }
.compact-actions .v12-icon.v12-accent { background:transparent; }
.compact-meta { font-size:12px; color:var(--muted); margin:0 0 12px; }
.calendar-page { display:flex; flex:1; min-height:0; padding-bottom:8px; }
.calendar-page .compact-topbar { margin-bottom:0; }
.calendar-month { color:var(--muted); font-size:11px; line-height:24px; margin-bottom:4px; }
.calendar-controls .v12-icon { width:32px; height:40px; }
.calendar-controls .v12-pill { min-height:34px; padding-inline:9px; background:transparent; color:var(--blue); }
.day-strip { flex:1; min-height:0; overflow-y:hidden; grid-template-rows:minmax(0,1fr); }
.day-column { display:flex; flex-direction:column; min-height:0; border-radius:13px; background:var(--panel); overflow:hidden; }
.day-heading { display:flex; align-items:center; flex-wrap:wrap; gap:2px 4px; flex:none; margin:0; padding:6px 7px; min-height:53px; border-radius:0; background:none; }
.day-heading span { margin:0; font-size:12px; color:var(--ink); }
.day-heading time { font-size:10px; font-weight:450; letter-spacing:0; color:var(--muted); }
.day-add { position:static; margin-left:auto; height:30px; width:25px; }
.day-add .icon { width:15px; height:15px; }
.day-body { display:flex; flex-direction:column; min-height:0; flex:1; overflow-y:auto; gap:7px; padding:2px 5px 8px; scrollbar-width:none; overscroll-behavior-y:contain; }
.day-card { flex:none; min-height:0; padding:10px 7px; gap:8px; background:var(--bg); border-radius:9px; }
.day-card strong { font-size:13px; font-weight:630; line-height:1.4; display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.day-card p { display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; font-size:11px; line-height:1.6; color:var(--muted); margin:0; overflow-wrap:anywhere; }
.day-card-type { display:flex; align-items:center; gap:4px; font-size:10px; color:var(--blue); }
.day-card-type .icon { width:12px; height:12px; flex:none; }
.day-card footer { display:flex; justify-content:space-between; gap:2px; font-size:9px; color:var(--muted); width:100%; }
.day-card footer small { font-size:9px; }
.day-empty { margin:0; padding:20px 0; text-align:center; font-size:11px; color:var(--muted); }
.v12-continue { padding:16px; margin-top:0; margin-bottom:18px; border:0; border-radius:16px; }
.v12-continue .card-topline { margin-bottom:12px; font-size:11px; }
.v12-continue .lesson-title { font-size:24px; line-height:1.25; }
.v12-continue .excerpt { min-height:0; font-size:12px; line-height:1.6; margin-top:8px; -webkit-line-clamp:2; }
.v12-continue progress { margin:15px 0 10px; height:3px; }
.v12-continue .continue-button { min-height:38px; padding:9px 12px; font-size:12px; }
.v12-section { margin-top:10px; margin-bottom:10px; }
.v12-section h2 { font-size:16px; }
.v12-search { height:40px; min-height:40px; margin:0 0 9px; border-radius:12px; }
.v12-search input { font-size:13px; }
.v12-filters { margin-bottom:10px; gap:5px; }
.v12-filters button { min-height:35px; padding:5px 10px; }
.v12-quick { margin:0; gap:1px; }
.v12-quick button { min-height:40px; padding:4px 7px; background:transparent; color:var(--blue); }
.v12-quick small { display:none; }
.v12-materials .material-row { border:0; padding-block:10px; min-height:68px; }
.v12-entries { gap:8px; }
.v12-entry { padding:12px 13px 7px; }
.v12-source { min-height:30px; }
body #nav { flex:none; min-height:60px; padding-top:5px; }
body #nav button { min-height:52px; font-size:10px; }
body #nav button .icon { width:22px; height:22px; }
body.light .day-column { background:#e9edf3; }
body.light .day-heading { background:none; }
body.light .day-card { background:#fff; }
body.light .is-today .day-heading { background:#e0e8fb; }
@media(max-width:380px) {
  .v12-page { padding-inline:13px; }
  .compact-topbar { padding-inline:13px; gap:7px; }
  .compact-topbar h1 { font-size:20px; }
  .compact-actions { gap:0; }
  .day-heading { padding-inline:6px; gap:2px 3px; }
  .day-heading span { font-size:11px; }
  .day-heading time { font-size:9px; }
  .day-card { padding-inline:7px; }
}

.calendar-page { flex-direction:column; }
.day-strip { width:100%; min-width:0; }
.official-course-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),460px)); gap:12px; }
.official-course-card {
  display:flex; align-items:center; gap:12px; width:100%; min-height:78px; padding:14px;
  text-align:left; border:1px solid var(--line); background:var(--panel);
}
.official-course-card, .official-book { color:var(--ink); text-decoration:none; }
.official-course-card:hover, .official-book:hover { border-color:var(--blue); }
.official-course-icon {
  display:grid; place-items:center; flex:none; width:38px; height:38px; color:var(--blue); background:var(--soft);
}
.official-course-icon svg { width:20px; height:20px; }
.official-course-arrow { color:var(--muted); margin-inline-start:auto; }
.official-course-card strong, .official-course-card small, .official-book small, .official-book strong { display:block; }
.official-course-card strong { font-size:17px; }
.official-course-card small, .official-book small { color:var(--muted); font-size:12px; margin-top:4px; }
.official-course-back { min-height:36px; margin-bottom:6px; text-decoration:none; }
.official-course-title { margin:3px 0 14px; font-size:22px; }
.official-books { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-bottom:16px; }
.official-book {
  min-width:0; min-height:58px; text-align:left; padding:8px 10px; border:1px solid var(--line); background:var(--panel);
}
.official-book small { margin:0 0 3px; }
.official-topic-directory { max-width:800px; }
.official-topic-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:4px 12px; }
.official-topic-heading .official-course-title { margin:0; }
.official-topic-heading a { text-decoration:none; }
.official-topic-label { font-size:14px; margin:15px 0 8px; }
.official-topic-list { list-style:none; margin:0; padding:0; border:1px solid var(--line); background:var(--panel); }
.official-topic-list li + li { border-top:0; }
.official-topic {
  display:grid; align-items:center; grid-template-columns:74px minmax(0,1fr) 18px; gap:10px;
  min-height:46px; padding:8px 12px; color:var(--ink); text-decoration:none;
}
.official-topic:hover { background:var(--soft); }
.official-topic-number { color:var(--muted); font-size:12px; white-space:nowrap; }
.official-topic strong { font-size:15px; font-weight:600; line-height:1.4; overflow-wrap:anywhere; }
.official-topic-arrow { color:var(--muted); }
.official-materials-page :is(button,a,select):focus-visible { outline:2px solid var(--blue); outline-offset:-2px; }
@media (min-width:700px) {
  .official-books { grid-template-columns:repeat(4,minmax(0,1fr)); max-width:800px; }
}

.calendar-page .day-body { gap:7px; }
.calendar-page .day-column { border-radius:0; }
.calendar-activity {
  flex:none;
  min-width:0;
  overflow:hidden;
  border:1px solid var(--line);
  background:var(--bg);
}
.calendar-activity-heading {
  display:block;
  width:100%;
  padding:8px 10px 5px;
  text-align:start;
}
.calendar-activity-intro,.calendar-activity-label {
  display:flex;
  align-items:center;
  gap:5px;
  min-width:0;
}
.calendar-activity-intro { justify-content:space-between; }
.calendar-activity-label {
  color:var(--blue);
  font-size:12px;
  font-weight:500;
}
.calendar-activity-label > .icon { flex:none; width:13px; height:13px; }
.calendar-activity-heading small,.calendar-activity-row small {
  color:var(--muted);
  font-size:11px;
  font-weight:500;
  font-variant-numeric:tabular-nums;
}
.calendar-activity-summary {
  display:block;
  margin:5px 0 3px;
  color:var(--ink);
  font-size:13px;
  line-height:1.35;
  font-weight:650;
}
.calendar-activity-entries { padding:0 10px 4px; }
.calendar-activity-row {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:3px 8px;
  width:100%;
  min-height:32px;
  min-width:0;
  padding:5px 3px;
  border-top:0;
  text-align:start;
  font-size:12px;
}
.calendar-activity-entries .calendar-activity-row {
  display:block;
  padding:6px 0 5px;
}
.calendar-activity-entries .calendar-activity-row:first-child { border-top:0; }
.calendar-activity-entries .calendar-activity-row > span:first-child {
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  overflow-wrap:anywhere;
  color:var(--ink);
  font-size:13px;
  font-weight:650;
  line-height:1.3;
}
.calendar-activity-entries .calendar-activity-row > small { display:block; margin-top:4px; line-height:1.3; }
.calendar-activity-added-group + .calendar-activity-added-group {
  border-top:0;
  margin-top:4px;
  padding-top:4px;
}
.calendar-activity-added-label {
  display:block;
  margin:2px 0 0;
  color:var(--muted);
  font-size:11px;
}
.calendar-activity-added-group .calendar-activity-row {
  min-height:26px;
  padding:4px 0;
}
.calendar-activity-added-group .calendar-activity-row:nth-child(2) { border-top:0; }
.calendar-activity-preview { display:none; }
.calendar-activity-more {
  display:block;
  min-height:28px;
  padding:1px 0;
  text-align:start;
  color:var(--blue);
  font-size:11px;
}
.calendar-activity :is(button:hover,button:focus-visible),.calendar-detail button.calendar-activity-row:hover {
  background:color-mix(in srgb,var(--blue) 8%,transparent);
}
.calendar-detail-date { margin:4px 0 15px; font-size:12px; color:var(--muted); }
.calendar-detail-title { margin:0 0 5px; overflow-wrap:anywhere; font-size:16px; }
.calendar-detail-metrics { margin:0 0 14px; color:var(--blue); font-size:13px; }
.calendar-detail-list .calendar-activity-row {
  min-height:39px;
  align-items:center;
  padding:6px 2px;
  overflow-wrap:anywhere;
}
.calendar-detail-list .calendar-activity-row > small { text-align:end; }
.calendar-detail-subhead { margin:14px 0 6px; font-size:13px; }
.calendar-detail-subhead small { margin-inline-start:4px; color:var(--muted); font-weight:500; }
.calendar-listening-report { padding:10px; }
@media (min-width:900px) {
  .calendar-activity-heading { padding:9px 11px 6px; }
  .calendar-activity-entries { padding:0 11px 5px; }
  .calendar-activity-entries .calendar-activity-row > span:first-child { font-size:14px; }
  .calendar-activity-entries .calendar-activity-preview {
    display:block;
    margin-top:4px;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    color:var(--muted);
    line-height:1.35;
  }
  .calendar-activity-summary { font-size:14px; }
}
@media (max-width:560px) {
  .calendar-page .day-body { gap:5px; }
  .calendar-activity-heading { padding:6px 5px 4px; }
  .calendar-activity-intro { gap:3px; }
  .calendar-activity-label { font-size:11px; }
  .calendar-activity-label > .icon { display:none; }
  .calendar-activity-heading small,.calendar-activity-row small { font-size:10px; }
  .calendar-activity-entries { padding:0 5px 3px; }
  .calendar-activity-entries .calendar-activity-row { min-height:26px; padding:4px 0; }
  .calendar-activity-entries .calendar-activity-row > span:first-child { font-size:11px; }
  .calendar-activity-summary { font-size:11px; }
}
#sheet:has(.calendar-detail) {
  position:fixed;
  inset:0;
  width:min(540px, calc(100% - 28px));
  height:fit-content;
  max-height:80vh;
  max-height:min(80dvh, 680px);
  margin:auto;
  border-radius:0;
  overscroll-behavior:contain;
  box-shadow:0 14px 42px rgb(0 0 0 / .35);
}
#sheet:has(.calendar-detail)::backdrop {
  background:transparent;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
#sheet:has(.calendar-detail) .sheet-handle { display:none; }



.ai-page { display:flex; flex-direction:column; flex:1; min-height:0; padding:0 16px 10px; }
.ai-switch { display:flex; flex:none; background:var(--panel); border-radius:12px; padding:3px; gap:3px; }
.ai-switch button { flex:1; height:36px; border-radius:9px; font-size:13px; color:var(--muted); }
.ai-switch button[aria-pressed="true"] { background:var(--soft); color:var(--blue); font-weight:600; }
.ai-meta { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:4px 2px; font-size:10px; color:var(--muted); flex:none; min-height:31px; }
.ai-meta button { color:var(--blue); padding:6px; }
.ai-thread { overflow-y:auto; min-height:0; flex:1; scroll-behavior:smooth; overscroll-behavior:contain; padding:8px 0 18px; scrollbar-width:none; }
.ai-welcome { padding:38px 6px 16px; }
.ai-welcome>span { display:grid; width:40px; height:40px; place-items:center; color:var(--blue); background:var(--soft); border-radius:13px; margin-bottom:18px; }
.ai-welcome h2 { font-size:23px; font-weight:650; letter-spacing:-.5px; line-height:1.3; margin:0 0 8px; }
.ai-welcome p { font-size:12px; color:var(--muted); margin:0 0 25px; }
.ai-welcome>button { display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; background:var(--panel); border-radius:12px; text-align:left; font-size:12px; line-height:1.6; padding:13px 12px; margin:8px 0; }
.ai-welcome>button .icon { flex:none; width:16px; color:var(--blue); }
.ai-composer { display:flex; gap:7px; align-items:flex-end; padding:7px 7px 7px 12px; background:var(--panel); border-radius:15px; flex:none; }
.ai-composer textarea { resize:none; border:0; background:transparent; color:var(--ink); font:inherit; font-size:14px; line-height:1.5; min-width:0; flex:1; min-height:36px; max-height:105px; padding:7px 0; outline:none; }
.ai-composer:focus-within { box-shadow:0 0 0 1px var(--blue); }
.ai-send { display:grid; place-items:center; width:36px; height:36px; border-radius:11px; background:var(--blue); color:var(--bg); flex:none; }
.ai-send .icon { transform:rotate(-90deg); width:20px; height:20px; }
.ai-send:disabled { opacity:.35; }
.chat-pair { padding-bottom:23px; }
.chat-user { background:var(--soft); color:var(--ink); padding:11px 13px; border-radius:15px 15px 4px 15px; margin-left:auto; max-width:88%; width:fit-content; white-space:pre-wrap; overflow-wrap:anywhere; font-size:14px; line-height:1.65; }
.chat-assistant { padding:17px 3px 0; font-size:14px; line-height:1.8; overflow-wrap:anywhere; }
.chat-assistant small { font-size:10px; font-weight:600; color:var(--blue); display:block; margin-bottom:6px; }
.chat-assistant>div { white-space:pre-wrap; }
.chat-state { font-size:11px; color:var(--muted); line-height:1.7; padding:15px 4px 0; }
.chat-state button { padding:5px 7px; color:var(--blue); }
.ai-error { color:var(--blue); font-size:11px; line-height:1.6; flex:none; }
.ai-error:not(:empty) { padding:6px 1px; }
.ai-setting-group { margin-bottom:28px; }
.ai-setting-group h3 { margin:0 0 13px; display:flex; justify-content:space-between; align-items:center; font-size:17px; }
.ai-setting-group h3 small { color:var(--muted); font-size:10px; font-weight:400; }
.ai-setting-group label { display:block; margin:12px 0 6px; font-size:11px; color:var(--muted); }
.ai-setting-group input { font-size:13px; margin-bottom:0; min-height:42px; }
.ai-setting-actions { display:flex; align-items:center; gap:8px; margin-top:12px; }
.ai-setting-actions button { flex:1; min-height:39px; border-radius:10px; background:var(--panel); color:var(--blue); font-size:12px; padding:8px; }
.ai-setting-group .primary { font-size:12px; min-height:40px; margin-top:10px; padding:10px; }
.ai-setting-actions .primary { margin:0; }
.ai-caption { color:var(--muted); font-size:11px; line-height:1.7; margin:10px 0; overflow-wrap:anywhere; }
.ai-text-button { font-size:11px; min-height:36px; }
#grok-config-text { width:100%; resize:vertical; background:var(--panel); color:var(--ink); border:0; border-radius:9px; padding:10px; font-size:11px; line-height:1.6; overflow-wrap:anywhere; }
@media(max-height:700px) { .ai-welcome { padding-top:18px; } .ai-welcome>span { margin-bottom:12px; } }

.ai-setting-title { display:flex; align-items:center; flex-wrap:wrap; column-gap:9px; row-gap:2px; margin:0 0 8px; }
.ai-setting-title h3 { margin:0; }
.ai-setting-title a { display:inline-flex; align-items:center; gap:3px; min-height:32px; color:var(--blue); font-size:12px; }
.ai-setting-title small { margin-inline-start:auto; color:var(--muted); font-size:10px; white-space:nowrap; }


/* CS player layout, adapted to LoopFluent colours and phone spacing. */
.reader-top { min-height:50px; height:50px; border:0; }
.reader-title small { display:none; }
.reader-toolbar { display:flex; align-items:center; gap:8px; position:sticky; top:0; z-index:2; padding:4px 0 8px; background:var(--bg); }
.reader-toolbar .reader-tabs { flex:1; margin:0; padding:3px; box-shadow:none; position:static; border-radius:10px; }
.reader-toolbar .reader-tabs button { min-height:32px; padding:6px; font-size:12px; }
.reader-toolbar>.icon-button { width:36px; height:36px; flex:none; color:var(--muted); }
.reader-text { padding:0 18px 12px; }
.paragraph,.paragraph+.paragraph { border:0; margin:0 0 17px; padding:4px 0 9px; }
.paragraph-heading { min-height:31px; }
.paragraph-heading>button { min-height:31px; }
.paragraph-heading .icon-button { min-width:32px; height:31px; }
.english { font-size:23px; line-height:1.6; }
.english button { min-height:0; }
.translation { font-size:13px; line-height:1.7; margin-top:8px; }
.english .spoken-word { color:var(--blue); background:var(--soft); }
.study-player-dock { flex:none; padding:5px 12px 5px; margin:0 10px 4px; background:var(--panel); border-radius:14px; }
.study-player { display:block; }
.study-player audio[hidden] { display:none!important; }
.study-tools { display:flex; align-items:center; justify-content:center; gap:8px; min-height:34px; }
.study-tools>button,.study-tools>label { display:flex; position:relative; align-items:center; justify-content:center; gap:5px; height:32px; min-width:70px; padding:3px 8px; font-size:12px; line-height:20px; border-radius:7px; }
.study-tools button[aria-pressed=true] { background:var(--soft); color:var(--blue); }
.study-tools .icon { width:17px; height:17px; }
.study-speed-value { font-size:13px; }
.study-speed select { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.study-speed:focus-within { outline:2px solid var(--blue); }
.study-repeat select { min-height:28px; height:28px; border:0; background:transparent; color:var(--ink); font-size:12px; padding:0 6px; }
.study-timeline { padding:0 4px; }
.study-timeline>input { display:block; width:100%; height:20px; min-height:20px; padding:0; margin:0; accent-color:var(--blue); }
.study-timeline>div { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:18px; font-size:10px; line-height:16px; color:var(--muted); font-variant-numeric:tabular-nums; }
.study-transport { display:grid; grid-template-columns:1fr 1fr 1.25fr 1fr 1fr; align-items:center; justify-items:center; min-height:40px; gap:8px; }
.study-transport>button { display:flex; align-items:center; justify-content:center; height:40px; min-height:40px; min-width:40px; padding:3px; color:var(--ink); }
.study-transport .icon { width:23px; height:23px; }
.study-transport .study-play .icon { width:25px; height:25px; }
.study-play .icon { fill:currentColor; stroke-width:0; }

.light .reader-toolbar { background:#fbfcff; }
.light .study-player-dock { background:#e9edf3; }
.v12-entry-content { flex:1; align-self:stretch; padding:1px 0; }
.v12-entry-content:after { content:""; position:absolute; inset:0; border-radius:inherit; }
.v12-entry { position:relative; padding:12px 13px; }
.mastery-toggle,.entry-edit { position:relative; z-index:1; }
.entry-actions { display:flex; align-items:center; flex:none; gap:2px; }
.entry-edit { color:var(--muted); width:28px; height:30px; font-size:17px; padding:0; }
.day-column,body.light .day-column { background:transparent; border-radius:0; }
.day-heading,body.light .day-heading,.is-today .day-heading,body.light .is-today .day-heading { min-height:38px; padding:0 0 5px; background:transparent; overflow:visible; flex-wrap:nowrap; gap:0; }
.day-date { display:flex; align-items:center; gap:4px; min-height:24px; border-radius:7px; padding:3px 4px; }
.is-today .day-date { background:var(--soft); color:var(--blue); }
.day-heading span { font-size:11px; white-space:nowrap; }
.day-heading time { font-size:9px; white-space:nowrap; }
.day-add { width:27px; height:32px; }
.day-body { padding:0 0 6px; gap:8px; }
.day-card,body.light .day-card { background:var(--panel); border-radius:10px; padding:11px 9px; }
body.light .day-card { background:#fff; }
@media(max-width:380px) { .day-date { gap:3px; padding-inline:3px; } .day-add { width:24px; } }

/* CS StudyParagraph / StudySentence: typography, hatch masking and swipe rail. */
:root{--study-mask:#73809e;--study-selected:#efd56a}
.cs-reader{position:relative;min-height:0;height:100%;overflow:hidden}
.cs-reader .reader-top{height:44px;min-height:44px;padding:0 8px}
.cs-reader .reader-title strong{font-size:13px;line-height:1.4;font-weight:600;max-height:36px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.cs-reader .reader-top .icon-button{width:38px;min-width:38px;height:40px}
.reader-accent{box-sizing:border-box;max-width:88px;min-height:34px;padding:0 6px;border:1px solid var(--line);background:var(--panel);color:var(--ink);font:inherit;font-size:12px}
.cs-reader .english-reader-options{position:relative;display:flex;align-items:center;justify-content:space-between;gap:4px;flex:none;min-height:38px;padding:0 14px 4px;z-index:5}
.english-reading-modes,.reader-option-actions{display:flex;align-items:center;gap:2px}
.english-reading-modes{padding:2px;background:var(--panel);border-radius:7px}
.english-reading-modes button{min-height:30px;padding:3px 9px;border-radius:5px;font-size:12px;line-height:20px;color:var(--muted)}
.english-reading-modes button[aria-pressed=true]{background:var(--panel2);color:var(--ink)}
.reader-option-actions>button{height:32px;min-height:32px;display:flex;align-items:center;justify-content:center;color:var(--muted);border-radius:5px}
.reader-option-actions>button[aria-pressed=true]{color:var(--blue)}
.reader-follow{padding:0 5px;gap:4px;font-size:11px}
.reader-option-actions .icon{width:17px;height:17px}
.reader-icon-button{width:30px;padding:4px}
.reader-options-popover{position:absolute;right:14px;top:100%;width:176px;padding:12px;background:var(--panel);box-shadow:0 8px 28px #0003;border:1px solid var(--line);border-radius:9px}
.reader-options-popover[hidden]{display:none}
.reader-options-popover label{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--muted)}
.reader-options-popover select{min-height:32px;width:84px;border:0;border-radius:5px;padding:4px 8px;background:var(--panel2);color:var(--ink);font-size:12px}
.cs-reader .reader-text{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:6px 10px 12px;scroll-behavior:auto}
.study-sentence{--sentence-swipe:0;position:relative;overflow:hidden;min-height:52px;width:100%;margin:0 auto 16px;isolation:isolate;touch-action:pan-y;border-radius:4px}
.sentence-reading-surface{position:relative;min-height:52px;touch-action:pan-y;background:var(--bg);opacity:calc(1 - var(--sentence-swipe));transform:translateX(calc(-18px * var(--sentence-swipe)));transition:opacity .16s,transform .16s}
.study-sentence.is-swiping .sentence-reading-surface{transition:none}
.study-sentence.is-open{--sentence-swipe:1}
.cs-reader .study-paragraph.paragraph{position:relative;padding:10px 12px 10px 10px;margin:0;border:0;border-left:0;transition:background .15s}
.cs-reader .study-paragraph.current{background:color-mix(in srgb,var(--blue) 6%,transparent);border-left-color:var(--blue)}
.cs-reader .study-original.english{font-family:Georgia,"Times New Roman",serif;font-size:21px;line-height:1.6;font-weight:400;letter-spacing:0;color:var(--ink);margin:0 0 7px;overflow-wrap:anywhere}
.cs-reader .study-original:last-child{margin-bottom:0}
.cs-reader .study-translation{font-size:13px;line-height:1.6;color:var(--muted);margin:0}
.cs-reader .study-token{white-space:nowrap}
.cs-reader .study-word{display:inline;min-width:0;min-height:0;padding:2px 0;border:0;font:inherit;line-height:inherit;letter-spacing:inherit;text-align:inherit;color:inherit;background:none;border-radius:0;vertical-align:baseline;touch-action:manipulation}
.cs-reader .study-word.spoken-word{color:inherit;background:color-mix(in srgb,var(--study-selected) 36%,transparent)}
.study-letter{display:inline}
.study-letter.is-concealed{color:transparent!important;text-shadow:none;user-select:none;-webkit-user-select:none}
.cs-reader .study-word.is-masked{position:relative;touch-action:none;user-select:none;-webkit-user-select:none;cursor:crosshair}
.cs-reader .study-word.is-masked::after{content:'';position:absolute;left:0;right:0;top:var(--study-mask-top,0px);height:var(--study-mask-height,1em);pointer-events:none;background:repeating-linear-gradient(45deg,var(--study-mask) 0 1px,transparent 1px 4px);mask-image:var(--study-mask-clips);-webkit-mask-image:var(--study-mask-clips)}
.cs-reader .study-word.is-masked .study-letter{pointer-events:none}
.sentence-action-rail{position:absolute;inset:0;z-index:2;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:center;gap:4px;padding:4px 6px;border-radius:4px;background:#2d323a;color:#f5f7fa;clip-path:inset(0 0 0 calc((1 - var(--sentence-swipe))*100%));pointer-events:none}
.dark .sentence-action-rail{background:#10141a}
.study-sentence.is-open .sentence-action-rail{pointer-events:auto}
.sentence-action-rail button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:44px;padding:6px 2px;font-size:12px;border-radius:5px}
.sentence-action-rail button[aria-pressed=true]{color:var(--blue)}
.sentence-action-rail .icon{height:18px;width:18px}
.study-sentence.is-skipped .study-paragraph{opacity:.45}
.sentence-more{position:absolute;top:4px;right:4px;display:flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;color:var(--muted);border-radius:4px;opacity:0;pointer-events:none}
.sentence-more:focus-visible{opacity:1;pointer-events:auto;background:var(--panel)}
.sentence-more .icon{width:17px;height:17px;stroke-width:3}
.english-reading-pages{display:flex;align-items:center;justify-content:center;gap:14px;font-size:11px;color:var(--muted);padding:8px}
.english-reading-pages button{height:34px}
.cs-empty{padding:30px 12px;font-size:13px;text-align:center;color:var(--muted)}
.cs-reader .study-player-dock{padding:3px 10px;margin:0 10px 4px;border-radius:10px}
.cs-reader .study-tools{min-height:30px}
.cs-reader .study-tools>button,.cs-reader .study-tools>label{height:30px;min-height:30px}
.cs-reader .study-transport{min-height:36px}
.cs-reader .study-transport>button{height:36px;min-height:36px}
.cs-note-dialog,.cs-error-dialog{position:fixed;inset:0;width:calc(100% - 28px);max-width:480px;max-height:calc(100dvh - 40px);margin:auto;padding:14px;border:1px solid var(--line);border-radius:12px;background:var(--bg);color:var(--ink);overflow:auto}
.cs-note-dialog::backdrop,.cs-error-dialog::backdrop{background:#0008}
.sentence-note-editor header,.cs-error-editor header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-size:15px}
.sentence-note-editor header button,.cs-error-editor header button{display:grid;place-items:center;min-width:32px;height:32px}
.sentence-note-editor>p{font:18px/1.6 Georgia,serif;margin:0 0 12px}
.sentence-note-editor textarea,.cs-error-editor textarea,.cs-error-editor input,.cs-error-editor select{display:block;width:100%;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--ink);padding:8px;font-size:13px;line-height:1.5;min-width:0}
.sentence-note-editor textarea{resize:vertical;min-height:120px}
.sentence-note-editor footer,.cs-error-editor footer{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
.sentence-note-editor footer button,.cs-error-editor footer button{display:flex;align-items:center;justify-content:center;gap:4px;min-height:36px;padding:6px 12px;font-size:12px;border-radius:6px;background:var(--panel)}
.sentence-note-editor footer button[type=submit],.cs-error-editor footer button[type=submit]{color:var(--blue);background:var(--soft)}
.cs-error-editor label{display:grid;gap:4px;margin-bottom:10px;font-size:12px;color:var(--muted)}
.cs-error-editor textarea{resize:vertical}
.cs-error-editor .cs-delete{margin-right:auto;color:#ee9d9d;background:none}
.cs-example-heading{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:var(--muted)}
.cs-example-heading button{display:flex;align-items:center;gap:3px;height:30px;color:var(--blue)}
.cs-example-heading .icon{width:14px;height:14px}
.cs-example{display:grid;gap:5px;margin-top:8px}
.cs-example>div{display:flex;gap:4px}
.cs-example button{width:32px}
.cs-example .icon{width:16px;height:16px}
.compact-topbar{height:46px;min-height:46px}
.compact-topbar h1{font-size:19px;letter-spacing:-.3px}
.v12-page .compact-topbar{margin-bottom:5px}
.v12-page{padding-top:0}
.v12-continue{padding:13px 14px;margin-bottom:14px;border-radius:12px}
.v12-continue .card-topline{margin-bottom:8px}
.v12-continue .lesson-title{font-size:22px}
.v12-continue .excerpt{margin-top:5px}
.v12-continue progress{margin:10px 0 8px}
.v12-continue .continue-button{min-height:34px;padding:6px 11px}
.v12-section{margin:8px 0}
.v12-materials .material-row{min-height:60px;padding-block:8px}
.v12-materials .material-art{width:34px;height:38px;border-radius:8px}
.v12-materials .row-content strong{font-size:13px}
.v12-materials .row-content small{font-size:11px;margin-top:3px}
.v12-entry{padding:10px 12px;border-radius:10px}
.v12-entry-content strong{font-size:16px;line-height:1.35}
.v12-search{height:36px;min-height:36px;margin-bottom:6px}
.v12-filters{margin-bottom:8px}
.v12-filters button{min-height:32px;padding:4px 9px;font-size:12px}
.ai-switch{min-height:34px}
.ai-meta{padding-block:3px}
body #nav{min-height:54px;padding-top:2px}
body #nav button{min-height:48px}
@media(prefers-reduced-motion:reduce){.sentence-reading-surface,.cs-reader .study-paragraph{transition:none}}
.cs-reader .study-word:not(.is-masked){user-select:text;-webkit-user-select:text}

.cs-reader .study-word:focus-visible{outline:2px solid var(--blue);outline-offset:2px}

.reader-option-actions .reader-listen-word { padding-inline: 6px; font-size: 11px; }
.reader-listen-word[hidden] { display: none; }
.reader-material-extras {
  padding: 10px 12px;
  margin: 8px 0 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
}
.reader-material-extras summary { cursor: pointer; color: var(--blue); }
.reader-material-extras p { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.reader-quiz { margin: 8px 0 0; padding-inline-start: 20px; }
.reader-quiz > li + li { margin-top: 12px; }
.study-translation.is-paragraph-translation { padding-top: 6px; }
.study-translation small { display: block; font-size: 10px; color: var(--faint); }
.cs-reader .study-source-label { flex: none; color: var(--muted); }
.cs-reader .study-audio-time:not([hidden]) { display: flex; gap: 8px; align-items: center; }
.cs-reader .study-transport [data-player="reload"][hidden] { display: none; }
.cs-reader .study-transport [data-player="previous"] { grid-column: 2; }
.cs-reader .study-transport [data-player="play"] { grid-column: 3; }
.cs-reader .study-transport [data-player="next"] { grid-column: 4; }
.cs-reader .study-transport [data-player="reload"] { grid-column: 1; }
@media (max-width: 700px), (pointer: coarse) {
  .cs-reader .study-transport [data-player]:not([data-player="reload"]) {
    min-width: 48px;
    min-height: 48px;
    height: 48px;
  }
  .cs-reader .study-transport [data-player="previous"] .icon,
  .cs-reader .study-transport [data-player="next"] .icon { width: 26px; height: 26px; }
  .cs-reader .study-transport .study-play .icon { width: 29px; height: 29px; }
}

.cs-reader .study-timeline > input[hidden] { display: none; }
.cs-reader .study-audio-time button {
  min-height: 26px;
  padding-inline: 4px;
  color: var(--blue);
}

/* Media feedback belongs to the article, above the reading surface. */
.cs-reader .reader-audio-status {
  flex: 0 0 auto;
  align-self: flex-end;
  max-width: calc(100% - 24px);
  margin: 0 12px 3px;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--soft);
  color: var(--blue);
  font-size: 11px;
  line-height: 1.5;
  text-align: right;
}

.reader-options-popover label + label { margin-top: 8px; }
.reader-options-popover input[type=checkbox] { accent-color: var(--blue); }
.cs-reader .study-original { -webkit-touch-callout: none; touch-action: pan-y; }
.cs-reader .study-word:not(.is-masked) { user-select: none; -webkit-user-select: none; }
.study-word[data-cs-phrase] { text-decoration: underline dotted var(--blue); text-underline-offset: .2em; }
.cs-reader .study-word.is-phrase-selected { background: var(--soft); color: var(--blue); border-radius: 3px; }
.reader-selection {
  display: flex;
  align-items: center;
  position: absolute;
  top: 44px;
  inset-inline: 12px;
  z-index: 6;
  gap: 5px;
  padding: 0 5px 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}
.reader-selection[hidden] { display: none; }
.reader-selection span { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-selection button { min-height: 38px; min-width: 36px; color: var(--blue); font-size: 12px; }
.reader-selection button:disabled { opacity: .5; }
.reader-selection .icon { width: 15px; height: 15px; }

/* 1.2: compact composition, separate review and visible date structure. */
#nav{grid-template-columns:repeat(6,minmax(0,1fr));padding-inline:6px}
#nav button{min-width:0;padding:7px 0 5px;min-height:48px;gap:3px}
#nav .icon{width:21px;height:21px}#nav span{font-size:10px}
.day-strip{--day-gap:0px}
.day-column,body.light .day-column{border-right:0;padding:0 5px}
.day-column:first-child{border-left:0}
.day-heading,body.light .day-heading{border-bottom:0;margin-bottom:8px;min-height:34px;padding-bottom:4px}
.day-body{padding-top:0}.day-card,body.light .day-card{padding:10px 7px;border-radius:8px}
.entry-date{display:flex;align-items:baseline;justify-content:space-between;font-size:12px;font-weight:500;color:var(--muted);margin:14px 1px 7px}
.entry-date:first-child{margin-top:2px}.entry-date span{font-size:10px;color:var(--faint)}
.sentence-reading-surface{opacity:calc(1 - .45 * var(--sentence-swipe));transform:none;clip-path:inset(0 calc(max(50%,176px) * var(--sentence-swipe)) 0 0);transition:opacity .16s,clip-path .16s}
.sentence-action-rail{inset:0 0 0 auto;width:max(50%,176px);display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;padding:0;background:var(--panel);clip-path:none;transform:translateX(calc(100% * (1 - var(--sentence-swipe))));transition:transform .16s;opacity:1;border-radius:0 6px 6px 0}
.study-sentence.is-swiping .sentence-action-rail{transition:none}
.sentence-action-rail>button{min-width:44px;width:100%;padding:8px 0;gap:6px;font-size:10px;align-items:center;justify-content:center;border-radius:0}
.sentence-action-rail .icon{width:18px;height:18px}
/* Material sheet actions and paired fields share a baseline. */
#sheet:has(.material-composer) {
  --composer-gutter: 16px;
  --composer-head-top: 20px;
  --composer-action: 34px;
  padding: var(--composer-head-top) var(--composer-gutter) calc(16px + env(safe-area-inset-bottom));
}
#sheet:has(.material-composer) .close-sheet {
  top: var(--composer-head-top);
  right: var(--composer-gutter);
  width: var(--composer-action);
  height: var(--composer-action);
  min-width: var(--composer-action);
  min-height: var(--composer-action);
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--ui-control-radius);
}
.composer-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--composer-action);
  padding-right: calc(var(--composer-action) + 8px);
  margin-bottom: 12px;
}
#sheet-body .composer-heading h2 {
  flex: 1;
  margin: 0;
  padding: 0;
  font-size: 20px;
  line-height: 1.25;
}
.material-composer .file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: var(--composer-action);
  min-height: var(--composer-action);
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--ui-control-radius);
  font-size: 12px;
  white-space: nowrap;
}
.material-composer .file-button .icon { width: 14px; height: 14px; }
.composer-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(113px, 38%);
  align-items: start;
  gap: 8px;
  margin-bottom: 12px;
}
.material-composer .draft-label {
  display: block;
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 16px;
}
.material-composer .draft-label span,
.translation-editor summary span {
  margin-left: 4px;
  color: var(--faint);
  font-size: 10px;
}
.material-composer .draft-input {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 18px;
  border-radius: var(--ui-control-radius);
}
.composer-fields .draft-input {
  height: 38px;
  min-height: 38px;
}
.composer-fields input::-webkit-date-and-time-value {
  margin: 0;
  text-align: left;
}
.material-composer #draft-text { height: 114px; resize: vertical; }
.material-composer #draft-translation { height: 74px; }
.material-composer .translation-editor {
  margin: 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--ui-control-radius);
}
.material-composer .translation-editor summary {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 34px;
  cursor: pointer;
}
.material-composer .translation-editor .draft-input {
  width: calc(100% - 16px);
  margin: 0 8px 8px;
}
.material-composer .primary {
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 14px;
}
.composer-hint{font-size:10px;color:var(--muted);margin:5px 0}
.review-page{padding-top:4px}
.review-categories{display:flex;gap:4px;background:var(--panel);padding:3px;border-radius:10px;margin-bottom:15px}
.review-categories button{flex:1;min-height:34px;font-size:13px;border-radius:7px;color:var(--muted);display:flex;align-items:center;justify-content:center;gap:8px}
.review-categories button[aria-pressed=true]{background:var(--soft);color:var(--blue)}
.review-categories small{font-size:10px;opacity:.8}
.review-today{border-radius:16px;background:var(--panel);padding:15px}
.review-today-heading{display:flex;align-items:baseline;justify-content:space-between;font-size:13px}
.review-today-heading time{font-size:11px;color:var(--muted)}
.review-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:17px 0 15px}
.review-metrics>div{display:flex;flex-direction:column;gap:5px}
.review-metrics strong{font-size:28px;font-weight:600;line-height:1.1;letter-spacing:-1px;font-variant-numeric:tabular-nums}
.review-metrics>div:first-child strong{color:var(--blue)}
.review-metrics span{font-size:11px;color:var(--muted)}
.review-page progress{appearance:none;display:block;width:100%;height:3px;border:0;border-radius:4px;background:var(--panel2);margin:0 0 16px;overflow:hidden}
.review-page progress::-webkit-progress-bar{background:var(--panel2)}
.review-page progress::-webkit-progress-value{background:var(--blue);border-radius:4px}
.review-page progress::-moz-progress-bar{background:var(--blue)}
.review-today .primary{min-height:40px;padding:9px 12px;font-size:13px;border-radius:9px;display:flex;justify-content:center;align-items:center;gap:9px}
.review-today .primary:disabled{background:var(--soft);color:var(--blue);opacity:.8}
/* Review entries are separate hit targets with shared column guides. */
.review-list-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 16px 0 6px;
}
.review-list-title h2 { margin: 0; font-size: 15px; }
.review-list-title span { color: var(--muted); font-size: 11px; }
.review-list-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--ui-card-radius);
  background: var(--panel);
  text-align: left;
}
.review-list-row + .review-list-row { margin-top: 6px; }
.review-list-row .study-pair { align-items: center; }
.review-list-row strong { font-size: 14px; font-weight: 600; line-height: 1.4; }
.review-list-row .study-zh { font-size: 13px; line-height: 1.4; }
.review-list-row time { color: var(--faint); font-size: 10px; line-height: 1.3; }
.review-list-row:active { background: var(--soft); }
.recall-card{background:var(--panel);padding:22px 19px;border-radius:16px;margin-top:18px;min-height:245px;display:flex;flex-direction:column;align-items:stretch}
.recall-label{font-size:11px;color:var(--muted)}
.recall-card h2{font-size:25px;line-height:1.5;letter-spacing:-.3px;margin:23px 0;overflow-wrap:anywhere;font-weight:550}
.recall-card h2[lang=en],.recall-answer p{font-family:Georgia,serif}
.recall-reveal{display:flex;gap:6px;align-items:center;justify-content:center;color:var(--blue);background:var(--soft);min-height:40px;border-radius:9px;margin-top:auto;font-size:13px}
.recall-reveal .icon{width:17px;height:17px}
.recall-answer>span{font-size:10px;color:var(--muted)}.recall-answer p{font-size:23px;line-height:1.45;color:var(--blue);margin:8px 0 10px;overflow-wrap:anywhere}
.recall-answer small{font-size:12px;line-height:1.7;display:block;color:var(--muted);margin-top:6px}
.recall-ratings{display:flex;gap:10px;margin-top:12px}
.recall-ratings button{flex:1;min-height:60px;border-radius:11px;background:var(--panel);font-size:13px}
.recall-ratings button:last-child{background:var(--soft);color:var(--blue)}
.recall-ratings small{display:block;font-size:10px;margin-top:5px;opacity:.7}
.review-empty,.review-complete{text-align:center;padding:35px 10px;color:var(--muted)}
.review-empty>.icon,.review-complete>.icon{width:34px;height:34px;color:var(--blue);margin-bottom:12px}
.review-empty p{font-size:12px;margin-bottom:12px}.review-complete h2{font-size:23px;color:var(--ink);margin:10px 0}.review-complete p{font-size:13px;margin:12px 0 30px}
@media(max-width:380px){.recall-card{padding:19px 16px}.sentence-action-rail>button{font-size:10px}}

.sentence-action-rail{color:var(--ink)}



/* Shared spacing and control geometry for the primary screens. */
:root {
  --ui-gutter: 16px;
  --ui-control-height: 34px;
  --ui-control-radius: 8px;
  --ui-card-radius: 11px;
}
.page.v12-page { padding: 0 var(--ui-gutter) 16px; }
.v12-page .compact-topbar {
  height: 48px;
  min-height: 48px;
  margin-bottom: 8px;
  gap: 8px;
}
.v12-page .compact-topbar .brand { width: 32px; min-width: 32px; }
.v12-page .compact-actions .v12-icon {
  width: 36px;
  height: 36px;
}
.v12-page .v12-search { margin-bottom: 8px; }
#page-header[data-view="calendar"] .calendar-controls { gap: 8px; margin: 0; }
#page-header[data-view="calendar"] .calendar-nav,
#page-header[data-view="calendar"] .calendar-controls .calendar-switch {
  min-height: var(--ui-control-height);
  border: 1px solid var(--line);
  border-radius: var(--ui-control-radius);
  background: var(--panel);
}
#page-header[data-view="calendar"] .calendar-nav {
  display: inline-grid;
  grid-template-columns: 28px minmax(42px, auto) 28px;
  align-items: stretch;
  overflow: hidden;
}
#page-header[data-view="calendar"] .calendar-nav .v12-icon,
#page-header[data-view="calendar"] .calendar-nav .v12-pill {
  width: 100%;
  height: calc(var(--ui-control-height) - 2px);
  min-height: 0;
  padding: 0 4px;
  border-radius: 0;
}
.calendar-nav .v12-pill {
  border-inline: 0;
  font-size: 12px;
  white-space: nowrap;
}
#page-header[data-view="calendar"] .calendar-controls .calendar-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 7px;
  font-size: 12px;
  white-space: nowrap;
}
#page-header[data-view="calendar"] .calendar-controls .calendar-switch[aria-pressed=true] {
  background: var(--soft);
  color: var(--blue);
}
.calendar-switch .icon { width: 14px; height: 14px; }
@media (max-width: 360px) {
  :root { --ui-gutter: 12px; }
  #page-header[data-view="calendar"] .calendar-controls { gap: 6px; }
}

/* Chat and learning share the same guides and panel treatment. */
#screen > .ai-page { padding-inline: var(--ui-gutter); }
.v12-materials {
  display: grid;
  gap: 6px;
}
.v12-materials .material-row {
  width: 100%;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--ui-card-radius);
  background: var(--panel);
}
.v12-materials .material-row:active { background: var(--soft); }



/* Persistent shell. Only the workspace below the header owns page scroll. */
#page-header {
  flex: none;
  padding: 2px var(--ui-gutter) 8px;
  background: var(--bg);
}
#page-header[hidden] { display: none; }
#page-header > .compact-topbar {
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0;
  gap: 8px;
}
#page-header .compact-actions .v12-icon { width: 36px; height: 36px; }
#screen { scroll-behavior: auto; }
#app > #nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: stretch;
}
#app > #nav button { min-width: 0; }
.review-session-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 22px;
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* v1.2: CS calendar and proficiency controls */
.calendar-page .v12-search{flex:none;min-height:34px;margin:0 0 7px}
.calendar-month{flex:none;font-size:11px;line-height:22px;margin:0 0 4px;color:var(--muted)}
.day-strip{--day-gap:8px;grid-auto-columns:calc((100% - 16px)/3);gap:8px;overflow-y:hidden}
.day-column,body.light .day-column{display:flex;flex-direction:column;min-height:0;padding:0;border:1px solid var(--line);border-radius:7px;background:color-mix(in srgb,var(--panel) 35%,var(--bg))}
.day-column:first-child{border-left:0}
.day-heading,body.light .day-heading,.is-today .day-heading,body.light .is-today .day-heading{display:flex;align-items:center;min-height:36px;padding:4px 3px;margin:0;border:0;gap:0;border-radius:6px 6px 0 0;flex:none}
.day-date{gap:3px;min-height:24px;padding:3px 2px}
.day-heading span{margin:0;font-size:10px;line-height:18px}
.day-heading time{font-size:9px;letter-spacing:0;line-height:18px;font-weight:400}
.day-add{position:static;margin-left:auto;flex:none;width:22px;height:28px;min-width:22px;padding:2px}
.day-add .icon{width:13px;height:13px}
.day-body{display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;gap:6px;padding:0 4px 6px;scrollbar-width:none}
.day-card,body.light .day-card{flex:none;gap:6px;min-height:0;padding:8px 6px;border:0;border-radius:6px;background:var(--panel)}
body.light .day-card{background:#fff}
.day-card strong{display:block;font-size:13px;line-height:1.5;font-weight:600;max-height:6em;overflow:hidden;letter-spacing:-.15px}
.day-card p{display:block;max-height:4.65em;overflow:hidden;font-size:11px;line-height:1.5;margin:0;color:var(--muted)}
.day-card-type{display:flex;align-items:center;gap:3px;font-size:10px;line-height:15px;color:var(--blue)}
.day-card-type .icon{width:12px;height:12px;flex:none}
.day-card footer{display:flex;width:100%;align-items:center;justify-content:space-between;font-size:10px;color:var(--muted);line-height:15px}
.day-card footer small{font-size:9px;background:var(--soft);color:var(--blue);padding:0 3px;border-radius:3px}
.day-empty{display:grid;place-items:center;flex:none;width:100%;min-height:54px;padding:0;background:var(--panel);border-radius:6px;color:var(--faint)}
.day-empty .icon{width:18px;height:18px}
.day-more{min-height:34px;font-size:10px;color:var(--blue);flex:none}
.calendar-empty{grid-column:1 / span 3;color:var(--muted);font-size:12px}
/* Filters, sort and add share one compact control rail. */
.v12-page .library-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.v12-page .library-controls .v12-filters { gap: 1px; margin: 0; }
.v12-page .library-controls .v12-filters button {
  height: 30px;
  min-height: 30px;
  padding: 0 6px;
  border-radius: 7px;
  font-size: 11px;
  white-space: nowrap;
}
.v12-page .library-controls .p-sort {
  flex: 0 1 100px;
  min-width: 66px;
  max-width: 100px;
  height: 30px;
  min-height: 30px;
  margin-left: auto;
  padding: 0 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
}
.v12-page .library-controls .v12-icon {
  flex: 0 0 30px;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 7px;
}
.v12-page .library-controls .v12-icon .icon { width: 16px; height: 16px; }
@media (max-width: 340px) {
  .v12-page .library-controls .v12-filters button { padding-inline: 4px; }
}
.p-sort option{background:var(--panel);color:var(--ink)}
.v12-entries{gap:7px}
#personal-entries { display: grid; gap: 6px; }
.v12-entry.proficiency-entry {
  display: flex;
  align-items: stretch;
  min-height: 48px;
  padding: 0;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--ui-card-radius);
}
.proficiency-entry .p-adjust { width: 32px; font-size: 18px; }
.proficiency-entry .p-main { display: flex; align-items: center; padding: 7px 0; }
.proficiency-entry .study-pair { align-items: center; }
.proficiency-entry .p-description {
  display: block;
  width: 100%;
  min-height: 22px;
  margin: 0;
  line-height: 1.45;
}
.proficiency-entry .p-description:empty { display: none; }
.p-adjust{flex:none;align-self:stretch;width:44px;min-height:44px;display:grid;place-items:center;font-size:22px;font-weight:400;color:var(--blue);border-radius:10px;background:transparent;touch-action:manipulation}
.p-adjust:active{background:var(--soft)}
.p-adjust:disabled{color:var(--faint);opacity:.35}
.p-main{min-width:0;flex:1;padding:11px 0}
.p-title{display:flex;align-items:flex-start;gap:5px}
.p-open{flex:1;text-align:left;min-width:0;padding:0}
.p-open strong{display:block;font-size:15px;font-weight:650;line-height:1.4;overflow-wrap:anywhere}
.p-badge{font-size:11px;font-variant-numeric:tabular-nums;font-weight:550;color:var(--muted);padding:0;min-width:29px;min-height:23px;flex:none;white-space:nowrap;text-align:right}
.p-badge.is-mastered{color:var(--blue)}
.p-description{display:flex;flex-direction:column;gap:3px;text-align:left;padding:0;margin-top:3px;width:100%;color:var(--muted);font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.p-description:empty{display:none}
.p-description .entry-correction{display:flex;align-items:baseline;gap:4px;color:var(--blue)}
.p-description small{font-size:11px;line-height:1.5}
.entry-date {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 5px 0 -2px;
  padding: 0 1px;
  color: var(--muted);
  font-size: 11px;
  line-height: 16px;
  font-weight: 550;
}
.entry-date:first-child { margin-top: 0; }
.entry-date span { color: var(--faint); font-size: 10px; font-weight: 400; }
.inline-dictionary{padding-top:14px}
.inline-dictionary h2{display:flex;align-items:baseline;gap:7px;font-size:13px;font-weight:600;margin:0 0 6px}
.inline-dictionary h2 small{font-size:10px;color:var(--faint);font-weight:400}
.inline-dictionary .word-row{min-height:60px;padding:10px 4px}
.inline-dictionary .word-row strong{font-size:16px}
.inline-dictionary .word-row p{font-size:12px;line-height:1.5}
.inline-more{width:100%;min-height:40px;color:var(--blue);font-size:12px}
.p-rules p{font-size:12px;line-height:1.7;color:var(--muted);margin:10px 0}
.p-intervals{display:grid;grid-template-columns:1fr 1fr;gap:7px 16px;padding:12px 14px;background:var(--bg);border-radius:10px;font-size:12px}
.p-intervals span:nth-child(odd){color:var(--blue)}
.p-intervals span:nth-child(even){text-align:right;color:var(--muted)}
.p-adjust:focus-visible,.p-badge:focus-visible,.p-open:focus-visible,.p-description:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}

.inline-dictionary .word-row{border:0}.inline-dictionary .word-row small{font-size:12px;line-height:1.5}


.official-entry{display:inline-flex;align-items:center;gap:5px;min-height:44px;padding:0 2px;color:var(--blue);background:none;border:0;font-size:13px;white-space:nowrap}.official-entry svg{width:17px;height:17px}
.library-controls .p-sort{max-width:88px;font-size:11px;padding:6px 2px}.library-controls .v12-icon{width:32px;min-width:32px;height:44px;padding:5px}.library-controls{gap:4px}.library-controls .v12-filters{gap:1px}.library-controls .v12-filters button{padding:7px 8px}
.official-page .v12-topbar,.official-page header{margin-bottom:12px}.official-version{font-size:11px;font-weight:500;color:var(--muted,#9aa1ae);margin-left:5px}
.official-page .filters{margin:10px 0;gap:8px}.official-page .count-label{margin:8px 0}.official-page .word-row{padding:12px 10px}
.official-pronunciation{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:8px 0 12px;font-size:12px}.official-sound{display:inline-flex;gap:5px;align-items:center;min-height:40px;border:0;background:var(--surface,#222427);border-radius:8px;color:var(--text,#edf0f5);padding:7px 9px;max-width:100%;text-align:left}.official-sound svg{width:16px;height:16px}.official-sound small{font-size:10px;color:var(--muted,#9aa1ae)}.official-sound.playing{color:var(--accent,#9dbaff);background:#29344f}.official-accent{color:var(--muted,#9aa1ae)}.meaning-heading{gap:8px}
.dictionary-missing{display:flex;flex-direction:column;gap:8px;padding:12px 0;font-size:12px;color:var(--muted,#9aa1ae)}.dictionary-missing button{display:flex;justify-content:space-between;align-items:center;min-height:44px;border:0;border-radius:10px;background:var(--surface,#222427);color:var(--accent,#9dbaff);padding:10px 12px;font-size:13px}.dictionary-missing svg{height:16px;width:16px}.candidate-state{font-size:12px;color:var(--accent,#9dbaff);margin:8px 0 16px}.word-source a{color:var(--accent,#9dbaff)}.official-page .v12-topbar h1{font-size:19px}

#sheet-body{overflow-wrap:anywhere}.official-page .word-row>div{min-width:0;overflow-wrap:anywhere}

.review-word-lookup{font:inherit;color:inherit;background:none;border:0;padding:0;text-align:left;cursor:pointer}


/* Word > meaning > usage > example, with smaller spacing inside each level. */
#sheet-body .word-hero h2{font-size:29px;line-height:1.2;font-weight:650;margin:0 0 7px;padding-right:36px;letter-spacing:-.6px}
.word-hero{margin-bottom:16px}
.word-hero .official-pronunciation{margin:0;gap:4px 10px}
.meaning-index{margin:0 0 14px;gap:6px;padding-bottom:2px}
.meaning-index button{padding:6px 10px;line-height:1.4}
.meaning-group{border:0;padding:0;margin:0}
.meaning-group+.meaning-group{margin-top:24px}
.meaning-heading{align-items:center;margin:0 0 4px;gap:8px}
.meaning-heading h3{font-size:18px;font-weight:650;line-height:1.45;padding:0}
.meaning-heading h3 small{display:inline;margin:0 9px 0 0;font-size:11px;font-weight:400;color:var(--muted)}
.meaning-group .official-pronunciation{margin:0 0 8px}
.meaning-group .usage{padding-left:12px;margin-top:12px}
.meaning-group .usage+.usage{margin-top:20px}
.usage-heading{display:flex;align-items:baseline;gap:10px}
.usage-heading h4{flex:1;min-width:0;margin:0;font-size:16px;line-height:1.55;font-weight:650}
.usage-meta{flex-shrink:0;font-size:10px;color:var(--muted);font-weight:400}
.usage .usage-translation{font-size:13px;line-height:1.6;margin-top:3px;color:var(--ink)}
.usage .usage-context{font-size:12px!important;line-height:1.7;margin-top:7px!important;color:var(--muted)}
.usage .example{margin:10px 0 0;padding:12px 14px;border-radius:10px}
.usage .example p{font-family:Georgia,serif;font-size:17px;line-height:1.55;font-weight:400;margin:0 0 7px}
.usage .example small{font-size:12px;line-height:1.65}
.word-provenance{padding-top:0;margin-top:20px;font-size:11px}
.word-provenance>summary{display:flex;align-items:center;min-height:44px;gap:6px;cursor:pointer}
.word-provenance>summary:before{content:'›';display:inline-block;font-size:16px}
.word-provenance[open]>summary:before{transform:rotate(90deg)}
.word-provenance p{margin:8px 0;line-height:1.7}
.pronunciation-credits h4{font-size:12px;margin:14px 0 4px}



/* Date layout and bilingual study rows. */
.day-strip.six-day-grid {
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  scroll-snap-type: none;
  gap: 8px;
}
.six-day-grid .day-column { max-height: 100%; min-width: 0; min-height: 0; }
.six-day-grid .day-heading { flex: 0 0 auto; }
.six-day-grid .day-body { min-height: 0; }
.study-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 0;
  width: 100%;
  min-width: 0;
  text-align: left;
}
.study-en, .study-zh {
  min-width: 0;
  overflow-wrap: anywhere;
}
.study-en { padding-right: 9px; }
.study-zh {
  border-left: 0;
  padding-left: 9px;
  color: var(--muted);
}
.study-zh small { display: block; margin-top: 4px; }
.official-page .compact-topbar { margin-bottom: 4px; }
.official-page .compact-actions .v12-icon { width: 34px; height: 34px; }
.official-page .search { margin: 0 0 6px; height: 40px; min-height: 40px; }
.official-page .filters { margin: 0 0 7px; gap: 6px; }
.official-page .filters select { height: 35px; min-height: 35px; padding-block: 4px; font-size: 12px; }
.official-page .count-label { margin: 5px 0 7px; }
.dictionary-list { display: block; }
.dictionary-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: stretch;
  min-height: 44px;
}
.dictionary-row + .dictionary-row { border-top: 0; }
.dictionary-row .p-adjust { width: 100%; min-width: 0; min-height: 44px; }
.dictionary-row .dictionary-pair {
  display: flex;
  align-items: center;
  margin: 0;
  min-height: 44px;
  width: 100%;
  padding: 8px 3px;
  border: 0;
  text-align: left;
}
.dictionary-pair strong { display: block; margin: 0; font-size: 15px; line-height: 1.4; }
.dictionary-pair .study-zh { font-size: 12px; line-height: 1.55; }
.dictionary-pair .study-pair { align-items: center; }
.dictionary-end { height: 1px; }
.review-list-row .study-zh time { display: block; margin-top: 2px; }
.recall-card { min-height: 0; padding: 14px 16px; margin-top: 12px; }
.recall-card .study-pair { align-items: center; }
.recall-card h2 { font-size: 19px; line-height: 1.35; margin: 0; }
.recall-card .study-en small { display: block; margin-top: 5px; color: var(--muted); }
.recall-card .study-zh { min-height: 0; }
.recall-card .recall-answer { margin: 0; padding: 0; border: 0; }
.recall-card .recall-reveal { margin: 0; min-height: 40px; width: 100%; }
.review-page .recall-ratings { margin-top: 12px; }
.study-loop select {
  font: inherit;
  color: var(--ink);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px 6px;
}

.dictionary-pair .study-zh > span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}
.recall-answer .review-word-lookup {
  display: block;
  min-height: 32px;
  padding: 4px 0;
  margin-top: 4px;
  color: var(--blue);
  font-size: 12px;
}


/* Reserve the top of each right-side action column for proficiency. */
.proficiency-entry .study-row-actions { flex: 0 0 32px; }
.study-row-actions {
  display: grid;
  grid-template-rows: 22px minmax(32px, 1fr);
  align-self: stretch;
}
.study-row-actions > .p-adjust {
  grid-row: 2;
  width: 100%;
  height: 100%;
  min-height: 32px;
}
.study-row-score {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}
.study-row-actions > .study-row-score {
  grid-row: 1;
  min-width: 24px;
  min-height: 20px;
  margin: 0;
  padding: 0 3px;
}
.study-row-score.dictionary-p[data-saved=false] { color: var(--faint); }
.review-list-row,
.recall-card { position: relative; }
.review-list-row .review-score,
.recall-card .review-score {
  position: absolute;
  top: 6px;
  right: 8px;
  min-width: 22px;
  height: 16px;
}
.review-list-row .study-zh,
.recall-card .study-zh { padding-right: 24px; }

.proficiency-entry {
  background: color-mix(in srgb, var(--panel), #b83e48 var(--p-tint, 0%));
}
.light .proficiency-entry {
  background: color-mix(in srgb, var(--panel), #ef7280 var(--p-tint, 0%));
}
.proficiency-entry .study-row-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.proficiency-entry .study-row-actions > .p-adjust {
  align-self: center;
  height: 32px;
}
.proficiency-entry .study-row-actions > .study-row-score {
  position: absolute;
  z-index: 1;
  top: 2px;
  right: 3px;
  height: 18px;
}
.v12-entry.proficiency-entry { min-height: 54px; }

/* Dictionary detail. A single unobtrusive vertical scroll surface serves long entries. */
#sheet.dictionary-detail {
  position: fixed;
  inset: 0;
  z-index: 30;
  height: fit-content;
  width: min(520px, calc(100% - 24px));
  max-height: calc(100dvh - 2 * max(12px, env(safe-area-inset-top), env(safe-area-inset-bottom)));
  margin: auto;
  padding: 15px 16px 12px;
  border-radius: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: none;
  scroll-padding-block: 12px;
}
#sheet.dictionary-detail::backdrop { background: transparent; backdrop-filter: none; }
#sheet.dictionary-detail::-webkit-scrollbar { display: none; }
#sheet.dictionary-detail .sheet-handle { display: none; }
#sheet.dictionary-detail .close-sheet { top: 15px; right: 7px; width: 40px; height: 40px; }
#sheet.dictionary-detail .word-hero { margin-bottom: 10px; }
#sheet.dictionary-detail .word-hero h2 { font-size: 27px; margin: 0 0 3px; }
#sheet.dictionary-detail .word-hero .official-sound { min-height: 32px; }
#sheet.dictionary-detail .meaning-index {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  overflow: visible;
  margin: 0 0 10px;
  padding: 0;
}
#sheet.dictionary-detail .meaning-index button {
  white-space: normal;
  min-width: 0;
  min-height: 30px;
  max-width: 100%;
  padding: 4px 8px;
  font-size: 12px;
  overflow-wrap: anywhere;
  text-align: left;
}
#sheet.dictionary-detail .meaning-group + .meaning-group {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 0;
}
#sheet.dictionary-detail .meaning-heading { margin: 0; gap: 6px; }
#sheet.dictionary-detail .meaning-heading h3 { font-size: 16px; }
#sheet.dictionary-detail .meaning-heading .icon-button { width: 36px; min-width: 36px; height: 36px; }
#sheet.dictionary-detail .meaning-group .usage { padding-left: 0; margin-top: 5px; }
#sheet.dictionary-detail .meaning-group .usage + .usage { margin-top: 12px; }
#sheet.dictionary-detail .usage-heading h4 { font-size: 15px; line-height: 1.46; }
#sheet.dictionary-detail .usage .usage-context { margin-top: 4px !important; }
#sheet.dictionary-detail .usage .example { margin-top: 6px; padding: 8px 10px; }
#sheet.dictionary-detail .usage .example p { font-size: 16px; line-height: 1.46; margin-bottom: 3px; }
#sheet.dictionary-detail .word-provenance { margin-top: 10px; }
#sheet.dictionary-detail .word-provenance > summary { min-height: 36px; }

#sheet.dictionary-detail .word-hero {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 10px;
  min-height: 40px;
  padding-inline-end: 36px;
}
#sheet.dictionary-detail .word-hero h2 { margin: 0; padding: 0; min-width: 0; line-height: 1.2; }
#sheet.dictionary-detail .official-word-meta {
  display: inline-flex;
  align-items: center;
  align-self: center;
  flex-wrap: wrap;
  gap: 0 4px;
  margin: 0;
  min-width: 0;
  line-height: 1.45;
}
#sheet.dictionary-detail [data-lookup-text] { touch-action: pan-y; -webkit-touch-callout: none; }
#sheet.dictionary-detail .lookup-word {
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}
#sheet.dictionary-detail .lookup-word:focus-visible { outline: 1px solid var(--blue); outline-offset: 2px; }
#sheet.dictionary-detail .lookup-word.is-lookup-selected { background: var(--soft); color: var(--blue); }
.dictionary-detail #sheet-title:focus { outline: none; }
.dictionary-detail .word-hero-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 6px;
  min-width: 0;
  max-width: 100%;
}
.dictionary-detail .word-hero .official-pronunciation { font-size: 12px; }
.dictionary-detail .word-save {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 40px;
  color: var(--blue);
  border-radius: 8px;
}
.dictionary-detail .word-save .icon { width: 19px; height: 19px; }
.dictionary-detail .word-save[aria-pressed="true"] .icon { fill: currentColor; }
#sheet.dictionary-detail .close-sheet {
  border-radius: 8px;
}
#sheet.dictionary-detail .close-sheet:focus-visible {
  outline: none;
  background: var(--panel2);
  color: var(--ink);
}

.word-api-origin {
  margin-inline-start: 2px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

#sheet.dictionary-detail .word-system-speech[hidden],
#sheet.dictionary-detail .word-hero [data-word-sound-slot]:empty { display: none; }

.site-filing {
  display: none;
  flex: 0 0 auto;
  padding: 4px 12px 6px;
  background: var(--nav);
  text-align: center;
  font-size: 11px;
  line-height: 16px;
}
.site-filing a, .filing-link {
  color: var(--muted);
  text-decoration: none;
}
.site-filing a:hover, .filing-link:hover { text-decoration: underline; }
.filing-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.police-filing-link { display: inline-flex; align-items: center; gap: 5px; }
.police-filing-icon { flex: none; width: 16px; height: 18px; object-fit: contain; }
.settings-filing {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.settings-filing .filing-link {
  min-height: 42px;
  align-items: center;
  padding-inline: 9px;
  border-radius: 0;
}
.settings-filing .filing-link:not(.police-filing-link) { padding-inline-start: 30px; }
.settings-filing .drawer-row-label {
  font-size: clamp(10px, 3vw, 12px);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.settings-filing .police-filing-link { display: flex; }
.settings-filing .filing-link + .filing-link { border-top: 0; }
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) and (display-mode: browser) {
  body:not(.framed) .site-filing { display: block; }
}
@media (display-mode: standalone), (display-mode: fullscreen), (display-mode: minimal-ui), (display-mode: window-controls-overlay) {
  .site-filing { display: none; }
}
.standalone-app body:not(.framed) .site-filing { display: none; }
#session-check {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}
body:not(.session-ready) #app { display: none; }
.session-ready #session-check { display: none; }
.account-page {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  background: var(--bg);
}
.account-page [hidden] { display: none !important; }
.account-main {
  display: grid;
  align-content: center;
  flex: 1;
  width: min(100%, 440px);
  margin-inline: auto;
  padding: max(34px, env(safe-area-inset-top)) 24px 36px;
}
.account-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 9px;
  margin: 0 0 18px 2px;
  color: var(--ink);
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
}
.account-card {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
}
.account-card h1 { margin: 0; font-size: 26px; line-height: 1.25; }
#account-caption { margin: 8px 0 21px; color: var(--muted); font-size: 13px; }
.account-card fieldset { display: grid; gap: 12px; min-width: 0; border: 0; padding: 0; }
.account-card label { display: grid; gap: 6px; font-size: 13px; }
.account-card input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}
.account-card .account-primary {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 3px;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: #3663cb;
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}
.account-card button:disabled { opacity: .62; cursor: wait; }
.account-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: 7px; }
.account-links button, .account-links a, #account-signout {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--blue);
  font-size: 13px;
  text-decoration: none;
}
#account-signout { margin-top: 8px; }
#account-feedback { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
#account-feedback:not(:empty) { margin-top: 9px; }
#account-feedback[data-error] { color: #f49c97; }
.light #account-feedback[data-error] { color: #ab282c; }
@media (max-width: 359px) {
  .account-main { padding-inline: 16px; }
  .account-card { padding: 20px; }
}

.settings-sync-error { color: var(--ink); }
.settings-sync-conflict {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 0;
}
.settings-sync-conflict h3 { margin: 0 0 6px; font-size: 14px; }
.settings-sync-conflict p, .settings-sync-conflict summary { font-size: 12px; line-height: 1.6; }
.settings-sync-conflict summary { min-height: 32px; padding-block: 6px; color: var(--blue); cursor: pointer; }
.settings-sync-conflict pre { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
.sync-choices { display: grid; gap: 6px; margin-top: 8px; }
.sync-choices button {
  min-height: 36px;
  border-radius: 8px;
  background: var(--panel);
  text-align: start;
  color: var(--blue);
  padding-inline: 10px;
}

.v12-entry.proficiency-entry { min-height: 70px; }
.proficiency-entry .study-row-actions { flex: 0 0 38px; }
.proficiency-entry .p-adjust { width: 38px; min-height: 44px; }
.proficiency-entry .study-row-score.p-badge {
  min-width: 34px;
  min-height: 30px;
  padding-inline: 4px;
  display: grid;
  align-items: start;
  justify-content: end;
}
.ai-meta button { min-height: 32px; padding-inline: 10px; }
.ai-composer .ai-send { min-width: 44px; min-height: 44px; }
.chat-state button { min-height: 32px; }

@media (min-width: 1024px) {
  body:not(.framed) #app {
    width: calc(100% - 48px);
    max-width: 1080px;
  }
  body:not(.framed) #page-header .compact-topbar {
    width: min(100%, 940px);
    margin-inline: auto;
    padding-inline: 24px;
  }
  body:not(.framed) .calendar-page .day-strip.six-day-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr);
  }
  body:not(.framed) .calendar-page .day-heading { padding-inline: 7px; }
  body:not(.framed) .calendar-page .day-card { padding: 10px 8px; }
  body:not(.framed) .calendar-page .day-card strong { font-size: 14px; }
  body:not(.framed) .calendar-page .day-card p { font-size: 12px; }
  body:not(.framed) #screen > .v12-page {
    width: min(100%, 940px);
    margin-inline: auto;
    padding-inline: 24px;
  }
  body:not(.framed) #screen > .reader-layout {
    width: min(100%, 820px);
    margin-inline: auto;
  }
  body:not(.framed) #screen > .ai-page {
    width: min(100%, 820px);
    margin-inline: auto;
    padding-inline: 24px;
  }
  body:not(.framed) .settings-drawer {
    left: max(24px, calc((100vw - 1080px) / 2)) !important;
    width: 380px;
  }
}


.reader-language-tools, .reader-practice-entry { display: flex; align-items: center; }
.reader-language-tools { gap: 8px; min-width: 0; }
.cs-reader .english-reading-modes button, .cs-reader .reader-listen-word { white-space: nowrap; }
.reader-practice-entry {
  gap: 6px;
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--blue) 32%, var(--line));
  border-radius: 7px;
  background: var(--soft);
  color: var(--blue);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.reader-practice-entry .icon { width: 15px; height: 15px; }
.reader-practice-entry:focus-visible, .reader-practice :is(button, select, input):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.reader-layout.practice-active > :not(.reader-practice) { display: none !important; }
.reader-practice {
  width: 100%;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  scrollbar-width: thin;
}
.practice-main {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px var(--workbench-gutter) 20px;
}
.practice-dock {
  flex: none;
  padding: 10px var(--workbench-gutter) 12px;
  border-top: 0;
  background: var(--bg);
}
.practice-context {
  max-height: min(23dvh, 144px);
  overflow: auto;
  margin-bottom: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.practice-context > div {
  display: grid;
  grid-template-columns: 2.5em minmax(0,1fr);
  gap: 8px;
  padding: 5px 9px;
  line-height: 1.45;
  align-items: baseline;
}
.practice-context > div + div { border-top: 0; }
.practice-context span { color: var(--muted); font-size: 12px; }
.practice-context p { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.reader-practice [hidden] { display: none !important; }
.practice-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.practice-head > div { min-width: 0; }
.practice-head h2 { margin: 0; font-size: 23px; font-weight: 680; line-height: 1.3; }
.practice-head h2:focus { outline: none; }
.practice-head p { color: var(--muted); font-size: 12px; margin: 4px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.practice-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; color: var(--muted); }
.practice-icon:not(:disabled):hover { color: var(--ink); background: var(--panel2); }
.practice-icon .icon { width: 17px; height: 17px; }
.practice-icon:disabled, .practice-primary:disabled { opacity: .47; }
.practice-modes { display: flex; width: fit-content; gap: 3px; padding: 3px; margin-top: 11px; border-radius: 10px; background: var(--bg); }
.practice-modes button { min-height: 34px; padding-inline: 13px; border-radius: 7px; color: var(--muted); font-size: 14px; }
.practice-modes button[aria-pressed=true] { color: var(--blue); background: var(--soft); font-weight: 650; }
.practice-audio { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 11px 12px 12px; }
.practice-audio-info { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.practice-audio-info span:first-child { flex: none; color: var(--ink); font-weight: 600; }
.practice-audio-info span:last-child { color: var(--muted); text-align: right; }
.practice-transport { display: grid; grid-template-columns: 44px minmax(0,1fr) 44px auto; gap: 8px; }
.practice-transport .practice-icon { width: 100%; height: 44px; border: 1px solid var(--line); }
.practice-transport .practice-primary { min-width: 0; }
.practice-transport .practice-primary span { overflow: hidden; text-overflow: ellipsis; }
.practice-primary, .practice-link, .practice-select { min-height: 44px; border-radius: 8px; font-size: 13px; }
.practice-primary { background: var(--soft); color: var(--blue); font-weight: 650; padding-inline: 12px; display: flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.practice-primary .icon { width: 15px; height: 15px; flex: none; }
.practice-primary.is-playing .icon { display: none; }
.practice-primary.is-playing::before { content: ''; width: 10px; height: 10px; border-radius: 2px; background: currentColor; }
.practice-link { color: var(--blue); padding-inline: 10px; }
.practice-link:hover { background: var(--panel2); }
.practice-select { display: flex; align-items: center; gap: 6px; padding-inline: 9px; border: 1px solid var(--line); color: var(--muted); background: var(--panel); }
.practice-select select { height: 42px; min-width: 0; border: 0; background: transparent; color: var(--ink); font-size: 13px; cursor: pointer; appearance: none; padding: 0 14px 0 3px; }
.practice-select { position: relative; }
.practice-select::after { content: ""; pointer-events: none; position: absolute; inset-inline-end: 8px; top: 17px; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.practice-select option { background: var(--panel); }
.practice-task { margin-top: 14px; }
.practice-task label { display: block; font-size: 13px; font-weight: 580; margin-bottom: 7px; }
.practice-task-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.practice-reference { padding: 10px 12px; border-radius: 0 8px 8px 0; border-inline-start: 0; background: var(--bg); overflow-wrap: anywhere; }
.practice-reference p[lang=en] { margin: 0; font: 21px/1.48 Georgia, serif; color: var(--ink); }
.practice-reference p[lang=zh-CN] { margin: 2px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
.practice-notice, .practice-instruction { color: var(--muted); font-size: 12px; line-height: 1.6; }
.practice-notice { margin: 9px 0 0; }
@media (max-width: 430px) {
  .reader-language-tools { gap: 5px; }
  .reader-practice-entry { padding-inline: 7px; gap: 4px; }
  .cs-reader .english-reader-options { padding-inline: 10px; }
  .cs-reader .english-reading-modes button { padding-inline: 5px; }
  .cs-reader .reader-option-actions .reader-follow span { display: none; }
  .practice-main { padding: 8px 14px 16px; }
  .practice-dock { padding: 8px 14px 10px; }
  .practice-context > div { padding: 4px 7px; }
  .practice-context p { font-size: 13px; }
  .practice-transport { grid-template-columns: 40px minmax(0,1fr) 40px auto; }
  .practice-select { padding-inline: 6px; gap: 3px; }
}
@media (max-width: 350px) {
  .cs-reader .english-reader-options { padding-inline: 8px; }
  .reader-language-tools { flex: none; gap: 4px; }
  .cs-reader .english-reading-modes button { padding-inline: 4px; }
  .cs-reader .reader-option-actions { gap: 1px; }
  .cs-reader .reader-option-actions > button { min-width: 27px; width: 27px; padding-inline: 0; }
  .cs-reader .reader-option-actions > .reader-listen-word { min-width: 33px; width: 33px; }
  .reader-practice-entry .icon { display: none; }
  .reader-practice-entry { padding-inline: 5px; }
  .reader-practice .practice-transport { gap: 5px; }
  .reader-practice .practice-primary { padding-inline: 7px; }
  .practice-transport .practice-select > span { display: none; }
}

.practice-waveforms { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; margin-top:10px; }
.practice-wave-row { min-width:0; }
.practice-wave-row > span { display:block; color:var(--muted); font-size:11px; margin-block-end:4px; }
.practice-wave-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; color:var(--muted); font-size:12px; }
.practice-gap-toggle { display:inline-flex; align-items:center; gap:7px; min-height:36px; color:var(--ink); cursor:pointer; }
.practice-gap-toggle input { width:16px; height:16px; margin:0; accent-color:var(--blue); }
.practice-gap-toggle:has(input:disabled) { color:var(--muted); cursor:default; }
.practice-waveforms[data-playing=true] [data-practice-part=wave-status] { color:var(--practice-wave-playhead); font-weight:650; }
.practice-waveforms canvas { display:block; width:100%; height:30px; border:1px solid var(--line); border-radius:8px; background:var(--panel); cursor:pointer; }
.practice-waveforms canvas[data-practice-wave=detail] { height:67px; touch-action:pan-y; cursor:crosshair; }
.practice-waveforms canvas:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.practice-wave-meta { color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; display:flex; align-items:center; justify-content:space-between; min-height:22px; }
.practice-wave-meta button { min-height:24px; }
@media (max-width:430px) {
  .practice-waveforms canvas { height:26px; }
  .practice-waveforms canvas[data-practice-wave=detail] { height:56px; }
}


.practice-progress { display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:12px; margin:13px 0; color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }
.practice-progress progress { width:100%; height:4px; accent-color:var(--blue); }
.practice-task-actions { margin-top:6px; }
.practice-link .icon { width:14px; height:14px; margin-inline-end:4px; vertical-align:middle; }
.practice-notice { min-height:18px; }

.practice-cloze-stage {
  margin-bottom: 14px;
  padding: 16px 18px 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.practice-cloze-meta { display:flex; align-items:center; justify-content:space-between; gap:10px; color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }
.practice-cloze-line { display:flex; flex-wrap:wrap; align-items:baseline; column-gap:.34em; row-gap:.28em; margin:15px 0 20px; min-height:42px; font-size:clamp(22px,3.4vw,32px); font-weight:580; line-height:1.37; color:var(--ink); }
.practice-cloze-token { display:inline-flex; align-items:baseline; min-width:0; max-width:100%; }
.practice-cloze-word {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  min-inline-size: min(var(--blank-width), 70vw);
  min-block-size: 1.36em;
  padding: 0 .04em .1em;
  border: 0;
  border-bottom: 1px solid var(--faint);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  overflow-wrap: anywhere;
  line-height: inherit;
  touch-action: manipulation;
}
.practice-cloze-word.is-current-blank { border-bottom-color: var(--blue); box-shadow: 0 1px var(--blue); }
.practice-cloze-word.is-current-blank::after { position:absolute; inset-inline-start:calc(50% - 2px); inset-block-end:.62em; content:''; width:4px; height:4px; border-radius:50%; background:var(--blue); }
.practice-cloze-word.is-solved { color: var(--blue); }
.practice-cloze-word.is-hinted { color: var(--blue); border-bottom-style: dashed; }
.practice-cloze-word.is-hinted::after { display: none; }
.practice-cloze-word.is-at-playhead { outline: 2px solid var(--practice-wave-playhead); outline-offset:-1px; }
.practice-word-entry { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:10px; align-items:center; border-bottom:0; }
.practice-word-entry:focus-within { border-color:var(--blue); }
.practice-word-entry input { width:100%; min-width:0; min-height:48px; padding:8px 0; border:0; outline:none; background:transparent; color:var(--ink); font:inherit; font-size:20px; }
.reader-practice .practice-word-entry input:focus-visible { outline:none; }
.practice-commit { align-self:center; min-height:36px; padding:0 12px; border-radius:8px; color:var(--blue); background:var(--soft); font-size:13px; font-weight:600; }
.practice-commit:disabled { opacity:.48; }
.practice-cloze-tools { display:flex; align-items:center; flex-wrap:wrap; gap:2px; min-height:43px; }
.practice-cloze-tools .practice-link { margin-inline-start:-4px; }
.practice-cloze-tools:not(:has(.practice-link:not([hidden]))) { min-height:30px; }
.practice-gesture-hint,.practice-key-hint { color:var(--muted); font-size:11px; }
.practice-key-hint { margin-inline-start:auto; }
.practice-cloze-tools { column-gap:10px; }
.practice-inline-commit { display:none; }
@media (max-width:600px) {
  .practice-cloze-grid { position:relative; display:flow-root; }
  .practice-word-entry { display:none; }
  .practice-cloze-grid.has-inline-entry .practice-word-entry {
    display:block; position:absolute; z-index:1; border:0;
    left:var(--entry-left); top:var(--entry-top); width:var(--entry-width); height:var(--entry-height);
  }
  .practice-word-entry .practice-commit { display:none; }
  .practice-word-entry input {
    display:block; min-height:0; height:100%; padding:0 .04em .1em;
    font-size:clamp(16px,4.7vw,22px); font-weight:580; line-height:1.37;
    text-align:center; touch-action:manipulation;
  }
  .practice-word-entry input::placeholder { color:transparent !important; }
  .practice-cloze-grid.has-inline-entry .is-current-blank::after { display:none; }
  .practice-cloze-grid.inline-entry-has-draft .is-current-blank [data-letterbox] { visibility:hidden; }
  .practice-cloze-stage:has(.has-inline-entry) .practice-inline-commit { display:block; margin-inline-start:auto; }
  .practice-cloze-tools .practice-key-hint { display:none; }
}
.practice-sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
@media (max-width:430px) { .practice-cloze-stage { padding:12px 12px 6px; } .practice-cloze-line { margin:12px 0 13px; } }
@media (pointer:coarse) { .practice-key-hint { display:none; } }


.reader-practice {
  --practice-wave-playhead: #ffd082;
  --practice-wave-seam: #63c7bc;
  --practice-yellow: #f0c36b;
  --practice-red: #ffa0a2;
}
.light .reader-practice {
  --practice-wave-playhead: #934309;
  --practice-wave-seam: #18706b;
  --practice-yellow: #8b5607;
  --practice-red: #a92936;
}
.practice-head-actions { display: flex; align-items: center; flex: none; gap: 4px; }
.practice-context [data-locked=true] { color: var(--muted); font-size: 12px; }
.practice-context p { min-width: 0; }
.practice-transport .practice-icon > span { display: none; }
.practice-cloze-word[data-misses=yellow] { --miss-color: var(--practice-yellow); }
.practice-cloze-word[data-misses=red] { --miss-color: var(--practice-red); }
.practice-cloze-word:is([data-misses=yellow],[data-misses=red]) {
  color: var(--miss-color);
  background: color-mix(in srgb, var(--miss-color) 12%, transparent);
  border-bottom-color: var(--miss-color);
  box-shadow: none;
}
.practice-cloze-word:is([data-misses=yellow],[data-misses=red])::after { background: var(--miss-color); }

.practice-report {
  padding: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.practice-report h3 { margin: 0; font-size: 20px; }
.practice-report h3:focus { outline: none; }
.practice-report p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.practice-report ul { list-style: none; margin: 14px 0 0; padding: 0; }
.practice-report li { border-top: 0; padding: 10px 0; }
.practice-report li > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.practice-report li span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.practice-report li strong { color: var(--ink); font-weight: 650; }
.practice-report-actions { display: flex; margin-top: 15px; }

@media (min-width: 900px) {
  body:not(.framed) .practice-transport { grid-template-columns: 108px minmax(0,1fr) 108px auto; }
  body:not(.framed) .reader-practice .practice-transport .practice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    white-space: nowrap;
    font-size: 13px;
  }
  body:not(.framed) .practice-transport .practice-icon > span { display: inline; }
  body:not(.framed) .practice-waveforms { gap: 10px; }
  body:not(.framed) .practice-waveforms canvas[data-practice-wave=overview] { height: 36px; }
  body:not(.framed) .practice-waveforms canvas[data-practice-wave=detail] { height: 76px; }
}


.practice-report .practice-report-summary {
  margin-block: 14px 4px;
  color: var(--accent);
}
.practice-report .practice-report-word-head,
.practice-report .practice-report-word-name,
.practice-report .practice-report-word-controls,
.practice-report .practice-report-reason,
.practice-report-save-actions {
  display: flex;
  align-items: center;
  gap: 8px 12px;
  flex-wrap: wrap;
}
.practice-report .practice-report-word-head,
.practice-report .practice-report-reason {
  justify-content: space-between;
}
.practice-report .practice-report-word-name,
.practice-report .practice-report-word-controls {
  min-width: 0;
}
.practice-report .practice-report-word-name strong {
  overflow-wrap: anywhere;
}
.practice-report .practice-report-reason {
  margin-top: 4px;
}
.practice-report .practice-report-reason p {
  flex: 1 1 220px;
  margin: 0;
}
.practice-report .practice-report-reason strong {
  color: var(--accent);
}
.practice-report-button,
.practice-report .practice-report-reason select {
  border: 1px solid var(--line);
  background: var(--card);
  padding: 7px 10px;
  min-height: 36px;
  color: inherit;
  font: inherit;
}
.practice-report-button {
  cursor: pointer;
}
.practice-report-button:hover:not(:disabled) {
  border-color: currentColor;
}
.practice-report button:disabled {
  opacity: .65;
  cursor: default;
}
.practice-report .practice-report-history {
  margin-top: 8px;
  color: var(--muted);
  font-size: .86em;
}
.practice-report .practice-report-history summary {
  cursor: pointer;
}
.practice-report .practice-report-history ol {
  margin: 6px 0 0;
  padding-inline-start: 25px;
  max-height: 280px;
  overflow-y: auto;
}
.practice-report .practice-report-history ol li {
  padding: 3px 0;
  border: 0;
  overflow-wrap: anywhere;
}
.practice-report .practice-report-journal {
  border-top: 0;
  padding-top: 10px;
}
.practice-report-actions {
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.practice-report-save-actions {
  margin-inline-start: auto;
  justify-content: flex-end;
}
.practice-report .practice-report-feedback:not([hidden]) {
  margin-top: 10px;
  color: var(--accent);
}
.practice-report .practice-report-archive-button {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  width: 100%;
  text-align: start;
}
@media (max-width: 560px) {
  .practice-report .practice-report-word-head,
  .practice-report .practice-report-reason {
    align-items: flex-start;
  }
  .practice-report .practice-report-word-controls {
    width: 100%;
  }
  .practice-report .practice-report-word-controls > span {
    flex: 1;
    text-align: end;
  }
  .practice-report .practice-report-button,
  .practice-report .practice-report-reason select {
    min-height: 44px;
  }
  .practice-report-save-actions {
    margin-inline-start: 0;
    justify-content: flex-start;
  }
}

.reader-practice .practice-reveal-dialog {
  position:fixed;
  inset:0;
  width:min(23rem, calc(100% - 32px));
  height:fit-content;
  max-height:calc(100% - 32px);
  margin:auto;
  padding:18px;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--panel);
  color:var(--ink);
}
.practice-reveal-dialog::backdrop { background:rgb(0 0 0 / .44); }
.practice-reveal-dialog h3 { margin:0; font-size:18px; }
.practice-reveal-dialog p { margin:8px 0 16px; color:var(--muted); font-size:14px; }
.practice-reveal-actions { display:flex; justify-content:flex-end; gap:8px; }
.practice-reveal-actions button { min-height:44px; padding-inline:12px; }

.recording-assessment { margin-top:12px; padding-top:12px; border-top:0; }
.recording-score h3 { display:flex; justify-content:space-between; align-items:baseline; gap:10px; }
.recording-score h3 strong { color:var(--blue); font-size:25px; }
.recording-score h3 small { color:var(--muted); font-size:13px; }
.recording-score dl { display:flex; gap:16px; margin:8px 0 12px; }
.recording-score dl div { flex:1; padding-block:7px; border-top:0; }
.recording-score dt,.recording-score li small { color:var(--muted); font-size:12px; }
.recording-score dd { margin:2px 0 0; font-weight:650; }
.recording-score ul { list-style:none; margin:4px 0 0; padding:0; }
.recording-score li { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:2px 8px; padding:7px 0; border-bottom:0; }
.recording-score li small { grid-column:1 / -1; }
.recording-score li.needs-practice b { text-decoration:underline; text-underline-offset:3px; }

/* Shared reading colors and flat controls, with a desktop rail and a touch layout. */
:root {
  --workbench-accent: #548dff;
  --workbench-surface: #1c1e22;
  --workbench-rail: #18191b;
  --workbench-gutter: 16px;
  --radius: 0px;
}
body.light {
  --workbench-accent: #3569df;
  --workbench-surface: #fff;
  --workbench-rail: #edf0f5;
  --radius: 0px;
}
body:not(.light) {
  --bg: #141516;
  --ink: #f5f6f8;
  --blue: #9dbaff;
  --nav: #18191b;
  --soft: #25324a;
}
#app :is(.v12-search,.primary,.v12-pill,.calendar-switch,.calendar-nav,.day-card,.day-body,
  .material-row,.v12-entry,.review-today,.review-list-row,.recall-card,.recall-ratings button,
  .review-categories,.review-categories button,.proficiency-entry,.p-sort,.p-open,
  .v12-empty,.v12-filters,.v12-filters button,.ai-switch,.ai-switch button,.ai-composer,
  .chat-user,.chat-assistant,.english-reading-modes,.english-reading-modes button,
  .reader-practice-entry,.reader-options-popover,.v12-icon,.reader-follow,.reader-icon-button),
#sheet:is(dialog), #sheet :is(input,textarea,select,.primary,.meaning-index button) {
  border-radius: 0;
}
#app > #nav {
  border-color: var(--line);
  background: var(--workbench-rail);
  backdrop-filter: none;
}
#app > #nav button {
  position: relative;
  border-radius: 0;
}
#app > #nav button.active {
  color: var(--blue);
  background: var(--soft);
}
#app > #nav button.active::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--workbench-accent);
}
#app > :is(#nav,#page-header) button:focus-visible {
  outline: 2px solid var(--workbench-accent);
  outline-offset: -2px;
}
#app > #page-header:not([hidden]) {
  border-bottom: 0;
  padding-bottom: 4px;
}

.reader-practice {
  padding: 0;
}
.practice-workspace { display: grid; align-items: start; gap: 14px; }
.practice-session, .practice-audio { min-width: 0; }
.reader-practice .practice-head h2 {
  font-size: clamp(23px, 2vw, 28px);
  font-weight: 680;
  letter-spacing: -.025em;
}
.reader-practice .practice-head p { margin-top: 5px; }
.reader-practice .practice-icon {
  width: 44px;
  height: 44px;
  border-radius: 0;
}
.reader-practice .practice-modes {
  width: auto;
  gap: 2px;
  padding: 0;
  margin-top: 14px;
  border-radius: 0;
  border-bottom: 0;
}
.reader-practice .practice-modes button {
  min-height: 44px;
  padding-inline: 13px;
  border-radius: 0;
  border-bottom: 0;
}
.reader-practice .practice-modes button[aria-pressed=true] {
  border-bottom-color: var(--workbench-accent);
}
.reader-practice .practice-progress { margin-block: 13px; }
.reader-practice .practice-progress progress {
  appearance: none;
  background: var(--panel2);
  border: 0;
  height: 3px;
}
.practice-progress progress::-webkit-progress-bar { background: var(--panel2); }
.practice-progress progress::-webkit-progress-value { background: var(--workbench-accent); }
.practice-progress progress::-moz-progress-bar { background: var(--workbench-accent); }
.reader-practice .practice-task { margin: 0; }
.reader-practice :is(.practice-cloze-stage,.practice-audio) {
  padding: 14px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: var(--workbench-surface);
}
.reader-practice .practice-cloze-stage { margin: 0; padding-bottom: 5px; }
.reader-practice .practice-cloze-line { margin-block: 14px 17px; }
.reader-practice .practice-cloze-meta span:first-child { color: var(--ink); font-weight: 620; }
.reader-practice :is(.practice-select,.practice-primary,.practice-link,.practice-commit,.practice-waveforms canvas,.practice-reference) { border-radius: 0; }
.reader-practice .practice-primary { border: 1px solid color-mix(in srgb,var(--blue) 30%,var(--line)); }
.reader-practice .practice-primary.is-playing::before {
  width: 9px;
  height: 12px;
  border: solid currentColor;
  border-width: 0 3px;
  border-radius: 0;
  background: transparent;
}
#app #screen > .v12-page { padding-top: 10px; }
.reader-practice .practice-word-entry input::placeholder { color: var(--muted); opacity: 1; }
.reader-practice .practice-commit { min-height: 44px; }
.reader-practice .practice-audio-info { margin-bottom: 10px; }
.reader-practice .practice-waveforms canvas { background: var(--bg); }
.reader-practice .practice-notice {
  margin: 0;
  color: var(--blue);
  padding: 8px 10px;
  border-inline-start: 0;
  background: var(--soft);
}
.practice-feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.practice-feedback:has(> :not([hidden])) { margin-top: 8px; }
.practice-feedback button { flex-shrink: 0; }
body.framed #app[data-view=reader] > #nav { display: none; }
@media (max-width: 849px) {
  #app[data-view=reader] > #nav { display: none; }
}
@media (max-width: 430px) {
  :root { --workbench-gutter: 14px; }
  .reader-practice { padding-top: 10px; }
  .reader-practice :is(.practice-cloze-stage,.practice-audio) { padding-inline: 11px; }
  .reader-practice .practice-cloze-line { margin-block: 12px 14px; }
}
@media (min-width: 850px) {
  :root { --workbench-gutter: 24px; }
  body:not(.framed).session-ready #app {
    width: 100%;
    max-width: none;
    min-width: 0;
    display: grid;
    grid-template-columns: 155px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    padding: 0;
  }
  body:not(.framed) #app > :is(.statusbar,.home-indicator) { display: none; }
  body:not(.framed) #app > #page-header {
    grid-area: 1 / 2;
  }
  body:not(.framed) #app > #screen {
    grid-area: 2 / 2;
    min-width: 0;
  }
  body:not(.framed) #app > .site-filing { grid-area: 3 / 2; }
  body:not(.framed) #app > #nav {
    grid-area: 1 / 1 / -1 / 2;
    grid-template-columns: minmax(0,1fr);
    align-content: start;
    gap: 4px;
    padding: 12px 8px;
    border: 0;
    border-inline-end: 0;
  }
  body:not(.framed) #app > #nav::before {
    content: 'LoopFluent';
    display: flex;
    align-items: center;
    padding-inline: 12px 0;
    height: 43px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 690;
    letter-spacing: -.015em;
  }
  body:not(.framed) #app > #nav button {
    justify-content: flex-start;
    flex-direction: row;
    gap: 9px;
    min-height: 42px;
    padding: 0 12px;
  }
  body:not(.framed) #app > #nav button .icon { width: 18px; height: 18px; flex: none; }
  body:not(.framed) #app > #nav button span { font-size: 13px; }
  body:not(.framed) #app > #nav button.active::after { inset: 0 auto 0 0; width: 2px; height: auto; }
  body:not(.framed) #app > #nav button:not(.active):hover { background: var(--panel2); }
  .reader-practice { padding-inline: 24px; }
  body:not(.framed) #screen > .reader-layout.practice-active { width: min(100%, 1110px); }
}
@media (min-width: 1050px) {
  .reader-practice :is(.practice-cloze-stage,.practice-audio) { padding: 16px; }
  .reader-practice .practice-cloze-stage { padding-bottom: 7px; }
  .reader-practice .practice-cloze-line { margin-block: 20px 24px; }
}

.material-preview, .ai-provider-icon, .ai-empty { display: none; }
.review-overview, .review-queue, .ai-controls { display: contents; }

@media (min-width: 850px) {
  body:not(.framed) #app {
    --desktop-rail: clamp(174px, 15vw, 216px);
    --desktop-gutter: clamp(24px, 3vw, 48px);
    --desktop-content: 1380px;
    --desktop-gap: 20px;
  }

  body:not(.framed).session-ready #app {
    grid-template-columns: var(--desktop-rail) minmax(0, 1fr);
  }

  body:not(.framed) #app > #nav {
    padding: 18px 12px;
    gap: 4px;
  }
  body:not(.framed) #app > #nav::before {
    height: 46px;
    padding-inline-start: 45px;
    margin-bottom: 12px;
    background: url("icon.svg") no-repeat 10px center / 26px 26px;
    font-size: 17px;
  }
  body:not(.framed) #app > #nav button {
    min-height: 44px;
    padding-inline: 13px;
    gap: 11px;
  }
  body:not(.framed) #app > #nav button span { font-size: 14px; }

  body:not(.framed) #app > #page-header {
    padding: 0 var(--desktop-gutter);
  }
  body:not(.framed) #app > #page-header > .compact-topbar {
    width: min(100%, var(--desktop-content));
    min-height: 65px;
    height: 65px;
    padding: 0;
    gap: 11px;
  }
  body:not(.framed) #page-header .compact-topbar h1 {
    font-size: 24px;
    letter-spacing: -.025em;
  }
  body:not(.framed) #page-header .compact-actions { gap: 8px; }
  body:not(.framed) #page-header .compact-actions > button {
    min-height: 38px;
    padding-inline: 10px;
  }
  body:not(.framed) #page-header[data-view="home"] [data-action="add"] {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    gap: 6px;
    padding-inline: 12px;
    border: 1px solid color-mix(in srgb, var(--blue) 28%, var(--line));
    background: var(--soft);
  }
  body:not(.framed) #page-header[data-view="home"] [data-action="add"]::after {
    content: "添加素材";
    white-space: nowrap;
    font-size: 13px;
  }

  body:not(.framed) #app #screen > :is(.v12-page, .ai-page) {
    width: 100%;
    max-width: calc(var(--desktop-content) + 2 * var(--desktop-gutter));
    padding: 22px var(--desktop-gutter) 24px;
    box-sizing: border-box;
  }
  body:not(.framed) #app .v12-search {
    width: min(100%, 480px);
    min-height: 42px;
    margin: 0;
    border: 1px solid var(--line);
    background: var(--workbench-surface);
  }
  body:not(.framed) #app .v12-search:focus-within { border-color: var(--workbench-accent); }

  body:not(.framed) #screen .calendar-page {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    grid-template-rows: auto minmax(0,1fr);
    gap: 16px;
    align-items: stretch;
  }
  body:not(.framed) #page-header .calendar-controls :is(.calendar-switch,.calendar-nav,.calendar-nav button) {
    border-radius: 0;
  }
  body:not(.framed) .calendar-page .calendar-month {
    align-self: center;
    margin: 0;
    font-size: 14px;
  }
  body:not(.framed) .calendar-page .day-strip {
    grid-column: 1 / -1;
    min-height: 0;
    padding-bottom: 0;
  }
  body:not(.framed) .calendar-page .day-strip.six-day-grid {
    grid-template-columns: repeat(3,minmax(0,1fr));
    grid-template-rows: repeat(2,minmax(0,1fr));
    gap: 12px;
  }
  body:not(.framed) #app .calendar-page .day-column {
    border-radius: 0;
    background: var(--workbench-surface);
  }
  body:not(.framed) .calendar-page .day-column.is-today {
    border-color: color-mix(in srgb, var(--workbench-accent) 62%, var(--line));
  }
  body:not(.framed) .calendar-page .day-heading {
    min-height: 44px;
    padding: 0 6px 0 10px;
    border-bottom: 0;
    background: transparent;
  }
  body:not(.framed) .calendar-page .day-date { font-size: 13px; gap: 5px; }
  body:not(.framed) .calendar-page .day-body { padding: 8px; }
  body:not(.framed) #app .calendar-page .day-card {
    min-height: 136px;
    gap: 7px;
    padding: 10px;
    border: 1px solid var(--line);
    background: var(--bg);
  }
  body:not(.framed) .calendar-page .day-card strong { font-size: 14px; line-height: 1.35; }
  body:not(.framed) .calendar-page .day-card p { -webkit-line-clamp: 2; }
  body:not(.framed) .calendar-page .day-card footer {
    margin-top: auto;
    line-height: 18px;
    font-size: 11px;
  }
  body:not(.framed) .calendar-page .day-empty {
    min-height: 72px;
    border: 1px dashed var(--line);
    border-radius: 0;
    background: transparent;
  }

  body:not(.framed) .learning-page .v12-materials {
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 14px;
    margin-top: 16px;
  }
  body:not(.framed) .learning-page .v12-empty { grid-column: 1 / -1; }
  body:not(.framed) #app .learning-page .material-row {
    min-height: 126px;
    align-items: start;
    gap: 13px;
    padding: 15px;
  }
  body:not(.framed) .learning-page .material-art {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 0;
  }
  body:not(.framed) .learning-page .material-row > .chevron {
    align-self: center;
    flex: none;
  }
  body:not(.framed) .learning-page .row-content {
    display: grid;
    align-content: start;
    gap: 7px;
    min-width: 0;
  }
  body:not(.framed) .learning-page .row-content strong {
    overflow-wrap: anywhere;
    font-size: 16px;
    line-height: 1.4;
  }
  body:not(.framed) .learning-page .material-preview {
    display: -webkit-box;
    overflow: hidden;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
  }
  body:not(.framed) .learning-page .row-content small { font-size: 11px; line-height: 17px; }

  body:not(.framed) .review-page { --review-sidebar: clamp(234px, 25vw, 360px); }
  body:not(.framed) .review-page .review-overview {
    display: grid;
    grid-template-columns: var(--review-sidebar) minmax(0,1fr);
    align-items: start;
    gap: var(--desktop-gap);
  }
  body:not(.framed) .review-page .review-categories {
    width: var(--review-sidebar);
    min-height: 42px;
    margin-block: 0 16px;
    border: 1px solid var(--line);
  }
  body:not(.framed) .review-page .review-today {
    padding: 18px;
    border: 1px solid var(--line);
  }
  body:not(.framed) .review-page .review-today-heading { font-size: 15px; }
  body:not(.framed) .review-page .review-metrics { gap: 10px; }
  body:not(.framed) .review-page .review-metrics span { white-space: nowrap; }
  body:not(.framed) .review-page .review-queue {
    display: block;
    min-width: 0;
  }
  body:not(.framed) .review-queue .review-list-title:first-child { margin-top: 0; }
  body:not(.framed) .review-queue .review-list-row { min-height: 55px; }
  body:not(.framed) #app .review-page:has(.recall-card) { max-width: 900px; }

  body:not(.framed) .library-page {
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-content: start;
    gap: 14px;
  }
  body:not(.framed) .library-page .library-controls {
    min-width: 0;
    min-height: 42px;
    margin: 0;
    gap: 10px;
    border-radius: 0;
  }
  body:not(.framed) .library-page #learning-results { grid-column: 1 / -1; }
  body:not(.framed) .library-page .proficiency-entry { min-height: 58px; }
  body:not(.framed) .library-page .proficiency-entry .study-row-actions:last-child {
    display: grid;
    flex-basis: 80px;
    grid-template-columns: 34px 42px;
    grid-template-rows: minmax(0,1fr);
    gap: 4px;
    align-items: center;
  }
  body:not(.framed) .library-page .proficiency-entry .study-row-actions:last-child .p-adjust {
    grid-area: 1 / 2;
    align-self: center;
    width: 42px;
    border-radius: 0;
  }
  body:not(.framed) .library-page .proficiency-entry .study-row-score.p-badge {
    grid-area: 1 / 1;
    position: static;
    inset: auto;
    align-self: start;
    justify-content: center;
    align-items: center;
    margin-top: 4px;
  }
  body:not(.framed) .library-page .study-pair { align-items: center; }
  body:not(.framed) .library-page .p-open strong { font-size: 16px; }
  body:not(.framed) .library-page .p-description { font-size: 14px; }
  body:not(.framed) .library-page .entry-date { padding-block: 8px 6px; }

  body:not(.framed) #app #screen > .ai-page {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(200px, 25%);
    grid-template-rows: minmax(0,1fr) auto auto;
    column-gap: var(--desktop-gap);
    row-gap: 8px;
  }
  body:not(.framed) #page-header[data-view="ai"] .compact-actions { display: none; }
  body:not(.framed) .ai-controls {
    display: block;
    grid-area: 1 / 2 / 4 / 3;
    align-self: start;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    background: var(--workbench-surface);
  }
  body:not(.framed) .ai-switch { display: grid; gap: 3px; padding: 0; background: transparent; }
  body:not(.framed) .ai-switch button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    min-height: 41px;
    padding: 0 10px;
    font-size: 14px;
    text-align: start;
  }
  body:not(.framed) .ai-switch button[aria-pressed="true"] {
    box-shadow: inset 2px 0 var(--workbench-accent);
  }
  body:not(.framed) .ai-provider-icon {
    display: block;
    flex: none;
    width: 16px;
    height: 16px;
  }
  body:not(.framed) .ai-meta {
    min-height: 42px;
    margin-top: 10px;
    padding: 8px 0 0;
    border-top: 0;
    font-size: 12px;
  }
  body:not(.framed) .ai-meta button { flex: none; font-size: 12px; }
  body:not(.framed) .ai-thread {
    grid-area: 1 / 1;
    padding: 22px clamp(14px,2vw,30px);
    border: 1px solid var(--line);
    background: var(--workbench-surface);
    scrollbar-width: thin;
    scrollbar-gutter: stable;
  }
  body:not(.framed) .ai-error { grid-area: 2 / 1; }
  body:not(.framed) .ai-composer {
    grid-area: 3 / 1;
    gap: 10px;
    padding: 8px 8px 8px 14px;
    border: 1px solid var(--line);
    background: var(--workbench-surface);
  }
  body:not(.framed) .ai-composer textarea { min-height: 43px; padding: 11px 0; font-size: 15px; }
  body:not(.framed) .ai-composer .ai-send { border-radius: 0; }
  body:not(.framed) .ai-empty {
    display: grid;
    min-height: min(100%, 340px);
    align-content: center;
    justify-items: center;
    gap: 16px;
    text-align: center;
  }
  body:not(.framed) .ai-empty h2 { margin: 0; font-size: clamp(18px, 2vw, 25px); }
  body:not(.framed) .ai-prompts { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
  body:not(.framed) .ai-prompts button {
    min-height: 38px;
    padding-inline: 12px;
    border: 1px solid var(--line);
    color: var(--blue);
    font-size: 13px;
  }

  body:not(.framed) #app :is(.material-row,.day-card,.review-list-row,.ai-switch button,.ai-prompts button):not(:disabled):hover {
    background: var(--panel2);
  }

  body:not(.framed) #screen > .reader-layout {
    width: min(100%, 1060px);
  }
  body:not(.framed) #screen > .reader-layout.practice-active {
    width: min(100%, 1180px);
  }
  body:not(.framed) .practice-main {
    padding: 22px var(--desktop-gutter) 20px;
  }
  body:not(.framed) .practice-dock { padding-inline: var(--desktop-gutter); }
}

@media (min-width: 1280px) {
  body:not(.framed) .learning-page .v12-materials {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}

@media (min-width: 1950px) {
  body:not(.framed) .calendar-page .day-strip.six-day-grid {
    grid-template-columns: repeat(6,minmax(0,1fr));
    grid-template-rows: minmax(0,1fr);
  }
}

/* Mobile browser layout shares the existing workbench colors and square cards. */
@media (max-width: 600px) {
  #app :is(.v12-search input,.ai-composer textarea,.draft-input,.settings-drawer input[type=text],.settings-drawer input[type=password]) {
    font-size: max(16px, 1em);
  }
  .cs-reader .english-reader-options { gap: 4px; }
  .cs-reader :is(.reader-follow,.reader-icon-button,.reader-practice-entry) { min-height: 42px; }
  .cs-reader .reader-option-actions :is(.reader-follow,.reader-icon-button) { min-width: 42px; }
  .reader-practice :is(.practice-modes button,.practice-icon) { min-height: 44px; }
  .practice-dock { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .practice-main { scroll-padding-block: 9px; }
  .practice-word-entry { scroll-margin-block: 10px; }
  .practice-report-actions > button { min-height: 44px; }
  #sheet:has(.calendar-detail) { max-height: calc(100dvh - 32px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)); }
  #sheet .close-sheet { min-width: 44px; min-height: 44px; }
  html.lf-practice-keyboard #app { height: var(--lf-keyboard-height); }
  html.lf-practice-keyboard .practice-dock { padding-bottom: 6px; }
  html.lf-practice-keyboard .practice-context { display: none; }
}

@media (max-width: 360px) {
  .cs-reader .english-reader-options { flex-wrap: wrap; }
  .cs-reader .reader-language-tools { flex: 1 1 auto; }
  .cs-reader .reader-option-actions { margin-inline-start: auto; }
}

/* Review cards use the workbench typography and borders in both themes. */
#app .review-practice { width:min(100%,760px); max-width:760px; margin-inline:auto; }
.review-page .review-categories button { min-height:42px; }
.review-practice .review-session-meta { margin-top:5px; gap:8px; }
.review-practice .review-session-meta > :last-child { font-variant-numeric:tabular-nums; }
.review-practice .recall-card {
  display:block;
  min-height:0;
  margin:8px 0 0;
  padding:0;
  overflow-wrap:anywhere;
  border:1px solid var(--line);
  border-radius:0;
  background:var(--panel);
}
.recall-prompt { padding:9px clamp(12px,3.4vw,20px); }
.recall-prompt-header,.recall-answer-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.recall-prompt-header .review-score { flex:none; }
.review-practice .recall-prompt h2 {
  margin:4px 0 1px;
  font-size:clamp(23px,5vw,33px);
  font-weight:580;
  line-height:1.26;
  letter-spacing:-.02em;
}
.recall-prompt.is-error h2 { font-size:clamp(19px,4.8vw,28px); }
.recall-answer-heading h3 { margin:0; font-size:13px; color:var(--muted); font-weight:600; }
.recall-answer-heading .review-word-lookup {
  min-height:31px;
  padding-inline:8px;
  margin:-5px -8px -5px 0;
  font-size:12px;
  color:var(--blue);
}
.recall-example + .recall-example { margin-top:8px; }
.recall-example p { font-size:17px; line-height:1.4; }
.recall-example .recall-example-translation,
.recall-note { font:13px/1.58 system-ui,sans-serif; color:var(--muted); }
.review-practice .recall-reveal { margin:15px 0 0; padding-inline:14px; min-height:44px; }
.review-practice .recall-ratings {
  position:sticky;
  bottom:0;
  z-index:2;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-top:0;
  padding:8px 0 max(4px,env(safe-area-inset-bottom));
  background:var(--bg);
}
.review-practice .recall-ratings button {
  display:grid;
  align-content:center;
  gap:4px;
  min-height:54px;
  min-width:0;
  border:1px solid var(--line);
  border-radius:0;
  background:var(--panel);
  color:var(--ink);
}
.review-practice .recall-ratings button > strong { font-size:14px; font-weight:650; }
.review-practice .recall-ratings button > small { margin:0; font-size:11px; color:var(--muted); opacity:1; }
.review-practice .recall-ratings [data-review-rating=good] {
  color:var(--blue);
  background:var(--soft);
  border-color:color-mix(in srgb,var(--blue) 36%,var(--line));
}
.review-practice .recall-ratings [data-review-rating=fuzzy] > strong { color:#855511; }
.review-practice .recall-ratings [data-review-rating=again] > strong { color:#a8433c; }
body:not(.light) .review-practice .recall-ratings [data-review-rating=fuzzy] > strong { color:#e6bd73; }
body:not(.light) .review-practice .recall-ratings [data-review-rating=again] > strong { color:#efa49d; }
.review-practice .recall-ratings button:focus-visible { outline:2px solid var(--blue); outline-offset:2px; }
@media (max-width:370px){
  .review-practice .recall-ratings { gap:5px; }
  .review-practice .recall-ratings button > small { font-size:10px; }
}
@media (max-width:600px){
  #app .review-practice { display:flex; flex-direction:column; min-height:100%; }
  .review-practice > :is(.review-session-meta,progress,.recall-card,.recall-ratings) { flex:none; }
  .review-practice .recall-ratings { padding-top:8px; }
}

.review-practice :is(.recall-prompt h2[lang=en],.recall-correction,.recall-example p[lang=en],.recall-usage-pattern,.recall-original span[lang=en]) {
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  letter-spacing:0;
}
.review-practice .recall-p-edit {
  width:auto;
  min-width:36px;
  min-height:30px;
  padding-inline:6px;
  color:var(--blue);
}
.review-schedule-table { width:100%; border-collapse:collapse; font-size:13px; font-variant-numeric:tabular-nums; }
.review-schedule-table :is(th,td) { padding:6px 4px; border-bottom:0; text-align:right; white-space:nowrap; }
.review-schedule-table tr > :first-child { text-align:left; }
.review-schedule-table thead th { color:var(--muted); }

/* Lead with the information the learner is checking; keep reference material quiet. */
.review-practice .recall-card { background:var(--bg); }
.review-practice .recall-prompt { background:var(--panel); }
.review-practice .recall-prompt-header { min-height:24px; }
.review-practice .recall-prompt-header .recall-p-edit { align-self:center; }
.recall-focus {
  padding:10px clamp(12px,3.4vw,20px) 11px;
  background:color-mix(in srgb,var(--blue) 7%,var(--panel));
  border-inline-start:0;
}
.recall-focus .recall-answer-heading h3 { font-size:12px; color:var(--blue); }
.recall-focus .review-word-lookup { min-height:34px; }
.recall-focus :is(.recall-meaning,.recall-correction) {
  margin:1px 0 0;
  font-size:clamp(20px,4.5vw,27px);
  font-weight:620;
  line-height:1.35;
  white-space:pre-wrap;
}
.recall-word-meta { display:flex; flex-wrap:wrap; align-items:center; gap:1px 10px; margin-top:3px; font-size:11px; color:var(--muted); }
.recall-word-meta .official-pronunciation { margin:0; gap:4px; }
.recall-word-meta .official-sound { min-height:34px; padding:3px 5px; font-size:11px; }
.recall-word-meta .official-sound small { font-size:9px; }
.recall-support { padding:9px clamp(12px,3.4vw,20px) 10px; }
.recall-support > h3 { margin:0 0 4px; font-size:12px; color:var(--muted); font-weight:600; }
.recall-support .recall-note { margin:4px 0 0; line-height:1.42; }
.recall-usage p,.recall-example p { margin:3px 0 0; }
.recall-usage-pattern { font-weight:580; font-size:15px; line-height:1.34; }
.recall-pattern-zh { color:var(--muted); font-size:13px; line-height:1.4; }
.recall-support .recall-example,.recall-disclosure .recall-example {
  padding:7px 9px;
  margin-top:6px;
  background:var(--panel);
  border-inline-start:0;
}
.recall-example p[lang=en] { font-size:15px; line-height:1.43; }
.recall-example .recall-example-translation { font-size:12px; color:var(--muted); }
.recall-original { margin:6px 0 0; color:var(--muted); font-size:12px; line-height:1.4; }
.recall-original > span:first-child { margin-inline-end:5px; }
.recall-original span[lang=en] { font-size:13px; }
.recall-disclosure { padding-inline:clamp(12px,3.4vw,20px); border-top:0; color:var(--muted); font-size:12px; }
.recall-disclosure > summary { padding:7px 0; min-height:33px; cursor:pointer; }
.recall-disclosure-body { padding-bottom:8px; }
.recall-related-row { display:flex; gap:8px; padding:5px 0; align-items:baseline; }
.recall-related-row + .recall-related-row { border-top:0; }
.recall-related-row small { min-width:2.5em; color:var(--muted); }
.recall-related-row span { color:var(--ink); }
.recall-disclosure-body .recall-usage + .recall-usage { margin-top:9px; }
.recall-disclosure-body .recall-note { margin:2px 0 6px; }


/* Shared web components. Layout adapts to the existing responsive web shell. */
body { --lf-preview-background:var(--bg); --lf-surface-1:var(--panel); --lf-surface-2:color-mix(in srgb,var(--blue) 4%,var(--panel)); --lf-surface-3:color-mix(in srgb,var(--blue) 2%,var(--panel)); --lf-surface-note:color-mix(in srgb,#9fac86 4%,var(--panel)); --lf-subtle-outline:color-mix(in srgb,var(--line) 75%,transparent); }
.account-page,.account-page *,#sheet,#sheet *,#settings-drawer,#settings-drawer * { border-radius:0 !important; }
hr,[role=separator] { display:none; }
.calendar-page [data-learning-search=calendar],.calendar-page label:has([data-learning-search=calendar]) { display:none !important; }
#app .review-practice { width:min(100%,800px); max-width:800px; margin-inline:auto; padding-bottom:0 !important; }
#app .review-practice.is-awaiting-recall { height:100%; display:flex; flex-direction:column; }
#app .review-practice .review-session-progress,.review-practice .recall-card { flex:none; }
#app:has(.review-practice) #screen { min-height:0; overflow-y:auto; padding-bottom:82px !important; box-sizing:border-box; }
#app .review-practice { min-height:100%; box-sizing:border-box; }
#app .review-practice.is-awaiting-recall { min-height:var(--study-screen-height,100%); height:var(--study-screen-height,auto); }
#app > #nav button.active::after { display:none; }
@media(min-width:850px) { body:not(.framed) #app #screen > .review-practice { max-width:calc(800px + 2 * var(--desktop-gutter)); } }
#app .review-practice .recall-card { margin:0; background:var(--panel); border:1px solid var(--lf-subtle-outline); }
#app .review-practice .recall-prompt { padding:10px 12px; background:var(--panel); }
#app .review-practice .recall-prompt-header { min-height:0; height:14px; margin:0 0 4px; }
#app .recall-label { font-size:10px; line-height:14px; color:var(--muted); }
#app .recall-word-heading { display:flex; align-items:center; gap:8px; }
#app .recall-word-heading h2 { flex:1; min-width:0; margin:0; font:650 clamp(25px,3vw,32px)/1.25 ui-sans-serif,system-ui,sans-serif; overflow-wrap:anywhere; }
#app .recall-word-heading .recall-p-edit { position:static; flex:none; height:32px; min-height:32px; min-width:34px; padding:0 6px; font-size:12px; background:var(--soft); }
.recall-question { display:grid; place-items:center; flex:none; width:32px; height:32px; min-height:32px; padding:6px; color:var(--blue); background:transparent; }
.recall-question svg { width:18px; height:18px; }
.review-session-progress { margin:4px 0 10px; }
.review-session-meta { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 6px; font-size:12px; line-height:18px; color:var(--muted); }
.review-session-meta strong { font-size:15px; color:var(--ink); }
.review-session-meta small { font-size:11px; }
.review-progress-track { display:flex; height:5px; overflow:hidden; background:color-mix(in srgb,var(--muted) 16%,var(--bg)); }
.review-progress-segment { flex:none; height:100%; }
.review-progress-segment.good,.review-progress-key.good i { background:var(--blue); }
.review-progress-segment.fuzzy,.review-progress-key.fuzzy i { background:#d7ad65; }
.review-progress-segment.again,.review-progress-key.again i { background:#dc918a; }
.review-progress-legend { display:flex; flex-wrap:wrap; gap:12px; margin-top:6px; font-size:11px; line-height:16px; color:var(--muted); }
.review-progress-key { display:inline-flex; align-items:center; gap:4px; }
.review-progress-key i { width:5px; height:5px; }
.review-progress-key b { font-weight:500; font-variant-numeric:tabular-nums; }
#app .review-practice .recall-ratings { position:fixed; z-index:55; left:var(--study-controls-left,16px); width:var(--study-controls-width,calc(100% - 32px)); bottom:var(--study-controls-bottom,76px); height:66px; min-height:66px; margin:0; padding:6px 0; box-sizing:border-box; border:0; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-template-rows:minmax(0,1fr); gap:8px; background:var(--bg); }
#app .recall-ratings button { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:54px; padding:6px 3px; gap:4px; }
#app .recall-ratings button strong { font-size:15px; line-height:20px; }
#app .recall-ratings button small { font-size:11px; min-height:16px; line-height:16px; white-space:nowrap; }
#app .recall-reveal-area { flex:1; display:flex; min-height:160px; padding:8px 0 0; }
#app .review-practice .recall-center-reveal { flex:1; position:static; width:100%; margin:0; display:flex; align-items:center; justify-content:center; gap:6px; border:1px solid var(--lf-subtle-outline); background:var(--panel); color:var(--blue); min-height:160px; }
#app .recall-answer-heading { display:flex; align-items:center; justify-content:space-between; min-height:26px; gap:8px; }
#app .recall-answer-heading h3 { font-size:12px; line-height:18px; font-weight:600; margin:0; color:var(--muted); }
.review-word-lookup { min-height:28px; padding:3px 0 3px 8px; font-size:12px; color:var(--blue); }
#app :is(.recall-personal-notes,.recall-official-notes) { padding:12px; margin:8px; background:var(--lf-surface-note); }
.note-header-actions { display:inline-flex; align-items:center; gap:8px; }
.note-header-actions [hidden] { display:none !important; }
.recall-example-source { display:block; font-size:11px; color:var(--muted); margin-top:5px; }
#sheet { position:fixed; top:calc(var(--study-visible-top,0px) + var(--study-visible-height,100dvh)/2) !important; bottom:auto !important; left:16px !important; right:16px !important; transform:translateY(-50%); margin:0 auto !important; width:calc(100% - 32px) !important; max-width:680px !important; max-height:calc(var(--study-visible-height,100dvh) - 32px) !important; padding:18px !important; background:var(--panel); border:1px solid var(--line); overflow-y:auto; border-radius:0; }
#sheet:not([open]) { display:none !important; }
#sheet[open] { display:block; }
#sheet::backdrop { background:transparent !important; backdrop-filter:none !important; }
#sheet.dictionary-detail { z-index:120 !important; }
#sheet .sheet-handle { display:none; }
#sheet > .close-sheet { position:absolute; top:8px; right:8px; width:32px; height:32px; min-height:32px; padding:6px; }
#sheet #sheet-title { padding-right:30px; }
#sheet .composer-heading { padding-right:30px; }
#sheet .composer-heading #sheet-title { padding-right:0; }
#sheet.dictionary-detail .word-hero { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; padding-right:24px; margin:0 0 16px; }
#sheet.dictionary-detail .word-hero h2 { font-size:27px; line-height:34px; margin:0; padding:0; }
#sheet.dictionary-detail .word-hero-actions { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
#sheet.dictionary-detail .word-hero-actions .official-sound { min-height:32px; padding:4px 6px; font-size:11px; }
#sheet.dictionary-detail .word-hero-actions .word-save { width:32px; min-height:32px; padding:6px; }
#sheet.dictionary-detail .recall-official-notes { background:var(--lf-surface-note); padding:10px; margin-top:10px; }
.word-question h2,.note-editor h2,.note-publication h2 { margin:0 0 16px; font-size:21px; line-height:28px; }
.word-question textarea,.note-editor textarea { width:100%; min-height:84px; margin:8px 0; resize:vertical; }
.note-editor textarea { min-height:220px; }
.word-question-controls { display:grid; grid-template-columns:110px minmax(0,1fr); gap:8px; }
.word-question-controls :is(button,select) { min-height:40px; margin:0 !important; }
.word-question-status { margin:10px 0; color:var(--muted); font-size:12px; line-height:18px; }
.word-question-answer:not(:empty) { padding:12px; margin:8px 0 12px; background:var(--lf-surface-3); }
.word-question-save[hidden] { display:none !important; }
.compact-learning-answer { display:grid; gap:12px; font-size:14px; line-height:1.55; }
.compact-learning-answer p { font:inherit; margin:0; }
.compact-learning-answer .answer-summary { display:grid; gap:4px; }
.compact-learning-answer .answer-summary-line { font-size:15px; line-height:1.55; font-weight:500; }
.compact-learning-answer .answer-term-highlight { font-weight:650; background:color-mix(in srgb,var(--blue) 13%,transparent); color:var(--blue); padding:0 2px; }
.compact-learning-answer .answer-meaning-emphasis { font-weight:650; color:var(--ink); }
.answer-terms { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.answer-terms article { min-width:0; padding:10px; background:var(--lf-surface-2); }
.answer-term-title { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 6px; margin-bottom:5px; }
.answer-term-title strong { font-size:16px; }
.answer-term-title small { color:var(--muted); font-size:12px; }
.answer-corrections { display:grid; gap:7px; }
.answer-correction { display:grid; grid-template-columns:14px minmax(0,1fr); gap:6px; }
.answer-correction > span { color:#79ac91; font-weight:600; }
.answer-correction.is-incorrect > span { color:#c77c75; }
.answer-correction small,.answer-examples small { display:block; margin-top:3px; color:var(--muted); font-size:12px; line-height:1.5; }
.answer-examples { display:grid; gap:8px; }
.answer-examples h3 { color:var(--muted); font-size:11px; margin:0; font-weight:500; }
.answer-examples > div { background:var(--panel); padding:8px 10px; }
.compact-learning-answer .answer-tip { color:var(--muted); font-size:12px; }
.journal-notes { list-style:none; margin:4px 0 0; padding:0; display:grid; gap:10px; }
.journal-note { display:grid; grid-template-columns:14px minmax(0,1fr); gap:6px; font-size:13px; line-height:1.6; }
.journal-marker { color:var(--muted); padding-top:17px; line-height:20px; }
.journal-kind { display:block; color:var(--muted); font-size:10px; line-height:16px; }
.journal-note p { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; }
.journal-explanation { margin-top:3px !important; color:var(--muted); font-size:12px !important; }
#settings-drawer .ai-setting-group { padding:14px; margin:0 0 10px; background:var(--lf-surface-2); border:1px solid var(--lf-subtle-outline); }
#settings-drawer .ai-setting-group:nth-of-type(2) { background:var(--lf-surface-3); }
#settings-drawer .ai-setting-group:nth-of-type(3) { background:var(--panel); }
#settings-drawer .ai-setting-group :is(input,select,textarea) { background:var(--bg); }
#settings-drawer .ai-setting-actions button { background:color-mix(in srgb,var(--blue) 8%,var(--panel)); }
#settings-drawer .ai-setting-group .ai-caption { margin:10px 0; font-size:12px; line-height:1.6; }
#app :is(.review-list-row,.proficiency-entry) :is(.study-en,.study-zh,.p-description,.p-open) { width:100%; max-width:none; min-width:0; }
#app .library-page .proficiency-entry { display:grid; grid-template-columns:28px minmax(0,1fr) 36px minmax(0,1fr) 28px; align-items:center; column-gap:8px; min-height:56px; height:auto; padding:8px; }
#app .proficiency-entry > .study-row-actions,#app .proficiency-entry .p-main,#app .proficiency-entry .study-pair { display:contents; }
#app .proficiency-entry .study-en { grid-column:2; grid-row:1; }
#app .proficiency-entry .study-zh { grid-column:4; grid-row:1; }
#app .proficiency-entry .p-badge { grid-column:3; grid-row:1; position:static; width:36px; min-width:36px; height:32px; min-height:32px; padding:0; justify-self:center; }
#app .proficiency-entry .p-adjust { grid-row:1; width:28px; min-width:28px; height:40px; min-height:40px; padding:0; }
#app .proficiency-entry [data-p-delta="-1"] { grid-column:1; }
#app .proficiency-entry [data-p-delta="1"] { grid-column:5; }
#app .proficiency-entry :is(.p-open,.p-description) { display:block; min-height:0; padding:0; }
#app .proficiency-entry .study-en strong { font-size:15px; line-height:1.4; overflow-wrap:anywhere; }
#app .proficiency-entry .study-zh { font-size:13px; line-height:1.5; }
#app .library-page:has([data-p-sort=errors]) .entry-correction,#app .review-page:has([data-review-kind=errors][aria-pressed=true]) .study-zh > span[lang=en] { display:none; }
#app .review-list-row { display:grid; grid-template-columns:minmax(0,1fr) 36px minmax(0,1fr); gap:8px; align-items:center; padding:9px 10px; min-height:56px; }
#app .review-list-row .study-pair { display:contents; }
#app .review-list-row .study-en { grid-column:1; grid-row:1; }
#app .review-list-row .review-score { position:static; grid-column:2; grid-row:1; justify-self:center; }
#app .review-list-row .study-zh { grid-column:3; grid-row:1; }
#app .review-list-row .study-zh time { display:block; margin-top:3px; font-size:10px; line-height:14px; }
.learning-head-actions { display:flex; align-items:center; gap:4px; }
.learning-head-actions button { width:40px; min-height:44px; padding:0; }
.learning-home-search[hidden] { display:none !important; }
.learning-home-search { margin-bottom:12px; }
.learning-section-title { font-size:15px; line-height:22px; margin:0 0 8px; }
.learning-history-section { margin-top:16px; }
.learning-history-date { font-size:12px; line-height:18px; margin:8px 0 0; color:var(--muted); }
.learning-history-feedback:empty { display:none; }
.learning-history-feedback { color:var(--muted); font-size:12px; margin:0 0 8px; }
#app .learning-page .v12-materials { display:grid; gap:8px; }
#app .learning-page .material-row { display:flex; align-items:center; width:100%; min-height:66px; height:auto; padding:12px 10px; gap:12px; }
#app .learning-page .material-art { display:grid; place-items:center; flex:0 0 40px; width:40px; height:40px; }
#app .learning-page .row-content { display:flex; flex:1; min-width:0; flex-direction:column; justify-content:center; gap:4px; margin:0; }
#app .learning-page .row-content strong { display:block; margin:0; font-size:16px; line-height:20px; white-space:normal; overflow-wrap:anywhere; }
#app .learning-page .row-content small { display:block; margin:0; font-size:12px; line-height:16px; }
#app .learning-page .material-row > .chevron { flex:0 0 16px; width:16px; height:20px; }
#app .learning-page .home-catalog-link { border:1px solid var(--line); background:var(--panel); }
@media(max-width:849px) {
 #app #nav { width:calc(100% - 32px); height:60px; min-height:60px; margin:8px 16px; padding:5px; gap:4px; border:1px solid var(--lf-subtle-outline); background:var(--panel); border-radius:0; }
 #app #nav button { flex:1; min-width:0; min-height:44px; height:48px; padding:0; display:flex; align-items:center; justify-content:center; gap:0; font-size:0; border:0; border-radius:0; }
 #app #nav button span { font-size:0; }
 #app #nav button.active { background:var(--soft); }
 #app #page-header .compact-topbar { min-height:44px; height:44px; padding-block:0; }
 #app .review-practice { max-width:none; }
 #sheet { max-width:560px !important; padding:16px !important; }
 * { scrollbar-width:none; }
 *::-webkit-scrollbar { display:none; }
}
@media(min-width:850px) {
 #app .learning-page { display:block; }
 #app .learning-page > .learning-home-section { max-width:100%; }
 #app .learning-page .v12-materials { grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr)); }
 #app .learning-page .learning-history-date { grid-column:1/-1; }
 #app .review-progress-legend { font-size:12px; }
}

#app * { border-radius:0 !important; }
#app .home-catalog-link { text-decoration:none; }
@media(min-width:850px){body:not(.framed) #app .learning-page .material-row { min-height:74px; align-items:center; padding:12px; }}

/* Intensive listening owns its title and mode controls. */
#app .reader-layout.practice-active > :not(.reader-practice) { display:none !important; }
#app .practice-main { padding: 8px 16px 12px; }
#app .practice-head { align-items:center; gap:8px; }
#app .practice-head h2 { font-size:22px; line-height:28px; }
#app .practice-head p { margin-top:3px; line-height:17px; }
#app .practice-head-actions { align-items:center; gap:2px; }
#app .practice-head-actions .practice-link { font-size:11px; padding-inline:4px; }
#app .practice-modes { margin-top:10px; margin-bottom:10px; gap:6px; }
#app .practice-modes button { min-height:38px; font-size:13px; padding:6px 12px; }
#app .practice-progress { margin-bottom:10px; font-size:12px; }
#app .practice-cloze-stage { padding:12px 12px 6px; }
#app .practice-cloze-line { font-size:22px; line-height:1.35; margin:12px 0 14px; column-gap: .4em; row-gap:.35em; }
#app .practice-cloze-word { border-bottom:1px solid color-mix(in srgb,var(--muted) 75%,transparent) !important; }
#app .practice-cloze-word.is-current-blank { border-bottom-color:var(--blue) !important; background:var(--soft); }
#app .practice-cloze-tools { gap:6px; }
#app .practice-gesture-hint { font-size:10px; }
#app .practice-audio { padding:10px 12px; margin-top:10px; border:1px solid var(--line); }
#app .practice-wave-row canvas[data-practice-wave=overview] { height:36px; }
#app .practice-wave-row canvas[data-practice-wave=detail] { height:72px; }
#app .practice-dock { padding:8px 16px 8px; }
#app .practice-context { max-height:92px; margin-bottom:6px; }
#app .practice-context > div { padding:4px 8px; font-size:11px; }
#app .practice-context p { font-size:12px; line-height:17px; }
#app .practice-transport { gap:7px; }
#app .practice-transport :is(button,label) { min-height:42px; }
#app .recall-example-source { display:block; margin-top:6px; color:var(--muted); font-size:10px; }
#app .recall-related-group { padding:4px 0 8px; }
#app .recall-related-group .recall-usage { margin-top:7px; }

/* Reader toolbar alignment at all supported phone widths. */
#app .english-reader-options {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
}
#app .reader-language-tools,
#app .reader-option-actions {
  display: flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  min-width: 0 !important;
}
#app .reader-language-tools { gap: 6px !important; }
#app .reader-option-actions { gap: 2px !important; }
#app .english-reading-modes {
  display: flex !important;
  align-items: center !important;
  height: 44px !important;
  padding: 0 !important;
  gap: 0 !important;
}
#app .reader-language-tools button,
#app .reader-option-actions button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 44px !important;
  min-height: 44px !important;
  flex-shrink: 0 !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}
#app .english-reading-modes button {
  padding: 0 6px !important;
  min-width: 36px !important;
}
#app .reader-practice-entry {
  padding: 0 6px !important;
  gap: 4px !important;
}
#app .reader-listen-word {
  padding: 0 4px !important;
  min-width: 32px !important;
}
#app .reader-follow {
  padding: 0 4px !important;
  min-width: 52px !important;
  gap: 4px !important;
}
#app .reader-follow span { white-space: nowrap !important; }
#app .reader-icon-button {
  width: 32px !important;
  min-width: 32px !important;
  padding: 0 !important;
}
#app .reader-language-tools .icon,
#app .reader-option-actions .icon {
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px !important;
}
@media (max-width: 380px) {
  #app .reader-language-tools { gap: 4px !important; }
  #app .english-reading-modes button {
    min-width: 32px !important;
    padding-inline: 4px !important;
  }
  #app .reader-practice-entry { padding-inline: 5px !important; }
}


/* Outline depth is carried by indentation, tone, and type; no divider strokes. */
[data-word-layout=bullet] .word-tree-panel { padding:10px 12px 12px; background:var(--lf-surface-1); }
.word-tree-section-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; margin:0 0 8px; color:var(--muted); font-size:11px; }
.word-tree { list-style:none; padding:0; margin:0; display:grid; gap:12px; }
.word-tree-node { min-width:0; }
.word-tree-node > details > summary { display:flex; align-items:flex-start; gap:6px; list-style:none; cursor:pointer; padding:2px 0; min-height:26px; }
.word-tree-node > details > summary::-webkit-details-marker { display:none; }
.word-tree-node > details > summary::before { content:'›'; display:block; flex:none; width:10px; color:var(--muted); font-size:16px; line-height:22px; transform:rotate(0deg); }
.word-tree-node > details[open] > summary::before { transform:rotate(90deg); }
.word-tree-node > details > summary:focus-visible { outline:2px solid var(--blue); outline-offset:3px; }
.word-tree-children { margin:4px 0 0 16px; padding:0; }
.word-tree-definition { display:block; font-size:17px; line-height:1.45; color:var(--ink); }
.word-tree-definition small { font-size:10px; font-weight:400; color:var(--muted); margin-right:7px; }
.word-tree-definition strong { font-weight:650; }
.word-tree-pattern { color:var(--blue); font-size:15px; line-height:1.5; font-weight:600; }
.word-tree-translation { color:var(--muted); font-size:12px; line-height:1.55; margin:3px 0 0; }
.word-tree-context { color:var(--muted); font-size:12px; line-height:1.6; margin:7px 0 0; }
.word-tree-audio { display:flex; flex-wrap:wrap; gap:6px; margin:0 0 8px; }
.word-tree-audio:has(.recall-word-audio:empty) { display:none; }
.word-tree-audio .official-sound { min-height:28px; font-size:11px; padding:4px 6px; }
.word-tree-example { border:1px solid var(--lf-subtle-outline); padding:9px 10px; margin:9px 0 0; background:color-mix(in srgb,var(--lf-preview-background) 72%,var(--lf-surface-3)); }
.word-tree-example p { font:inherit; font-family:inherit !important; font-size:14px; line-height:1.55; margin:0; }
.word-tree-example .word-tree-translation { font-size:12px; margin:4px 0 0; }
.word-tree-example small { display:block; font-size:10px; line-height:1.5; color:var(--muted); margin-top:5px; }
[data-word-layout=bullet] .recall-personal-notes { background:var(--lf-surface-note); padding:10px; }
[data-word-layout=bullet] .recall-personal-notes > .recall-answer-heading { margin-bottom:8px; }
.word-tree-note-groups { gap:10px; }
.word-tree-note-group > details > summary strong { color:var(--blue); font-size:13px; line-height:22px; font-weight:600; }
.word-tree-note-list { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.word-tree-note { display:grid; grid-template-columns:8px minmax(0,1fr); gap:7px; font-size:13px; line-height:1.6; min-width:0; }
.word-tree-note p { margin:0; font:inherit; overflow-wrap:anywhere; }
.word-tree-note .word-tree-context,.word-tree-note .word-tree-translation { margin-top:3px; font-size:12px; color:var(--muted); }
.word-tree-note:has(> .word-tree-example) { display:block; }
.word-tree-note > .word-tree-example { margin-top:0; }
.word-tree-note-marker { color:var(--muted); font-size:12px; line-height:21px; }
.word-tree-note.note-correct .word-tree-note-marker { color:#9dccb5; }
.word-tree-note.note-incorrect .word-tree-note-marker { color:#efa49d; }
.word-tree-note-group.sources { font-size:11px; color:var(--muted); }
.word-tree-note-group.sources .word-tree-note { font-size:11px; }
#sheet.dictionary-detail .word-tree { margin-top:8px; }
@media(max-width:390px){.word-tree-definition{font-size:16px;}.word-tree-pattern{font-size:14px;}.word-tree-children{margin-left:14px;}}

/* Functional outline guides connect expanded parent/child nodes. */
.word-tree-node > details > summary { align-items:center; min-height:30px; }
.word-tree-node > details > summary::before { content:none !important; display:none !important; }
.word-tree-fold { flex:0 0 12px; width:12px; height:24px; display:grid; place-items:center; pointer-events:none; color:var(--muted); }
.word-tree-fold svg { display:block; width:12px; height:12px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; transform:rotate(0deg); }
.word-tree-node > details[open] > summary > .word-tree-fold svg { transform:rotate(90deg); }
.word-tree-label { display:block; flex:1; min-width:0; overflow-wrap:anywhere; }
.word-tree-children { position:relative; }
.word-tree-children::before { content:''; position:absolute; left:-10px; top:0; bottom:4px; width:1px; background:color-mix(in srgb,var(--muted) 28%,transparent); pointer-events:none; }
@media(max-width:390px) { .word-tree-children::before { left:-8px; } }
[data-word-layout=bullet] :is(.recall-official-notes,.recall-personal-notes) > h3 { margin:0 0 8px; font-size:12px; line-height:20px; color:var(--muted); font-weight:600; }

/* A shared 4/8px rhythm replaces block-specific legacy margins. */
[data-word-layout=bullet] .word-tree { gap:8px; }
[data-word-layout=bullet] .word-tree-meaning > details > .word-tree-children { display:grid; gap:8px; margin-top:8px; }
[data-word-layout=bullet] .word-tree-audio { margin:0; padding:0; }
[data-word-layout=bullet] :is(#app,#sheet) .word-tree-audio .recall-word-audio { display:flex; align-items:center; gap:6px; margin:0 !important; padding:0 !important; min-height:0; }
[data-word-layout=bullet] :is(#app,#sheet) .word-tree-audio .official-sound { margin:0 !important; min-height:28px !important; padding:4px 6px !important; box-sizing:border-box; }
[data-word-layout=bullet] .word-tree-usages { margin:0 !important; }
[data-word-layout=bullet] .word-tree-note-groups { gap:8px; }
[data-word-layout=bullet] .word-tree-example { margin-top:8px; }
[data-word-layout=bullet] .word-tree-context { margin-top:8px; }
[data-word-layout=bullet] .word-tree-translation { margin-top:4px; }
[data-word-layout=bullet] .word-tree-note > .word-tree-example { margin-top:0; }
#sheet.dictionary-detail { z-index:120 !important; }

[data-word-layout=bullet] :is(#app,#sheet) .word-tree-audio .official-pronunciation { margin:0 !important; }
[data-word-layout=bullet] :is(.word-tree-definition,.word-tree-pattern) { line-height:24px; }


/* Review rhythm: equal eight-pixel gaps between header, progress and controls. */
#app #screen > .review-practice { padding-top:8px !important; padding-bottom:0 !important; }
#app .review-practice .review-session-progress { margin:0 0 8px !important; }
#app .review-practice .review-session-meta { margin:0 0 8px !important; }
#app .review-practice .recall-ratings { height:54px !important; min-height:54px !important; padding:0 !important; }
#app .review-practice .recall-ratings button { min-height:54px; }

#app:has(.review-practice) #screen { padding-bottom:var(--study-scroll-pad,62px) !important; }

/* Calendar header rhythm: equal space above and below the month. */
#app #screen > .page.calendar-page { padding-top:8px !important; row-gap:0 !important; }
#app .calendar-page .calendar-month { display:block; height:18px !important; min-height:18px !important; line-height:18px !important; padding:0 !important; margin:0 0 8px !important; }

/* Compact practice blocks; keep progress, waveform and focus marks functional. */
#app .practice-workspace { gap:8px !important; }
#app .practice-workspace > .practice-audio { margin:0 !important; padding:10px 12px !important; }
#app .practice-audio .practice-waveforms { margin:0 !important; gap:8px !important; }
#app .practice-audio .practice-wave-heading { gap:8px; min-height:28px; }
#app .practice-audio .practice-gap-toggle { min-height:28px; }
#app .practice-audio .practice-wave-meta { min-height:18px; line-height:18px; }
#app .calendar-page .calendar-month { display:none !important; margin:0 !important; }
#app #screen > .page.calendar-page { grid-template-rows:minmax(0,1fr) !important; }
.ai-bullet-answer { white-space:normal; }
.ai-bullet-answer .word-tree-note-list { gap:8px; }
.ai-plain-notes { list-style:none; display:grid; gap:8px; padding:0; margin:0; }
.ai-plain-notes li { display:grid; grid-template-columns:10px minmax(0,1fr); gap:6px; }
.ai-plain-notes li > span { color:var(--muted); }
.ai-plain-notes p { white-space:pre-wrap; margin:0; font:inherit; overflow-wrap:anywhere; }

#app :is(.reader-language-tools,.reader-option-actions) [hidden] { display:none !important; }

#app :is(.reader-language-tools,.reader-option-actions) [hidden] { display:none !important; }
