:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#302d2c;background:#fbf5f4;font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer;min-height:44px;padding:10px 17px;border:1px solid #e6d9d8;border-radius:12px;background:white;color:#574b4b;font-weight:650}button:disabled{opacity:.5;cursor:default}button:hover:not(:disabled){background:#f7e8e8}a{color:#9a535d;text-decoration:none}button:focus-visible,a:focus-visible{outline:3px solid #bb6876;outline-offset:3px}[hidden]{display:none!important}header{display:flex;align-items:center;gap:22px;min-height:76px;padding:12px max(20px,calc((100vw - 1080px)/2));background:white;border-bottom:1px solid #eee2e0}header a{white-space:nowrap}header b{font-size:14px}header button{margin-left:auto}main{max-width:960px;margin:30px auto;padding:0 24px 40px}section{background:#fff;border:1px solid #eee4e1;border-radius:24px;padding:32px}.eyebrow{font-size:12px;letter-spacing:.13em;color:#ac6570;font-weight:750}h1{font-size:clamp(28px,5vw,42px);letter-spacing:-.04em}h2{font-size:clamp(24px,4vw,34px);line-height:1.65}h3{font-size:17px;margin-top:26px}p{line-height:1.8}.small{font-size:13px;color:#827675}.settings{display:flex;gap:20px;align-items:end;flex-wrap:wrap;margin:30px 0}label{display:block;font-size:14px}select{display:block;margin-top:8px;border:1px solid #dccbc9;border-radius:10px;padding:12px;max-width:100%;background:white}.check{display:flex;align-items:center;gap:10px;min-height:44px}.check input{width:19px;height:19px;accent-color:#b66b78}.primary{background:#ad6471;color:#fff;border-color:#ad6471}.primary:hover:not(:disabled){background:#975362}.progress-head{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:13px}.progress-head h2{margin:0}progress{width:100%;height:7px;margin:20px 0;accent-color:#ad6471}#prompt{text-align:center;margin:25px 0}.slots{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin:25px 0}.slot{min-width:45px;min-height:40px;border-bottom:2px solid #d9bfc3;padding:6px;text-align:center;font-size:22px;overflow-wrap:anywhere;max-width:100%}textarea{display:block;resize:vertical;width:100%;min-height:100px;border:1px solid #d8c7ca;border-radius:14px;padding:16px;font-size:20px;margin:9px 0 16px;outline-color:#bb6876}.answer-actions{display:flex;gap:8px;flex-wrap:wrap}.answer-actions .primary{margin-left:auto}#feedback{border-top:1px solid #eee0df;margin-top:25px}#verdict{font-size:22px;color:#46745c}#verdict.wrong{color:#a95562}.correct-answer{background:#faf4f3;border-radius:15px;padding:16px}.correct-answer p{margin:3px 0}#correct{font-size:24px;overflow-wrap:anywhere}.multiline{white-space:pre-wrap}.tokens{display:flex;flex-wrap:wrap;gap:10px}.token{flex:1 1 125px;max-width:240px;padding:14px;border:1px solid #eee3e1;border-radius:13px;overflow-wrap:anywhere}.token strong{display:block;font-size:21px}.token small{display:inline-block;background:#eeeaf7;color:#685181;padding:4px 8px;border-radius:6px;margin:9px 0}.token[data-pos="動詞"] small,.token[data-pos="助動詞"] small{background:#fbe3e6;color:#a3475d}.token[data-pos="名詞"] small,.token[data-pos="代名詞"] small{background:#e4edf9;color:#426799}.token[data-pos="形容詞"] small{background:#e4f1e8;color:#447955}.token p{font-size:13px;margin:0}.next{position:sticky;bottom:max(12px,env(safe-area-inset-bottom));display:block;margin:25px 0 0 auto;box-shadow:0 3px 15px #5b26352b}#status:empty{display:none}#errors{color:#a03748}#previewRows{max-height:400px;overflow:auto;margin:15px 0}#previewRows article{padding:15px;border-bottom:1px solid #eee}#previewRows p{white-space:pre-wrap;overflow-wrap:anywhere}input[type=file]{display:block;margin:15px 0;max-width:100%}#result button{margin:6px}#importStatus,#yourAnswer{overflow-wrap:anywhere}@media(max-width:600px){header{padding:12px 16px;gap:10px;flex-wrap:wrap}header b{font-size:12px}main{margin:16px auto;padding:0 12px 24px}section{padding:20px 16px;border-radius:18px}.settings{gap:12px}.settings label{max-width:100%}.slot{font-size:19px;min-width:35px}.answer-actions button{padding:10px 12px;font-size:14px}.token{flex-basis:110px}.next{width:100%}}

