:root{--bg:#f8f9f5;--surface:#fff;--text:#283b32;--text-muted:#59645b;--border:#e5e8df;--accent:#355e4b;--accent-fg:#fff;--primary-action:var(--accent);--primary-action-fg:var(--accent-fg);--radius:16px;--font:'Noto Sans TC','Hiragino Sans','PingFang TC','Microsoft JhengHei',sans-serif;--font-ja:'Hiragino Sans','Yu Gothic','Noto Sans JP','Noto Sans TC',sans-serif;--serif:'Noto Serif JP','Hiragino Mincho ProN','Yu Mincho','Noto Serif TC',serif;--sage:#eaf0e6;--hero:#ecf0e6;--sun:#e5c890;--paper:#fffdf6;--art-line:#4c614a;--art-leaf:#a8b79a;--art-book:#c8b18b;--peach:#f5e9df;--blue:#e7eef1;--ink-blue:#607d86;--ink-peach:#ac785c;--danger:#a14435;--danger-bg:#fbede8;--success-bg:#edf5ed;--shadow:0 16px 80px #233b301c}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:14px;line-height:1.7;-webkit-font-smoothing:antialiased}button,input,textarea,select{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer}a{color:inherit;text-decoration:none}button{color:inherit}button:disabled{cursor:default}h1,h2,h3,p{margin:0}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--sun);outline-offset:4px}.icon{flex-shrink:0;vertical-align:middle}button .icon,a .icon{pointer-events:none}.skip{position:fixed;top:-60px;z-index:50;background:var(--accent);color:var(--accent-fg);padding:12px}.skip:focus{top:0}.sidebar{position:fixed;inset:0 auto 0 0;width:244px;background:var(--surface);border-right:1px solid var(--border);padding:36px 20px 20px;display:flex;flex-direction:column;z-index:5}.brand{display:flex;align-items:center;gap:11px;padding:0 9px;font-family:var(--serif);font-size:22px;font-weight:600;letter-spacing:1px;white-space:nowrap}.brand-icon{display:grid;place-items:center;background:var(--accent);color:var(--paper);width:38px;height:42px;border-radius:11px;transform:rotate(-4deg)}.brand-icon .icon{width:24px;height:24px}.brand small{display:block;font-family:var(--font);font-size:10px;font-weight:400;letter-spacing:1.6px;color:var(--text-muted);margin-top:1px}.nav-label{font-size:10px;color:var(--text-muted);letter-spacing:2px;margin:52px 15px 16px}nav{display:grid;gap:8px}.nav-item{display:flex;align-items:center;gap:13px;padding:13px 15px;border-radius:9px;color:var(--text-muted);font-size:13px;transition:background .15s}.nav-item:hover{background:var(--bg);color:var(--accent)}.nav-item.active{background:var(--sage);color:var(--accent);font-weight:600}.nav-count{background:var(--surface);border-radius:5px;font-size:10px;min-width:23px;padding:0 5px;text-align:center;margin-left:auto}.sidebar-bottom{margin-top:auto}.small-quote{text-align:center;padding:35px 5px;color:var(--accent);font-family:var(--serif);font-size:14px;letter-spacing:1px}.small-quote small{display:block;color:var(--text-muted);font-family:var(--font);font-size:10px;letter-spacing:.3px;margin-top:10px}.profile{display:flex;width:100%;background:none;border:0;border-top:1px solid var(--border);padding:20px 5px 2px;gap:10px;text-align:left;align-items:center;font-size:12px}.profile small{display:block;font-size:10px;color:var(--text-muted);margin-top:3px}.profile>.icon{margin-left:auto;width:15px}.avatar,.mini-avatar{display:grid;place-items:center;width:35px;height:35px;border-radius:50%;background:var(--peach);color:var(--ink-peach);font-family:var(--serif);flex-shrink:0}.mini-avatar{width:31px;height:31px}.main-shell{margin-left:244px}.topbar{height:85px;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 45px;background:var(--bg)}.breadcrumb{font-size:11px;color:var(--text-muted)}.breadcrumb>span{padding:0 11px;color:var(--border)}.topbar-right{display:flex;align-items:center;gap:23px}.date{font-size:11px;color:var(--text-muted)}.level-select{display:flex;gap:10px;align-items:center;font-size:11px;color:var(--text-muted)}.level-select select{padding:5px 9px;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--accent);font-size:12px;font-weight:600}main{max-width:1280px;padding:37px 45px 24px;margin:auto;min-height:calc(100vh - 160px)}.page-heading{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:27px}.eyebrow{font-size:10px;font-weight:500;letter-spacing:2px;color:var(--text-muted);margin-bottom:9px}h1{font-size:28px;font-weight:550;letter-spacing:1px;line-height:1.6}.page-heading p{color:var(--text-muted);font-size:12px;margin-top:6px}.primary,.secondary,.danger{display:inline-flex;align-items:center;justify-content:center;gap:12px;padding:11px 19px;border-radius:8px;border:1px solid var(--accent);font-size:12px;font-weight:500;min-height:42px;white-space:nowrap;transition:transform .15s,background .15s}.primary{background:var(--primary-action);color:var(--primary-action-fg)}.primary:hover{filter:brightness(1.1);transform:translateY(-1px)}.secondary{border-color:var(--border);background:var(--surface);color:var(--text)}.secondary:hover{border-color:var(--art-leaf);background:var(--bg)}.danger{border-color:var(--danger);background:var(--surface);color:var(--danger)}.primary .icon,.secondary .icon{width:16px;height:16px}.hero{background:var(--hero);border-radius:var(--radius);display:flex;align-items:center;justify-content:space-between;overflow:hidden;min-height:303px;padding:30px 34px;margin-bottom:24px}.hero-copy{position:relative;z-index:1;flex-shrink:0}.hero-label{display:flex;gap:7px;align-items:center;font-size:10px;letter-spacing:1px;color:var(--accent);margin-bottom:13px}.hero-label .icon{width:16px;height:16px}.hero h2{font-size:28px;font-family:var(--serif);font-weight:500;letter-spacing:2px;line-height:1.65}.hero p{font-size:12px;color:var(--art-line);margin:12px 0 20px;line-height:1.9}.hero strong{font-weight:600;color:var(--accent)}.hero-footnote{display:inline-block;margin-left:13px;color:var(--art-line);font-size:9px}.hero-art{width:43%;max-width:370px;min-width:200px;align-self:center;margin-right:-5px}.stats-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:28px}.stat-box{display:flex;gap:13px;align-items:center;background:var(--surface);border:1px solid var(--border);padding:20px;border-radius:12px;position:relative}.stat-icon{width:40px;height:42px;display:grid;place-items:center;border-radius:11px;background:var(--sage);color:var(--accent)}.stat-icon.warm{background:var(--peach);color:var(--ink-peach)}.stat-icon.blue{background:var(--blue);color:var(--ink-blue)}.stat-box>div>span{color:var(--text-muted);font-size:10px;display:block;margin-bottom:3px}.stat-box strong{font-size:26px;font-weight:550;line-height:1.3;font-variant-numeric:tabular-nums}.stat-box strong small{font-size:10px;font-weight:400;color:var(--text-muted)}.stat-note{display:none;color:var(--text-muted);font-size:9px;position:absolute;bottom:15px;right:14px}.dashboard-grid{display:grid;grid-template-columns:1.9fr 1fr;gap:22px;margin-bottom:30px}.panel{background:var(--surface);border:1px solid var(--border);border-radius:12px;padding:23px}.section-title{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:16px}.section-title h2{font-size:15px;font-weight:550;letter-spacing:.3px}.section-title>span{font-size:9px;color:var(--text-muted)}.section-title p{font-size:11px;color:var(--text-muted);margin-top:6px}.plan-item{display:flex;align-items:center;gap:14px;padding:18px 0;border-bottom:1px solid var(--border)}.plan-item:last-child{border:0;padding-bottom:4px}.step-number{font-size:11px;display:grid;place-items:center;align-self:flex-start;margin-top:2px;border-radius:50%;width:27px;height:27px;background:var(--bg);color:var(--art-line);flex-shrink:0}.plan-item h3{font-size:12px;font-weight:500}.plan-item p{color:var(--text-muted);font-size:10px;margin-top:4px}.round-button{width:29px;height:29px;display:inline-flex;justify-content:center;align-items:center;border:1px solid var(--border);border-radius:50%;background:var(--surface);color:var(--accent);flex-shrink:0}.round-button:hover{background:var(--sage)}.round-button .icon{width:14px;height:14px}.plan-item .round-button{margin-left:auto}.text-button{background:none;border:none;padding:0;color:var(--text-muted);font-size:10px;text-decoration:underline;text-underline-offset:4px}.text-button:hover,.text-link:hover{color:var(--accent)}.goal-card{text-align:center}.goal-card .section-title{text-align:left}.goal-ring{width:138px;height:138px;position:relative;border-radius:50%;background:conic-gradient(var(--accent) var(--progress),var(--sage) 0);margin:21px auto 17px;padding:8px;transform:rotate(-90deg)}.goal-ring>div{width:100%;height:100%;background:var(--surface);border-radius:50%;display:flex;align-items:center;justify-content:center;flex-direction:column;transform:rotate(90deg)}.goal-ring strong{font-size:31px;line-height:1.4;font-weight:500}.goal-ring strong small{font-size:14px;margin-left:3px}.goal-ring span{font-size:9px;color:var(--text-muted)}.goal-card>p{font-size:10px;margin-bottom:5px}.tiny-text{font-size:9px;color:var(--text-muted)}.library-section{margin-bottom:24px}.text-link{display:flex;align-items:center;gap:7px;font-size:10px;color:var(--accent)}.text-link .icon{width:13px;height:13px}.material-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:19px}.material-card{text-align:left;background:var(--surface);border:1px solid var(--border);border-radius:11px;overflow:hidden;padding:0;transition:transform .18s,box-shadow .18s;position:relative}.material-card:hover{transform:translateY(-4px);box-shadow:0 10px 20px #283b320a}.material-cover{height:119px;position:relative;overflow:hidden;padding:15px 20px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center}.cover-green{background:var(--sage);color:var(--art-line)}.cover-peach{background:var(--peach);color:var(--ink-peach)}.cover-blue{background:var(--blue);color:var(--ink-blue)}.cover-type{font-size:8px;letter-spacing:3px;margin-bottom:4px}.cover-jp{font-family:var(--serif);font-size:22px;letter-spacing:4px;position:relative;z-index:1}.material-cover>.icon{position:absolute;right:22px;bottom:18px;width:52px;height:52px;opacity:.4;stroke-width:.8;transform:rotate(-12deg)}.cover-line{position:absolute;right:70px;bottom:-26px;width:155px;height:155px;border:1px solid currentColor;border-radius:50%;opacity:.12}.material-info{padding:16px 17px 18px}.material-meta{color:var(--text-muted);font-size:9px;margin-bottom:5px}.material-meta span{padding:0 4px;color:var(--art-leaf)}.material-info h3{font-size:12px;font-weight:500;padding-right:8px}.material-info p{font-size:9px;color:var(--text-muted);margin-top:12px;display:flex;justify-content:space-between;gap:5px;flex-wrap:wrap}.material-arrow{display:none}.local-note{border-top:1px solid var(--border);padding-top:20px;font-size:10px;display:flex;gap:8px;align-items:center;color:var(--text-muted)}.local-note .icon{width:14px;height:14px}.main-shell footer{max-width:1280px;padding:10px 45px 24px;margin:auto;display:flex;gap:20px;align-items:center;color:var(--text-muted);font-size:9px;flex-wrap:wrap}.main-shell footer>span{display:flex;align-items:center;gap:5px;margin-right:auto}.main-shell footer .icon{width:13px;height:13px}.main-shell footer .text-button{font-size:9px}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:24px 0}.filter-tabs{display:flex;gap:5px;flex-wrap:wrap}.filter{border:0;background:none;padding:7px 13px;color:var(--text-muted);font-size:11px;border-radius:7px}.filter.active{background:var(--sage);color:var(--accent)}.search{display:flex;align-items:center;gap:8px;border:1px solid var(--border);background:var(--surface);padding:8px 12px;border-radius:8px;min-width:180px}.search .icon{width:15px;height:15px;color:var(--text-muted)}.search input{background:none;border:0;outline:none;width:100%;min-width:0;font-size:11px;color:var(--text)}.result-count{color:var(--text-muted);font-size:11px;margin-bottom:17px}.toolbar .result-count{margin:0}.library-full{margin-top:16px;row-gap:22px}.import-note{background:var(--sage);border:1px solid var(--border);border-radius:12px;padding:24px;margin-top:30px}.import-note h3{font-size:13px;font-weight:500;margin-bottom:7px}.import-note p{font-size:12px;color:var(--art-line);line-height:1.9}.empty{text-align:center;padding:45px 20px;grid-column:1/-1;color:var(--text-muted)}.empty>.icon{width:35px;height:35px;color:var(--art-leaf);margin-bottom:12px}.empty h3{font-size:16px;font-weight:500;color:var(--text);margin-bottom:7px}.empty p{font-size:12px;margin-bottom:20px}.word-row{display:flex;align-items:center;text-align:left;width:100%;background:var(--surface);border:0;border-bottom:1px solid var(--border);padding:19px 22px;gap:20px}.word-row:hover{background:var(--bg)}.word-row>div{min-width:35%}.word-row strong{font-family:var(--serif);font-size:18px;font-weight:500}.word-row>div>span{display:block;color:var(--text-muted);font-size:11px}.word-row>span{font-size:12px}.word-row>small{font-size:10px;color:var(--text-muted);margin-left:auto;white-space:nowrap}.word-row>.icon{width:14px;color:var(--text-muted);margin-left:auto}.card-list{border:1px solid var(--border);border-radius:12px;overflow:hidden}.card-list .word-row:last-child{border:0}.quiz-intro{text-align:center;padding:45px 25px;margin-bottom:25px}.big-icon{display:grid;place-items:center;width:65px;height:65px;border-radius:20px;background:var(--sage);color:var(--accent);margin:0 auto 24px}.big-icon .icon{width:32px;height:32px}.quiz-intro h2{font-family:var(--serif);font-size:27px;font-weight:500;margin-bottom:12px}.quiz-intro p{color:var(--text-muted);font-size:13px;line-height:2;margin-bottom:25px}.quiz-intro>small{display:block;color:var(--text-muted);font-size:10px;margin-top:16px}.mistakes .empty{padding:25px 10px 0}.activity-panel{padding:30px}.bar-chart{height:250px;display:flex;justify-content:space-around;gap:12px;margin-top:30px}.bar-column{display:flex;align-items:center;flex-direction:column;flex:1;color:var(--text-muted);font-size:12px}.bar-track{height:190px;width:100%;max-width:58px;display:flex;align-items:flex-end;border-bottom:1px solid var(--border);margin:8px 0 12px}.bar{width:100%;background:var(--art-leaf);border-radius:5px 5px 0 0;min-height:2px}.bar.current{background:var(--accent)}.bar-column small{font-size:10px}dialog{border:1px solid var(--border);padding:38px;border-radius:18px;background:var(--surface);color:var(--text);width:min(540px,calc(100% - 32px));max-height:90dvh;overflow:auto;box-shadow:var(--shadow)}dialog.wide{width:min(660px,calc(100% - 32px))}dialog::backdrop{background:#152a2366;backdrop-filter:blur(3px)}.modal-close{position:absolute;right:15px;top:15px}dialog h2{font-family:var(--serif);font-size:26px;font-weight:500;line-height:1.6;max-width:95%;overflow-wrap:anywhere}dialog>p{font-size:13px;color:var(--text-muted);line-height:1.9;margin:12px 0 24px}.modal-description{font-size:12px!important;margin:8px 0 24px!important}form label{display:flex;flex-direction:column;font-size:11px;gap:7px;font-weight:500;margin-top:15px}input,textarea,select{border:1px solid var(--border);border-radius:7px;background:var(--bg);padding:10px 12px;color:var(--text);max-width:100%}input::placeholder,textarea::placeholder{color:var(--text-muted);font-size:11px}textarea{resize:vertical;line-height:1.8;white-space:pre-wrap}.form-row{display:flex;gap:16px}.form-row>label{flex:1}.field-hint{font-size:10px!important;color:var(--text-muted);margin:8px 0!important}.file-picker{display:inline-flex;align-items:center;flex-direction:row;position:relative;color:var(--accent);border:1px dashed var(--border);border-radius:6px;padding:6px 10px;font-size:10px;overflow:hidden;cursor:pointer;max-width:100%}.file-picker input{position:absolute;inset:0;opacity:0;cursor:pointer;padding:0;width:100%}.file-picker:focus-within{outline:3px solid var(--sun)}.file-picker .icon{width:13px;height:13px}.inline-actions{display:flex;gap:15px;align-items:center}.inline-actions label{margin:5px 0 0}.import-preview{font-size:12px;color:var(--accent);margin:8px 0 0;line-height:1.7
}
.import-preview.error{color:var(--danger)
}
.import-preview:empty{display:none
}
.pdf-import{flex-wrap:wrap}.page-range{display:flex;align-items:center;gap:8px;font-size:10px;color:var(--text-muted);margin:5px 0 0}.page-range input{width:130px;padding:6px 10px;font-size:12px}
.form-error{font-size:12px;color:var(--danger);margin:12px 0}.full{width:100%}.reading-text{background:var(--bg);padding:22px;white-space:pre-wrap;line-height:2.2;font-size:13px;border-radius:10px;margin:20px 0;overflow-wrap:anywhere}.detail-word{display:flex;gap:25px;justify-content:space-between;border-top:1px solid var(--border);padding:13px 0;font-size:12px}.detail-word strong{font-family:var(--serif);font-size:17px;font-weight:500}.modal-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:24px}.reading{font-size:15px;color:var(--text-muted);font-family:var(--serif);margin:10px 0!important}.card-meaning{font-size:22px;font-weight:500;margin:22px 0}.example{background:var(--bg);padding:18px;border-radius:9px;text-align:left;margin:20px 0}.example>span{font-size:9px;color:var(--text-muted);letter-spacing:1px}.example p{font-family:var(--serif);font-size:16px;line-height:1.9;margin:7px 0}.example small{color:var(--text-muted);font-size:11px}.flashcard{text-align:center;padding:24px 0 12px}.flashcard h2{font-size:39px;max-width:100%;margin-top:32px;line-height:1.7}.flashcard .recall-hint{font-size:12px;color:var(--text-muted);margin:30px 0 35px}.thin-progress{height:4px;background:var(--sage);border-radius:3px;margin:15px 0}.thin-progress span{display:block;height:100%;background:var(--accent);border-radius:3px}.rating-buttons{display:flex;gap:9px;margin-top:20px}.rating-buttons button{flex:1;display:flex;flex-direction:column;gap:2px;padding:10px 6px}.rating-buttons small{font-size:9px;opacity:.7}.center{text-align:center}.muted{color:var(--text-muted);font-size:12px}.complete-icon{width:60px;height:60px;display:grid;place-items:center;background:var(--sage);color:var(--accent);border-radius:50%;margin:15px 0 22px}.complete-icon .icon{width:30px;height:30px}.quiz-word{text-align:center;font-size:37px!important;margin:25px 0 12px;max-width:100%!important}.quiz-options{display:grid;gap:10px;margin:25px 0}.quiz-option{display:flex;align-items:center;gap:15px;border:1px solid var(--border);background:var(--surface);border-radius:8px;padding:14px;text-align:left;font-size:13px}.quiz-option>span{display:grid;place-items:center;background:var(--bg);border-radius:4px;width:25px;height:25px;font-size:11px;color:var(--text-muted);flex-shrink:0}.quiz-option:hover:not(:disabled){border-color:var(--accent);background:var(--sage)}.quiz-option.correct{border-color:var(--accent);background:var(--success-bg)}.quiz-option.incorrect{border-color:var(--danger);background:var(--danger-bg)}.quiz-option>.icon{margin-left:auto;width:17px}.answer-feedback{font-size:13px}.answer-feedback .example{margin:12px 0 20px}.mistakes-actions{display:flex;justify-content:flex-end;padding-top:16px}.answer-card{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;margin-top:6px}.answer-card span:first-child{font-family:var(--serif);font-size:18px}.answer-card span:nth-child(2){font-family:var(--serif);color:var(--text-muted)}.quiz-option em{font-style:normal;font-family:var(--serif);font-size:15px}.quiz-review{text-align:left;border-top:1px solid var(--border);margin:4px 0 22px}.quiz-review-row{display:flex;align-items:center;gap:14px;padding:11px 0;border-bottom:1px solid var(--border);font-size:12px}.quiz-review-row .mark{width:22px;flex-shrink:0;text-align:center;font-size:16px;font-weight:600}.quiz-review-row.ok .mark{color:var(--accent)}.quiz-review-row.miss .mark{color:var(--danger)}.quiz-review-row>div{min-width:34%}.quiz-review-row strong{font-family:var(--serif);font-size:16px;font-weight:500;display:block}.quiz-review-row div small,.quiz-review-row p small{display:block;color:var(--text-muted);font-size:11px}.quiz-review-row p{margin-left:auto;text-align:right}.quiz-score{font-size:70px;font-weight:500;line-height:1.5;color:var(--accent);margin:20px 0}.quiz-score small{font-size:28px;color:var(--text-muted)}.restore-file{display:block;margin:25px 0;color:var(--text-muted);font-size:12px}.restore-file input{display:block;margin-top:10px;width:100%}#restore-status{font-size:12px;line-height:2}#restore-status button{margin-top:15px}#toast{position:fixed;bottom:25px;left:50%;transform:translate(-50%,20px);background:var(--text);color:var(--surface);padding:13px 22px;border-radius:10px;max-width:90%;width:max-content;box-shadow:var(--shadow);opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:30;font-size:12px}#toast.show{opacity:1;transform:translate(-50%,0)}
@media(min-width:1450px){.stat-note{display:block}.hero{padding:35px 45px}.hero-art{width:46%;max-width:420px}.hero h2{font-size:32px}}
@media(max-width:1150px){.sidebar{width:210px;padding:30px 13px 20px}.brand{font-size:19px;gap:9px}.brand small{font-size:9px}.main-shell{margin-left:210px}.topbar{padding:0 30px}main{padding:30px}.hero{padding:27px}.hero h2{font-size:25px}.hero-footnote{display:block;margin:9px 0 0}.hero-art{margin-left:-35px;min-width:190px}.dashboard-grid{grid-template-columns:1.65fr 1fr;gap:16px}.panel{padding:19px}.plan-item{gap:9px}.plan-item h3{font-size:11px}.plan-item p{font-size:9px}.stats-row{gap:10px}.stat-box{padding:16px 12px;gap:10px}.stat-icon{width:32px;height:35px}.stat-box strong{font-size:23px}.material-grid{gap:13px}.material-info{padding:14px}.material-info h3{font-size:11px}.main-shell footer{padding:8px 30px 24px}.date{display:none}.hero-art text{font-size:13px}}
@media(max-width:900px){.sidebar{width:178px;padding:27px 10px 15px}.brand{font-size:16px;padding:0 2px;gap:7px}.brand-icon{width:30px;height:35px}.brand small{font-size:8px;letter-spacing:.4px}.nav-item{padding:12px 10px;gap:9px;font-size:11px}.nav-item .icon{width:17px;height:17px}.nav-label{margin-left:11px;letter-spacing:1px}.nav-count{min-width:18px;font-size:9px}.main-shell{margin-left:178px}.small-quote{font-size:12px}.small-quote small{font-size:8px}.profile{font-size:10px;gap:7px}.profile small{font-size:8px}.avatar{width:29px;height:29px}.topbar{padding:0 24px;height:70px}.topbar-right{gap:15px}.breadcrumb{font-size:10px}main{padding:25px 24px}.hero{padding:25px;position:relative;min-height:290px}.hero h2{font-size:24px}.hero-art{opacity:.65;position:absolute;right:0;bottom:10px;width:42%;min-width:180px}.hero-copy{flex-shrink:1}.hero p{max-width:240px}.hero-label{font-size:9px}.hero-footnote{font-size:8px}.dashboard-grid{grid-template-columns:1fr}.goal-card{display:none}.stat-box{padding:14px 10px;gap:8px;flex-direction:column;align-items:flex-start}.stat-icon{display:none}.stat-box>div>span{font-size:9px}.stat-box strong{font-size:24px}.material-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.library-section .material-card:nth-child(3){display:none}h1{font-size:24px}.page-heading{gap:10px;align-items:flex-start}.page-heading p{font-size:11px}.page-heading>.secondary{font-size:10px;padding:8px 10px;min-height:35px}.page-heading>.secondary .icon{width:13px}.toolbar{flex-wrap:wrap}.toolbar .search{flex:1}.word-row{gap:12px;padding:16px}.word-row strong{font-size:16px}.word-row>small{font-size:8px}.word-row>span{font-size:11px}.word-row>div{min-width:30%}.main-shell footer{padding:0 24px 25px;gap:15px}.main-shell footer>span{width:100%}.local-note{align-items:flex-start}.local-note .icon{margin-top:3px}}
@media(max-width:640px){body{font-size:13px}.sidebar{position:fixed;top:auto;bottom:0;left:0;right:0;width:100%;height:68px;padding:0 7px max(0px,env(safe-area-inset-bottom));border-right:0;border-top:1px solid var(--border);background:var(--surface)}.brand,.nav-label,.sidebar-bottom{display:none}.sidebar nav{display:flex;justify-content:space-around;gap:2px;height:100%}.nav-item{flex-direction:column;justify-content:center;gap:3px;padding:7px 3px;flex:1;font-size:9px;border-radius:0;position:relative;line-height:1.5;white-space:nowrap}.nav-item .icon{width:19px;height:19px}.nav-item.active{background:none;color:var(--accent)}.nav-item.active:before{content:'';position:absolute;top:0;left:25%;right:25%;height:3px;background:var(--accent);border-radius:0 0 4px 4px}.nav-count{display:none}.main-shell{margin:0;padding-bottom:76px}.topbar{height:64px;padding:0 20px}.breadcrumb{color:var(--accent);font-family:var(--serif);font-weight:500;font-size:13px}.breadcrumb>span{padding:0 5px}.topbar-right{gap:12px}.level-select>span,.mini-avatar{display:none}.level-select select{font-size:11px;padding:4px 7px}main{padding:27px 20px 20px;min-height:calc(100dvh - 220px)}.page-heading{display:block;margin-bottom:23px}.page-heading>.primary,.page-heading>.secondary{margin-top:16px;min-height:36px;padding:7px 12px;font-size:11px}h1{font-size:24px;letter-spacing:.5px}.eyebrow{font-size:9px}.page-heading p{font-size:11px;max-width:280px;line-height:1.9}.hero{padding:25px 23px;min-height:340px;border-radius:13px;margin-bottom:17px}.hero h2{font-size:25px;letter-spacing:1.5px}.hero-label{font-size:9px;letter-spacing:0;margin-bottom:16px}.hero p{font-size:11px;margin:14px 0 22px;max-width:210px}.hero-copy{width:100%}.hero-art{width:57%;min-width:0;right:-28px;bottom:4px;opacity:.65;z-index:0}.hero-footnote{font-size:9px;margin-top:13px}.hero .primary{position:relative;z-index:1;padding:10px 16px}.stats-row{gap:9px;margin-bottom:21px}.stat-box{padding:13px 10px;border-radius:9px;min-height:88px}.stat-box strong{font-size:25px}.stat-box strong small{font-size:9px;white-space:nowrap}.stat-box>div>span{font-size:9px}.dashboard-grid{margin-bottom:27px}.panel{padding:19px 17px}.section-title{gap:8px;margin-bottom:12px}.section-title h2{font-size:14px}.section-title>span{font-size:8px}.plan-item{padding:17px 0;gap:10px}.plan-item h3{font-size:11px}.plan-item p{font-size:9px;max-width:210px;line-height:1.9}.step-number{width:24px;height:24px;font-size:10px}.plan-item .round-button{width:26px;height:26px}.section-title p{font-size:10px;max-width:225px}.text-link{font-size:9px;white-space:nowrap}.material-grid{gap:14px;grid-template-columns:1fr}.library-section .material-card:nth-child(3){display:flex}.material-card{display:flex;min-height:111px;width:100%;align-items:center}.material-cover{width:95px;height:111px;flex-shrink:0;border-radius:0;padding:12px}.cover-type{font-size:7px}.cover-jp{font-size:15px;letter-spacing:1px}.material-cover>.icon{width:30px;height:30px;right:9px;bottom:12px}.material-info{padding:13px 14px;flex:1;min-width:0}.material-meta{font-size:8px}.material-info h3{font-size:11px;line-height:1.8}.material-info p{font-size:8px;margin-top:9px;display:block}.material-info p>span{display:block;margin-top:3px}.material-arrow{display:block;width:13px;margin-right:13px;color:var(--text-muted)}.local-note{font-size:9px;line-height:1.9;padding-top:17px;margin-top:24px}.main-shell footer{padding:0 20px 15px;gap:16px;font-size:9px}.main-shell footer>span{display:none}.toolbar{margin:20px 0 12px;gap:15px}.filter-tabs{gap:2px;width:100%}.filter{padding:7px 11px;font-size:10px}.search{width:100%;min-height:39px}.word-row{padding:16px 12px;gap:9px}.word-row>div{min-width:31%;max-width:40%}.word-row strong{font-size:15px;overflow-wrap:anywhere}.word-row>span{font-size:10px;max-width:35%}.word-row>small{white-space:normal;font-size:8px;max-width:19%}.word-row>div>span{font-size:9px;overflow-wrap:anywhere}.word-row>.icon{width:11px}.import-note{padding:20px;margin-top:24px}.import-note p{font-size:11px}.quiz-intro{padding:35px 20px}.quiz-intro h2{font-size:22px}.quiz-intro p{font-size:11px}.quiz-intro .eyebrow{font-size:9px}.quiz-intro>small{font-size:9px}.quiz-intro .big-icon{width:55px;height:55px;margin-bottom:20px}.bar-chart{gap:8px;height:210px}.bar-track{height:150px;max-width:30px}.bar-column{font-size:10px}.bar-column small{font-size:8px}.activity-panel .section-title{flex-wrap:wrap}.bar-chart{margin-top:20px}dialog{padding:33px 22px;max-height:90dvh;border-radius:13px}dialog h2{font-size:23px}.flashcard h2{font-size:31px}.quiz-word{font-size:31px!important}.rating-buttons{gap:6px}.rating-buttons button{font-size:11px;padding:10px 3px}.rating-buttons small{font-size:8px}.quiz-option{font-size:12px;padding:12px;gap:11px}.quiz-option>span{font-size:10px;width:23px;height:23px}.example p{font-size:15px}.example small{font-size:10px}.form-row{gap:12px}.reading-text{padding:16px;font-size:12px}.detail-word{gap:15px}.detail-word span{font-size:11px}.inline-actions{gap:12px}.file-picker{font-size:9px}#toast{bottom:85px;font-size:11px;width:calc(100% - 40px);max-width:430px}.goal-card{display:block}.goal-ring{width:125px;height:125px;margin:15px auto}.goal-card>p{font-size:10px}.goal-card .tiny-text{font-size:9px}.dashboard-grid{gap:17px}.goal-card{display:none}}
/* Japanese typography, accessibility contrast/focus, and mobile/tablet ergonomics */
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,.file-picker:focus-within{outline:2px solid var(--accent);outline-offset:2px;box-shadow:0 0 0 4px #e5c89099}
[lang="ja"]{font-feature-settings:"palt" 1}
.hero-art-text{font-family:var(--serif)}
.word-row>div>span[lang="ja"],.reading-text[lang="ja"]{font-family:var(--font-ja)}
button.mini-avatar{border:0;padding:0;font-size:14px;font-weight:500;transition:filter .15s}
button.mini-avatar:hover{filter:brightness(.96)}
dialog h2{padding-right:36px}
.flashcard h2,.quiz-word{padding-right:0}
@media(max-width:900px){
  .topbar-right{gap:10px}
  .breadcrumb,.date,.eyebrow,.hero-label,.hero-footnote,.stat-box>div>span,.section-title>span,.section-title p,.plan-item p,.material-meta,.material-info p,.local-note,.main-shell footer,.main-shell footer .text-button,.word-row>small,.word-row>div>span,.quiz-intro .eyebrow,.quiz-intro>small,.bar-column small,.rating-buttons small,.example>span,.example small,.field-hint,.tiny-text,.brand small,.small-quote small,.profile small,.nav-count{font-size:11px}
  .plan-item h3,.material-info h3,.word-row>span,.page-heading p,.hero p,.import-note p,.quiz-intro p,.detail-word span{font-size:12px}
  .nav-item{min-height:44px;font-size:12px}
  .profile{min-height:44px;font-size:12px}
  .round-button,.plan-item .round-button{width:44px;height:44px}
  .round-button .icon{width:17px;height:17px}
  .modal-close{right:12px;top:12px}
  .level-select select{min-height:44px;padding:8px 10px;font-size:16px}
  .mini-avatar{width:44px;height:44px;font-size:15px}
  .primary,.secondary,.danger{min-height:44px}
  .page-heading>.primary,.page-heading>.secondary{min-height:44px;padding:10px 14px;font-size:13px}
  .filter{min-height:44px;padding:8px 12px;font-size:13px}
  .search{min-height:44px;padding:6px 12px}
  input,select,textarea,.search input{font-size:16px}
  input::placeholder,textarea::placeholder{font-size:14px}
  .text-button,.text-link,.main-shell footer a{min-height:44px;display:inline-flex;align-items:center;padding:0 4px;font-size:12px}
  .file-picker{min-height:44px;padding:10px 14px;font-size:12px}
  .rating-buttons button,.quiz-option{min-height:48px}
}
@media(max-width:640px){
  .sidebar{height:auto;min-height:68px;padding:4px 6px calc(6px + env(safe-area-inset-bottom))}
  .nav-item{min-height:54px;padding:6px 2px;font-size:11px}
  .main-shell{padding-bottom:calc(84px + env(safe-area-inset-bottom))}
  .topbar{height:64px;padding:0 16px}
  .mini-avatar{display:grid}
  .level-select select{min-height:44px;padding:8px 10px;font-size:16px}
  .material-cover{width:108px;min-height:111px;height:auto;align-self:stretch;padding:12px 10px}
  .cover-type{font-size:11px;letter-spacing:1px}
  .cover-jp{font-size:14px;letter-spacing:.5px;line-height:1.4;white-space:nowrap}
  .stat-box{padding:12px 10px}
  .stat-box strong{font-size:22px}
  .stat-box strong small{font-size:11px}
  .word-row{padding:14px 12px;gap:10px}
  .word-row>div>span{font-size:12px}
  .word-row>span{font-size:12px}
  .word-row>small{font-size:11px}
  dialog{padding:36px 20px 24px}
  dialog h2{padding-right:40px}
  #toast{bottom:calc(84px + env(safe-area-inset-bottom))}
}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

.speech-button{width:36px;height:36px;margin-inline-start:6px;vertical-align:middle}
.word-entry{display:flex;align-items:center;background:var(--surface);border-bottom:1px solid var(--border);padding-inline-end:12px}
.word-entry>.word-row{border:0;flex:1;min-width:0}
.word-entry:last-child{border:0}
.detail-word{align-items:center}
.detail-word>span{margin-inline-start:auto}
#speech-status{position:sticky;bottom:0;margin:8px 0;color:var(--text);background:var(--surface);font-size:13px}
#speech-status:empty{margin:0}

dialog h2.exam-prompt{margin-top:20px;font-size:clamp(19px,4vw,26px)}
.exam-prompt mark{background:none;color:inherit;text-decoration:underline;text-underline-offset:.18em}
.exam-options{display:grid;gap:8px;border:0;padding:0;margin:12px 0 20px;min-width:0}
.exam-options legend{padding:0;margin-bottom:10px;font-size:14px}
form label.exam-option{flex-direction:row;min-height:48px;margin:0;font-size:16px;font-family:var(--serif);cursor:pointer;overflow-wrap:anywhere}
.exam-option input{margin:0 8px 0 0;accent-color:var(--accent);flex:none}
.exam-option:has(:checked){border-color:var(--accent);background:var(--sage)}
.exam-sections{display:flex;flex-wrap:wrap;gap:10px;list-style:none;padding:0}
.exam-sections li{background:var(--bg);border-radius:8px;padding:8px 12px}
.exam-sections strong{margin-inline-start:12px}
.exam-total strong{font-size:28px;color:var(--accent)}
.exam-results{padding-inline-start:24px;overflow-wrap:anywhere}
.exam-results li{padding:12px 0;border-bottom:1px solid var(--border)}
.exam-results p{margin:4px 0}
.exam-results [lang="ja"]{font-family:var(--serif)}
#exam-status:empty{margin:0}