#prompt,#categoryLabel,#alternatives,#explanation{overflow-wrap:anywhere}
/* Inline typing: a fixed study viewport with paginated text, never scroll-to-answer. */
body.studying{overflow:hidden;height:100dvh}body.studying>header,body.studying #status{display:none}body.studying main{position:fixed;top:var(--study-top,0px);left:0;width:100%;height:var(--study-height,100dvh);max-width:none;margin:0;padding:12px max(12px,calc((100vw - 1100px)/2)) max(12px,env(safe-area-inset-bottom));overflow:hidden}
#exercise{height:100%;display:grid;grid-template-rows:44px 4px minmax(50px,.85fr) minmax(70px,1.3fr) minmax(32px,.4fr) 44px;gap:8px;padding:20px;overflow:hidden}#exercise.answered{grid-template-rows:44px 4px minmax(50px,.65fr) minmax(90px,1fr) minmax(100px,1.2fr) 44px}
#exercise progress{margin:0;height:4px;display:block}#exercise .progress-head{min-width:0}#exercise .progress-head button{min-height:40px}#exercise .prompt-wrap{display:flex;flex-direction:column;min-height:0;overflow:hidden}#categoryLabel{font-size:11px;line-height:16px;margin:0;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex-shrink:0}#exercise #prompt{min-height:0;flex:1;font-size:clamp(18px,2.8vw,30px);line-height:1.5;margin:4px 0 0;overflow:hidden;white-space:pre-wrap;text-align:center}
#exercise .sentence-block{display:flex;flex-direction:column;min-height:0;margin:0}#exercise .slots,.word-probe{display:flex;align-content:center;align-items:start;justify-content:center;flex-wrap:wrap;column-gap:10px;row-gap:12px;box-sizing:border-box;margin:0;padding:2px 0;min-height:0;overflow:hidden;flex:1}
.word-probe{position:fixed!important;left:-20000px!important;top:0!important;visibility:hidden;flex:none!important;align-content:flex-start!important;pointer-events:none}
.word-cell{flex-shrink:0;max-width:100%;display:flex;flex-direction:column;align-items:center;min-width:0}.word-input{display:block;width:100%;min-width:0;border:0;border-bottom:2px solid #cda7af;border-radius:0;background:transparent;color:#302d2c;text-align:center;font-family:inherit;font-size:clamp(20px,2.8vw,30px);line-height:1.4;padding:3px 2px;outline:none;box-shadow:none}.word-input:focus{border-bottom:3px solid #9a475c;background:#fbf2f3}.word-input[readonly]{cursor:pointer;color:#302d2c}.pos-label{font-size:10px;line-height:14px;min-height:22px;padding:3px 0;border:0;border-radius:4px;margin-top:2px;max-width:100%;background:#f3edf7;color:#755681;white-space:nowrap}.word-cell[data-pos="動詞"] .pos-label,.word-cell[data-pos="助動詞"] .pos-label{color:#a3475d;background:#fbe9ed}.word-cell[data-pos="名詞"] .pos-label,.word-cell[data-pos="代名詞"] .pos-label{color:#426799;background:#edf3fb}.word-cell[data-pos="形容詞"] .pos-label{color:#447955;background:#eaf5ed}
.pager{display:flex;justify-content:center;align-items:center;gap:10px;font-size:11px;height:24px;flex-shrink:0;margin:2px 0 0}.pager button{min-height:24px;height:24px;min-width:36px;padding:0 10px;border:0;font-size:20px;line-height:24px}.pager.unneeded{visibility:hidden}#exercise #feedback{display:flex;flex-direction:column;min-height:0;overflow:hidden;border:0;border-top:1px solid #eee0df;margin:0;padding:6px 0 0}#exercise #verdict{flex-shrink:0;font-size:13px;line-height:18px;margin:0;color:#46745c;font-weight:650}#exercise #verdict.wrong{color:#a95562}#reviewTools{flex-shrink:0}.detail-tabs{display:flex;gap:5px;padding:4px 0;align-items:center;flex-wrap:nowrap}.detail-tabs button{font-size:12px;min-height:28px;padding:4px 10px;white-space:nowrap}.detail-tabs button[aria-pressed=true]{background:#f4e4e7;border-color:#c28b97;color:#8c4153}.detail-tabs #speak{margin-left:auto}.detail-body{flex:1;min-height:0;font-size:15px;line-height:1.6;white-space:pre-wrap;overflow:hidden;overflow-wrap:anywhere;margin:3px 0 0}#exercise:not(.answered) #detailPager{display:none}#exercise .answer-actions{align-items:center;flex-wrap:nowrap;gap:8px}#exercise .answer-actions button{height:44px;min-height:44px;font-size:14px;white-space:nowrap}#exercise #next{margin-left:auto;min-width:180px}
@media(max-width:600px){body.studying main{padding:6px 6px max(6px,env(safe-area-inset-bottom))}#exercise{padding:12px;gap:6px;border-radius:16px}#exercise .slots{column-gap:8px;row-gap:9px}#exercise #prompt{font-size:19px}.word-input{font-size:22px}.detail-tabs{gap:3px}.detail-tabs button{padding:4px 6px;font-size:11px}.detail-body{font-size:14px}#exercise #next{width:100%}#exercise .answer-actions button{padding:8px 12px}.pos-label{font-size:10px}}
body.short-study #exercise{padding:6px 12px;gap:3px;grid-template-rows:34px 3px minmax(30px,.6fr) minmax(50px,1fr) 20px 36px}body.short-study #exercise.answered{grid-template-rows:34px 3px minmax(30px,.5fr) minmax(62px,.8fr) minmax(85px,1fr) 36px}body.short-study #categoryLabel{display:none}body.short-study #exercise #prompt{font-size:16px;line-height:1.35}body.short-study .word-input{font-size:19px;line-height:1.2;padding:1px}body.short-study #exercise .slots{row-gap:4px}body.short-study #exercise .answer-actions button,body.short-study #exercise .progress-head button{height:34px;min-height:34px;padding:4px 12px}body.short-study .detail-body{font-size:12px;line-height:1.4}body.short-study .detail-tabs{padding:0}body.short-study .detail-tabs button{height:24px;min-height:24px}body.short-study #verdict{font-size:11px;line-height:15px}body.short-study .pager{height:20px}body.short-study .pager button{height:20px;min-height:20px;line-height:20px}
#exercise.answered .slots{align-content:flex-end}
