:root{--ink:#163d34;--muted:#77877d;--green:#245d49;--cream:#f6f5ed;--line:#e4e6d9;--gold:#e1b457}*{box-sizing:border-box}body{margin:0;background:var(--cream);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans SC",sans-serif;line-height:1.5}button,input,select{font:inherit}button{cursor:pointer;border:0;color:inherit}button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--gold);outline-offset:3px}button:disabled{cursor:default;opacity:.65}.app{max-width:560px;min-height:100dvh;margin:auto;background:var(--cream);position:relative;padding:0 22px 104px}header{display:flex;align-items:center;justify-content:space-between;padding:26px 0 22px}.brand{display:flex;gap:10px;align-items:center}.logo{width:43px;height:43px;border-radius:15px;background:var(--ink);color:#fff;display:grid;place-items:center;font-family:serif;font-size:25px}.brand strong{display:block;font-size:20px;letter-spacing:2px}.brand small{display:block;font-size:10px;letter-spacing:1px;color:var(--muted)}.offline{font-size:11px;border:1px solid var(--line);padding:6px 9px;border-radius:20px;color:#587164}.offline i{display:inline-block;width:5px;height:5px;background:#799c68;border-radius:50%;margin-right:3px}h1{font-size:29px;font-weight:650;letter-spacing:-1px;margin:8px 0 4px}h2{font-size:18px;margin:0 0 12px}h3{font-size:15px;margin:12px 0 5px}p{margin:6px 0}.muted{color:var(--muted);font-size:13px}.eyebrow{font-size:10px;letter-spacing:2px;font-weight:600;color:#859378;text-transform:uppercase}.row{display:flex;align-items:center;justify-content:space-between;gap:10px}.hero{background:var(--ink);color:#f7f8eb;border-radius:23px;padding:23px;margin:23px 0 20px;position:relative;overflow:hidden}.hero:after{content:"";position:absolute;width:130px;height:130px;border:1px solid #ffffff12;border-radius:50%;right:-20px;top:-40px;box-shadow:0 0 0 20px #ffffff05,0 0 0 40px #ffffff04;pointer-events:none}.hero small{color:#b9cdc0;font-size:12px}.stats{display:flex;gap:28px;margin-top:14px}.stats strong{display:block;font-size:29px;line-height:1.2;font-weight:500}.stats span{font-size:11px;color:#b9cdc0}.progress{height:5px;border-radius:8px;background:#ffffff1a;margin-top:21px;overflow:hidden}.progress i{display:block;background:var(--gold);height:100%;border-radius:8px}.section-head{margin:22px 0 13px;display:flex;justify-content:space-between;align-items:center}.section-head h2{margin:0}.pill{border-radius:20px;background:#e9eddf;padding:5px 10px;font-size:11px;color:#56715a}.select{background:transparent;color:var(--ink);border:1px solid var(--line);padding:8px 10px;border-radius:10px;max-width:100%}.card{background:#fffef8;border:1px solid #e4e5d7;border-radius:23px;padding:23px;box-shadow:0 8px 20px #213c2110}.word-card{min-height:295px;display:flex;flex-direction:column;position:relative;width:100%;text-align:left}.word-heading{text-align:center;margin:auto 0;padding:28px 0 22px}.word-heading strong{display:block;font-family:Georgia,"Times New Roman",serif;font-size:38px;font-weight:500;overflow-wrap:anywhere}.word-heading small{color:#899186;font-size:12px}.word-heading .meaning{font-family:inherit;font-size:21px;line-height:1.6;font-weight:500;margin:10px 0 0}.card-bottom{display:flex;justify-content:space-between;font-size:11px;color:#869078}.tag{font-size:11px;color:#597459}.flip-hint{color:#8b967e;text-align:center;font-size:12px;margin-top:14px}.rate-buttons{display:grid;grid-template-columns:1fr 1fr 1fr;gap:9px;margin:15px 0}.rate{padding:13px 3px;border-radius:13px;background:#ebe9df;font-size:13px}.rate small{display:block;font-size:10px;margin-top:3px;opacity:.7}.rate.known{background:var(--green);color:white}.rate.unknown{background:#f1e5d8;color:#986443}.primary{background:var(--green);color:#fff;padding:14px 20px;border-radius:13px;font-size:14px}.wide{width:100%}.secondary{background:#e8ecdf;border-radius:12px;padding:12px 15px}.quiet{padding:7px;background:transparent;color:#647c69;font-size:12px}.notice{font-size:11px;color:#91957f;line-height:1.7;margin:20px 0}.source{font-size:12px;color:#7d886e;overflow-wrap:anywhere}.meaning-list{font-size:15px;line-height:1.85}nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);display:flex;justify-content:space-around;width:100%;max-width:560px;background:#fcfcf6f5;backdrop-filter:blur(16px);border-top:1px solid var(--line);padding:10px 8px calc(12px + env(safe-area-inset-bottom));z-index:20}nav button{background:transparent;font-size:10px;color:#98a08e;padding:4px 22px;border-radius:12px}nav button span{display:block;font-size:24px;line-height:1.2;margin-bottom:3px}nav button.active{color:var(--green);background:#e9eddf}.search{width:100%;padding:13px 15px;background:#fffef8;border:1px solid var(--line);border-radius:13px;margin:18px 0 11px;font-size:14px}.filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}.filters select{flex:1;font-size:12px;min-width:0}.word-row{width:100%;text-align:left;padding:17px 3px;background:transparent;border-bottom:1px solid var(--line);display:flex;gap:12px;align-items:center}.word-row .number{font-size:11px;color:#a0a58b;min-width:23px}.word-row .word-label{font-size:18px;font-family:Georgia,serif;font-weight:bold}.word-row .gloss{display:block;font-size:12px;color:#7d8973;margin-top:3px}.word-row .info{flex:1;min-width:0}.word-row .status{font-size:10px;border-radius:8px;background:#e9eddf;padding:4px 6px;white-space:nowrap}.empty{padding:40px 15px;text-align:center;color:#76856c}.quiz-word{font-size:38px;font-family:Georgia,serif;text-align:center;margin:28px 0}.choices{display:flex;flex-direction:column;gap:10px;margin:20px 0}.choice{background:#fffef8;border:1px solid var(--line);border-radius:13px;padding:16px;text-align:left;font-size:14px}.choice b{font-size:11px;border-radius:7px;padding:5px 8px;background:#f0f1e8;display:inline-block;margin-right:11px;color:#79866d}.choice.correct{border-color:#56896a;background:#e2efdf;opacity:1}.choice.wrong{border-color:#c29479;background:#f6e9df;opacity:1}.quiz-feedback{font-size:14px;border-radius:13px;background:#e9eddf;padding:15px;margin-bottom:15px}.setting-row{padding:17px 0;border-bottom:1px solid var(--line)}.setting-row p{font-size:12px;color:var(--muted)}.setting-row button{margin-top:9px}.tiny{font-size:11px;color:var(--muted)}.metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:22px 0}.metric{padding:18px 7px;text-align:center;background:#e9eddf;border-radius:15px}.metric strong{font-size:25px;display:block}.metric span{font-size:11px;color:#738269}dialog{border:1px solid var(--line);border-radius:22px;padding:24px;background:var(--cream);width:calc(100% - 34px);max-width:500px;color:var(--ink);max-height:85dvh;overflow:auto}dialog::backdrop{background:#152d2580}dialog h2{font-family:Georgia,serif;font-size:32px;margin:0 0 14px}dialog .wide{margin-top:20px}#toast{position:fixed;bottom:100px;left:50%;transform:translateX(-50%);background:#173d34;color:white;border-radius:12px;padding:12px 20px;font-size:13px;z-index:50;opacity:0;pointer-events:none;transition:opacity .2s;max-width:90%;text-align:center}#toast.show{opacity:1}.backup-text{width:100%;min-height:140px;margin:14px 0;border:1px solid var(--line);border-radius:12px;padding:10px;font:11px monospace}.goal{width:80px}.check{display:flex;align-items:center;gap:8px;font-size:13px;margin:15px 0}.hide{display:none!important}@media(min-width:600px){.app{border-left:1px solid var(--line);border-right:1px solid var(--line);padding-left:28px;padding-right:28px}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}

.library-switch{display:flex;background:#e9eddf;border-radius:14px;padding:4px;margin:18px 0 12px;gap:4px}.library-switch button{flex:1;padding:10px 8px;border-radius:11px;background:transparent;font-size:14px}.library-switch button.selected{background:var(--ink);color:white;box-shadow:0 2px 5px #163d3420}.phrase-scope{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:8px 0 16px}.phrase-scope label{font-size:12px;color:var(--muted)}.phrase-scope select{font-size:12px;flex:1}.phrase-scope p{width:100%;margin:0}.card-source{font-size:10px;line-height:1.8;color:#7d886e;text-align:left;overflow-wrap:anywhere;margin:0 0 14px}.word-card>.row{align-items:flex-start;flex-wrap:wrap}.word-card .tag{font-size:10px}.card-bottom{gap:12px}.row:has(#speak-word){flex-wrap:wrap}.quiz-word{overflow-wrap:anywhere}.word-heading{width:100%}.word-heading strong{font-size:clamp(28px,8vw,38px)}.section-head{gap:8px}.section-head .select{font-size:12px}@media(max-width:360px){.app{padding-left:16px;padding-right:16px}.stats{gap:20px}.card{padding:19px}.hero{padding:20px}nav button{padding-left:18px;padding-right:18px}}

/* 1.2: roomy, flat study cards. Height grows with content; no clipped senses. */
.word-card{min-height:470px;padding:25px 23px;border-radius:20px;box-shadow:none;gap:0}
.card-meta{row-gap:8px}.card-meta .tag{line-height:1.7;text-align:right;flex:1;min-width:130px}
.word-heading{margin:0;padding:32px 0 27px}.word-heading strong{line-height:1.25}.word-heading small{display:block;margin-top:13px}
.is-flipped .word-heading{padding:28px 0 25px}
.recall-note{text-align:center;font-size:12px;line-height:1.9;color:#87917e;margin:10px 0 32px}
.card-meanings{width:100%;margin-bottom:25px}.meaning-section+.meaning-section{border-top:1px solid var(--line);margin-top:21px;padding-top:18px}
.meaning-label{display:block;color:#466854;font-size:12px;font-weight:600;letter-spacing:.2px}.meaning-label>span{font-size:10px;font-weight:400;letter-spacing:0;color:#8a937e;margin-left:6px}
.card-meanings .meaning{font-size:20px;line-height:1.75;font-weight:500;margin:10px 0 0;overflow-wrap:anywhere}
.other-meaning{font-size:16px;line-height:1.9;margin:9px 0 0;color:#49644f;overflow-wrap:anywhere}
.meaning-note{font-size:10px;font-weight:400;line-height:1.8;color:#909783;margin:7px 0 0}
.word-card .card-source{border-top:1px solid var(--line);padding-top:17px;margin:auto 0 20px;font-size:11px;line-height:1.85;width:100%}
.card-source p{margin:8px 0 0}.card-bottom{flex-wrap:wrap;row-gap:5px;line-height:1.8}
.library-switch button.selected{box-shadow:none}.hero:after{display:none}
@media(max-width:360px){.word-card{padding:23px 19px;min-height:465px}.card-meta .tag{text-align:left;flex-basis:100%}.card-meanings .meaning{font-size:19px}.other-meaning{font-size:15px}}

/* 1.3: compact pages, app-styled selectors, and quiet scrolling. */
*,*::before,*::after{scrollbar-width:none;-ms-overflow-style:none}
*::-webkit-scrollbar{display:none;width:0;height:0}
html{scroll-padding-bottom:110px}body{overflow-x:hidden}
.app{padding-top:1px}.library-switch{margin-top:16px}.hero{margin-top:18px}
.select-trigger{display:inline-flex;align-items:center;justify-content:space-between;gap:10px;text-align:left;min-height:40px;transition:background-color .16s,transform .16s;border-color:#dfe3d5}
.select-trigger:active{background:#e9eddf;transform:scale(.98)}.select-trigger>span:first-child{min-width:0;overflow-wrap:anywhere}
.select-chevron{width:7px;height:7px;display:block;border-right:1.4px solid currentColor;border-bottom:1.4px solid currentColor;transform:rotate(45deg);margin:0 2px 4px 3px;flex-shrink:0}
.filters .select-trigger{flex:1;font-size:12px;min-width:0}.phrase-scope .select-trigger{flex:1;font-size:12px}.goal{min-width:92px;width:auto}
.setting-row .setting-link{margin:0;padding:0;background:transparent;display:flex;align-items:center;justify-content:space-between;width:100%;text-align:left;gap:18px;min-height:48px}
.setting-link strong{font-size:15px}.setting-link small{display:block;font-size:12px;color:var(--muted);margin-top:5px}
#detail{padding:0;overflow:hidden;max-height:85vh;max-height:85dvh}
#detail[open]{display:flex;flex-direction:column;animation:dialog-enter .18s ease-out}
.dialog-scroll{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:24px 24px 4px;-webkit-overflow-scrolling:touch}
.dialog-footer{padding:16px 24px 22px;background:var(--cream);flex-shrink:0;border-top:1px solid #e4e6d970}
.dialog-footer .wide{margin:0}.dialog-scroll h3{margin-top:22px}.dialog-scroll .row{flex-wrap:wrap;gap:9px;margin-top:24px;margin-bottom:12px}
.dialog-scroll .source{line-height:1.85}.dialog-scroll .text-title{font-family:inherit;font-size:26px}
.word-family{border-top:1px solid var(--line);margin-top:20px}.family-list{display:flex;flex-direction:column;gap:10px;margin:14px 0 4px}
.family-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;padding:12px 14px;background:#e9eddf;border-radius:12px}
.family-word{font-family:Georgia,serif;font-size:19px;overflow-wrap:anywhere}.family-pos{font-size:11px;color:#60796b;align-self:center}.family-meaning{grid-column:1/-1;font-size:13px;color:#4c6759;line-height:1.7}
#selection-sheet{position:fixed;top:auto;right:0;bottom:0;left:0;width:100%;max-width:560px;max-height:80vh;max-height:80dvh;margin:0 auto;border:1px solid var(--line);border-bottom:0;border-radius:24px 24px 0 0;padding:10px 22px calc(24px + env(safe-area-inset-bottom));overflow:hidden;box-shadow:0 -12px 40px #152d2510}
#selection-sheet[open]{display:flex;flex-direction:column;animation:sheet-enter .18s cubic-bezier(.2,.7,.2,1)}
#selection-sheet::backdrop,#detail::backdrop{background:#173d3466;animation:veil-enter .16s ease-out}
.sheet-handle{height:4px;width:34px;border-radius:4px;background:#ccd5c7;margin:0 auto 17px;flex-shrink:0}
.sheet-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px;flex-shrink:0}
.sheet-header h2{font-family:inherit;font-size:19px;line-height:1.4;margin:0}.sheet-close{display:grid;place-items:center;background:#e8ecdf;width:34px;height:34px;border-radius:50%;font-size:25px;line-height:1;padding:0;flex-shrink:0}
#selection-options{display:flex;flex-direction:column;gap:8px;overflow-y:auto;overscroll-behavior:contain;padding:3px;min-height:0}
.sheet-option{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;padding:15px 17px;border-radius:14px;background:#eeefe5;text-align:left;font-size:15px;min-height:56px;transition:background-color .15s,transform .15s}
.sheet-option.is-selected{background:var(--green);color:#fffef8}.sheet-option:active{transform:scale(.985)}.option-check{width:22px;height:22px;display:grid;place-items:center;border:1px solid #a2b39f;border-radius:50%;font-size:13px;flex-shrink:0}.is-selected .option-check{background:#fffef8;border-color:#fffef8;color:var(--green)}
@keyframes sheet-enter{from{opacity:0;transform:translateY(24px)}to{opacity:1;transform:translateY(0)}}
@keyframes dialog-enter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@keyframes veil-enter{from{opacity:0}to{opacity:1}}
@media(max-width:360px){#selection-sheet{padding-left:16px;padding-right:16px}.dialog-scroll{padding:21px 20px 4px}.dialog-footer{padding:14px 20px 20px}.card-meta .tag{text-align:right;flex-basis:auto;min-width:0}.filters{gap:6px}.select-trigger{gap:7px;padding:9px 8px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.creator-credit{margin:14px 1px 0;color:#88917f;font-size:10px;letter-spacing:.4px;line-height:1.5}.creator-credit+.library-switch{margin-top:12px}

.license-block{font-size:12px;color:#60796b;margin:18px 0 12px}.license-block summary{cursor:pointer;padding:12px 0;color:var(--ink)}.license-text{white-space:pre-wrap;overflow-wrap:anywhere;font-size:11px;line-height:1.8}

.family-note{font-size:11px;line-height:1.8;color:#748674;margin:12px 0 0}

nav .nav-icon{display:block;width:25px;height:25px;margin:0 auto 5px;line-height:0}nav .nav-icon svg{display:block;width:100%;height:100%}

/* Proportional soft corners: conservative continuous-corner approximation for old WebViews. */
:root{--corner-xs:6px;--corner-sm:11px;--corner-md:17px;--corner-lg:24px;--corner-xl:30px}
*{-webkit-tap-highlight-color:transparent}
.card,.word-card{border-radius:var(--corner-xl);box-shadow:none}.hero{border-radius:var(--corner-xl)}
.library-switch{border-radius:var(--corner-md)}.library-switch button{border-radius:13px}
.primary,.secondary,.rate,.choice,.quiz-feedback{border-radius:var(--corner-md)}
.select-trigger{border-radius:13px}.search,.backup-text{border-radius:var(--corner-md)}
.metric{border-radius:var(--corner-lg)}.pill,.word-row .status,.choice b{border-radius:var(--corner-sm)}
nav button{border-radius:15px}.family-item{border-radius:var(--corner-md)}#toast{border-radius:var(--corner-md)}
#detail{border-radius:var(--corner-xl)}#selection-sheet{border-radius:var(--corner-xl) var(--corner-xl) 0 0}
.sheet-option{border-radius:var(--corner-md)}.sheet-close{border-radius:12px}.option-check{border-radius:7px}
#selection-options,.family-list{gap:0}.sheet-option+.sheet-option{margin-top:8px}.family-item+.family-item{margin-top:10px}
button{transition:background-color .16s,transform .12s}button:active{transform:scale(.985)}nav button:active{background:#dce6d4;color:var(--green);transform:scale(.95)}.word-card:active{transform:scale(.998)}
button:focus,input:focus,summary:focus{outline:2px solid var(--gold);outline-offset:3px}
.pointer-input button:focus,.pointer-input input:focus,.pointer-input summary:focus{outline:none}
input[type="checkbox"]{-webkit-appearance:none;appearance:none;display:inline-grid;place-content:center;width:18px;height:18px;flex-shrink:0;margin:0 2px 0 0;border:1.5px solid #99ab96;border-radius:var(--corner-xs);background:#fffef8;vertical-align:middle}
input[type="checkbox"]:checked{background:var(--green);border-color:var(--green)}
input[type="checkbox"]::after{content:"";display:none;width:8px;height:4px;border-left:2px solid white;border-bottom:2px solid white;transform:rotate(-45deg);margin-top:-2px}
input[type="checkbox"]:checked::after{display:block}
@media(prefers-reduced-motion:reduce){button{transition:none!important}button:active,nav button:active,.word-card:active{transform:none}}
/* Interactive labels should not trigger Android text-selection menus when held. */
nav,button{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
/* WebView 83 predates flex-gap: preserve the intended spacing with stable fallbacks. */
.stats{gap:0}.stats>div+div{margin-left:28px}
.word-card>.card-meta{width:100%}
.choices{display:grid;grid-template-columns:minmax(0,1fr)}
.filters{gap:0}.filters>.select-trigger+.select-trigger{margin-left:8px}
@media(max-width:360px){.stats>div+div{margin-left:20px}.filters>.select-trigger+.select-trigger{margin-left:6px}}


/* 1.4: a matched, unclipped 24-unit icon family and immediate tactile feedback.
   Visible state is never gated on an animation finishing. */
nav{align-items:stretch}
nav button{flex:1;min-width:0;max-width:100px;padding-left:8px;padding-right:8px;touch-action:manipulation}
nav .nav-icon{width:25px;height:25px;flex-shrink:0}
nav .nav-icon svg{overflow:visible}
button,summary,input[type="checkbox"]{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
summary,.check{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
button,summary,.check,input[type="checkbox"]{transition:background-color .14s ease,color .14s ease,border-color .14s ease,transform .12s cubic-bezier(.2,.7,.2,1)}
button:active:not(:disabled),summary:active{transform:scale(.975)}
nav button:active{transform:scale(.95)}
.word-card:active:not(:disabled){transform:scale(.992);background:#f0f3e7}
.word-row:active:not(:disabled),.quiet:active:not(:disabled),.setting-link:active:not(:disabled),summary:active,.check:active{background:#e4ebdc}
.secondary:active:not(:disabled),.rate:active:not(:disabled),.choice:active:not(:disabled),.sheet-option:active:not(:disabled){background:#dde7d5}
.primary:active:not(:disabled),.rate.known:active:not(:disabled),.sheet-option.is-selected:active:not(:disabled),.library-switch button.selected:active:not(:disabled){background:#1c4e3d}
.rate.unknown:active:not(:disabled){background:#ead9c6}
.select-trigger:active:not(:disabled){background:#e1e9d8}
.sheet-close:active:not(:disabled){background:#d7e2cf}
.check{border-radius:8px}
input[type="checkbox"]:active{transform:scale(.9)}
.license-block summary{border-radius:8px}
.license-block[open] .license-text{animation:content-reveal .16s ease-out}
@keyframes content-reveal{from{opacity:.75;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){button:active:not(:disabled),summary:active,input[type="checkbox"]:active{transform:none!important}*,*::before,*::after{animation:none!important;transition:none!important}}

/* 1.5: a bounded review workspace. Only the card body scrolls; rating and
   navigation stay in normal flex flow, including old Android WebView 83. */
nav button,nav button:active,nav button:active:not(:disabled){transition:none!important;animation:none!important;transform:none!important}
nav button:active:not(.active){background:transparent;color:#98a08e}
nav button.active:active{background:#e9eddf;color:var(--green)}
body.study-mode{overflow:hidden}
.study-mode .app{height:100vh;height:100dvh;min-height:0;display:flex;flex-direction:column;padding-bottom:0;overflow:hidden}

.study-mode #main{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}






.study-progress{flex-shrink:0;padding:9px 13px 10px;border-radius:16px;background:var(--ink);color:#f7f8eb}
.study-metrics{display:flex;align-items:center;justify-content:space-between}
.study-metrics>span+span{margin-left:8px}
.study-metrics strong{font-size:17px;font-weight:500;white-space:nowrap}
.study-metrics small{font-size:10px;color:#b9cdc0}
.study-progress .progress{height:3px;margin-top:7px}
.study-mode .section-head{flex-shrink:0;margin:9px 0 8px}
.study-mode .section-head h2{font-size:16px}
.study-mode .section-head .select-trigger{min-height:35px;padding-top:5px;padding-bottom:5px}
.review-stage{flex:1;min-height:0;display:flex;flex-direction:column}
.review-stage .word-card{flex:1;min-height:0;display:flex;flex-direction:column;padding:0;overflow:hidden;border-radius:24px}
.review-stage .word-card,.review-stage .word-card:active:not(:disabled){transform:none!important;transition:none!important;background:#fffef8}
.card-scroll{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;padding:18px 20px 0}
.card-scroll:focus{outline:2px solid var(--gold);outline-offset:-3px}
.pointer-input .card-scroll:focus{outline:none}
.card-scroll-content{display:flex;flex-direction:column;min-height:100%}
.review-stage .card-meta{flex-shrink:0;align-items:center}
.review-stage .card-meta .tag{min-width:0;font-size:10px}
.review-stage .word-heading,.review-stage .is-flipped .word-heading{flex-shrink:0;padding:20px 0 18px}
.review-stage .word-heading strong{font-size:clamp(28px,8vw,38px)}
.review-stage .word-heading small{margin-top:10px}
.review-stage .recall-note{flex-shrink:0;margin:4px 0 22px}
.review-stage .card-meanings{flex-shrink:0;margin-bottom:18px}
.review-stage .meaning-section+.meaning-section{margin-top:16px;padding-top:14px}
.review-stage .card-meanings .meaning{font-size:19px;line-height:1.7;margin-top:8px}
.review-stage .other-meaning{font-size:15px;line-height:1.8}
.review-stage .card-source{flex-shrink:0;margin:auto 0 0;padding:14px 0 13px;line-height:1.7}
.review-stage .card-source p{margin-top:6px}
.card-flip{flex-shrink:0;width:100%;min-height:40px;padding:8px 20px;background:#fffef8;border-top:1px solid var(--line);font-size:10px;line-height:1.6;border-radius:0;align-items:center;text-align:left}
.card-flip>span:last-child{margin-left:auto}
.card-flip,.card-flip:active:not(:disabled){transform:none!important;transition:background-color .14s ease}
.card-flip:active:not(:disabled){background:#f0f3e7}
.review-actions{flex-shrink:0;padding-top:9px}
.rating-slot{position:relative}
.review-actions .rate-buttons{margin:0;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.review-actions .rate{min-height:60px;padding:9px 3px;font-size:13px;line-height:1.5}
.review-actions .rate small{font-size:10px;margin-top:3px}
.review-actions.is-waiting .rate-buttons{visibility:hidden;pointer-events:none}
.review-actions .flip-hint{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;margin:0;padding:4px 8px;font-size:12px;pointer-events:none}
.review-actions #card-details{min-height:34px;padding:6px 4px;font-size:11px}

.study-empty{flex:1;min-height:0;overflow-y:auto;margin-bottom:8px;padding:24px 14px}
@media(min-width:600px){}
@media(max-width:360px){.card-scroll{padding-left:16px;padding-right:16px}.card-flip{padding-left:16px;padding-right:16px}.study-metrics>span+span{margin-left:5px}.study-metrics small{font-size:9px}}
@media(max-height:650px){
 
 

 .study-progress{padding:5px 11px 6px;border-radius:13px}.study-progress .progress{margin-top:4px;height:2px}.study-metrics strong{font-size:15px}
 .study-mode .section-head{margin:5px 0}.study-mode .section-head .select-trigger{min-height:31px}.study-mode .section-head h2{font-size:14px}
 .card-scroll{padding-top:12px}.review-stage .word-heading,.review-stage .is-flipped .word-heading{padding:14px 0}
 .card-flip{min-height:34px;padding-top:6px;padding-bottom:6px}.review-actions{padding-top:6px}.review-actions .rate{min-height:54px;padding:7px 3px}.review-actions #card-details{min-height:29px;padding:4px}

}

/* Very short landscape screens use horizontal review space rather than
   allowing the header/dock to squeeze the card's readable area to zero. */
.detail-short{display:none}
@media(max-height:460px) and (orientation:landscape){
 
 .study-mode #main{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;grid-template-rows:auto minmax(0,1fr);column-gap:8px}
 
 





 .study-mode .study-progress{grid-column:2;grid-row:1;align-self:center;padding:0;background:transparent;color:var(--ink)}
 .study-mode .study-progress .study-metrics>span:not(:first-child),.study-mode .study-progress .progress{display:none}
 .study-mode .study-progress small{color:var(--muted)}

 .study-mode .section-head{grid-column:3;grid-row:1;margin:0;min-width:0}
 .study-mode .section-head h2{display:none}
 .study-mode .section-head .select-trigger{font-size:11px;min-height:30px;padding:5px 7px}
 .review-stage{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:minmax(0,1fr) 40%;grid-template-rows:minmax(0,1fr);column-gap:10px;padding-bottom:3px}
 .review-stage .word-card{min-width:0;border-radius:18px}
 .card-scroll{padding:12px 14px 0}
 .review-stage .word-heading,.review-stage .is-flipped .word-heading{padding:12px 0}
 .card-flip{padding:6px 12px;min-height:32px;font-size:9px}
 .review-actions{min-width:0;padding-top:0;display:flex;flex-direction:column;justify-content:center}
 .review-actions .rate-buttons{display:flex;flex-direction:column;gap:0}
 .review-actions .rate{flex-shrink:0;min-height:40px;padding:4px 2px;font-size:12px;white-space:nowrap;border-radius:12px}
 .review-actions .rate+.rate{margin-top:4px}
 .review-actions .rate small{display:inline;margin:0 0 0 4px;font-size:9px}
 .review-actions .flip-hint{font-size:11px;padding:8px;line-height:1.8}
 .review-actions #card-details{margin-top:4px;min-height:28px;padding:4px 2px;font-size:10px}
 .review-actions .detail-long{display:none}.review-actions .detail-short{display:inline}



}
/* Extra-small portrait: reclaim spacing, preserving text and rating targets. */
@media(max-height:520px) and (orientation:portrait){
 
 

 .study-progress{padding-top:3px;padding-bottom:4px}
 .study-mode .section-head{margin-top:4px;margin-bottom:4px}
}

/* 1.0.6: content-sized quiz cards. Only the whole question area may scroll
   on unusually small screens or long content; never an individual card.
   Feedback and Next keep the same reserved row before and after answering. */
body.quiz-mode{overflow:hidden}
.quiz-mode .app{height:100vh;height:100dvh;min-height:0;display:flex;flex-direction:column;padding-bottom:0;overflow:hidden}

.quiz-mode #main{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}






.quiz-toolbar{flex-shrink:0;margin:0 0 9px}
.quiz-title-row,.quiz-filter-row{display:flex;align-items:center;justify-content:space-between}
.quiz-title-row{margin-bottom:6px}
.quiz-title-row h2{font-size:16px;margin:0}
.quiz-title-row .check{font-size:12px;margin:0}
.quiz-title-row .check input{margin-right:6px}
.quiz-filter-row>.pill{margin-left:8px}
.quiz-filter-row .select-trigger{min-height:35px;padding-top:5px;padding-bottom:5px;font-size:12px}
.quiz-stage{flex:1;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto;row-gap:9px}
.quiz-body{min-width:0;min-height:0;display:grid;grid-template-rows:max-content minmax(min-content,1fr);gap:8px;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;scrollbar-gutter:stable;scroll-padding:3px;padding:2px}
.quiz-question{flex:0 0 auto;min-width:0;min-height:0;max-height:none;padding:12px 14px;overflow:visible;border-radius:20px}
.quiz-question .quiz-word{font-size:clamp(26px,7.5vw,34px);line-height:1.2;margin:0 0 5px;overflow-wrap:anywhere}
.quiz-question .row{align-items:center;flex-wrap:wrap;gap:3px 10px}
.quiz-question .tag,.quiz-question .tiny{line-height:1.6;overflow-wrap:anywhere}
.quiz-body:focus-visible{outline:2px solid var(--gold);outline-offset:-3px}
.pointer-input .quiz-body:focus{outline:none}
.quiz-options{min-width:0;min-height:min-content;margin:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:repeat(var(--quiz-choice-rows,4),minmax(min-content,1fr));gap:8px;overflow:visible}
.quiz-options .choice{display:grid;grid-template-columns:26px minmax(0,1fr);align-items:center;column-gap:9px;min-height:48px;min-width:0;width:100%;height:auto;overflow:visible;padding:10px 12px;font-size:14px;line-height:1.55;overflow-wrap:anywhere;border-radius:15px;transform:none!important}
.quiz-options .choice>span{flex:1;min-width:0;white-space:normal;overflow:visible}
.quiz-options .choice b{flex:0 0 auto;font-size:11px;padding:3px 7px;margin:0}
.quiz-options .choice[aria-disabled="true"]{cursor:default}
.quiz-answered .choice:not(.correct):not(.wrong){background:#f1f2e9;color:#6e7e70}
.quiz-actions{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,2fr);column-gap:8px;min-height:0;padding-bottom:4px}
.quiz-actions .quiz-feedback{position:relative;display:grid;min-width:0;padding:10px 12px;margin:0;border-radius:15px;font-size:14px;line-height:1.5}
.feedback-sizing{grid-area:1/1;visibility:hidden;margin:0;pointer-events:none}
.feedback-live{grid-area:1/1;min-width:0;overflow:visible}
.feedback-live strong,.feedback-live>span{display:block;font-size:14px;font-weight:400;line-height:1.5}
.feedback-live strong{font-weight:600}
.quiz-feedback.is-waiting{background:#ecefe3;color:#7d8b78}
.quiz-actions #next-question{min-width:0;min-height:48px;padding:10px 8px;font-size:14px;border-radius:15px}
.quiz-actions #next-question:disabled{background:#e4e8db;color:#8a9583;opacity:1}
.quiz-empty{flex:1;min-height:0;overflow-y:auto;padding:22px 15px}

.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.verified-examples{flex-shrink:0;border-top:1px solid var(--line);padding-top:15px;margin:0 0 20px}
.verified-examples h3{font-size:13px;margin:0 0 10px}
.example-pair+.example-pair{border-top:1px solid var(--line);padding-top:14px;margin-top:14px}
.example-original{font-family:Georgia,"Times New Roman",serif;font-size:17px;line-height:1.65;overflow-wrap:anywhere}
.example-translation{font-size:14px;line-height:1.8;overflow-wrap:anywhere;margin-top:8px}
.example-label{display:block;color:var(--muted);font-size:11px;margin-bottom:3px}
.example-source{font-size:11px;line-height:1.6;color:var(--muted);margin-top:8px;overflow-wrap:anywhere}
@media(min-width:600px){}
@media(max-width:360px){}
@media(max-height:650px){
 
 

 .quiz-toolbar{margin-bottom:6px}.quiz-title-row{margin-bottom:4px}.quiz-filter-row .select-trigger{min-height:31px}
 .quiz-body{gap:7px}
 .quiz-question{padding:10px 12px}.quiz-question .quiz-word{font-size:28px}
 .quiz-options{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(var(--quiz-choice-compact-rows,2),minmax(min-content,1fr));gap:7px}
 .quiz-options .choice{padding:9px 10px}.quiz-stage{row-gap:7px}.quiz-actions .next-arrow{display:none}

}
@media(max-height:520px) and (orientation:portrait){

 .quiz-toolbar{display:flex;align-items:center;justify-content:space-between;margin-bottom:5px}
 .quiz-title-row{order:2;margin:0 0 0 8px}.quiz-title-row h2,.quiz-score{display:none}
 .quiz-filter-row{min-width:0}.quiz-filter-row .select-trigger{max-width:100%}
 /* The same single scroll region handles extreme heights without clipping. */
 .quiz-question{min-height:0;max-height:none;margin:0}
}
@media(max-height:460px) and (orientation:landscape){
 
 .quiz-mode #main{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;grid-template-rows:auto minmax(0,1fr);column-gap:8px}
 
 




 .quiz-toolbar{grid-column:3;grid-row:1;margin:0;min-width:0}
 .quiz-title-row{justify-content:flex-end;margin-bottom:3px}.quiz-title-row h2,.quiz-score{display:none}
 .quiz-title-row .check{font-size:10px}.quiz-filter-row{justify-content:flex-end}.quiz-filter-row .select-trigger{min-height:30px;font-size:11px;padding:5px 7px}
 .quiz-stage{grid-column:1/-1;grid-row:2;grid-template-columns:minmax(0,3fr) minmax(0,2fr);grid-template-rows:minmax(0,1fr);column-gap:9px;row-gap:0;padding-bottom:3px}
 .quiz-body{gap:6px}
 .quiz-question{padding:7px 10px;border-radius:16px}.quiz-question .quiz-word{font-size:24px;line-height:1.2;margin-bottom:4px}
 .quiz-options{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(var(--quiz-choice-compact-rows,2),minmax(min-content,1fr));gap:6px}
 .quiz-options .choice{padding:8px;font-size:14px}.quiz-options .choice b{margin:0;padding:2px 5px}
 .quiz-actions{display:flex;flex-direction:column;justify-content:center;padding-bottom:0}
 .quiz-actions .quiz-feedback{flex-shrink:0}.quiz-actions #next-question{flex-shrink:0;margin-top:8px}


}

.quiz-score{white-space:nowrap}

/* 1.7 authored sense pairs stay inside the existing bounded scroll region. */
.authored-sense{min-width:0;margin-top:12px;padding-bottom:14px;overflow-wrap:anywhere}
.authored-sense+.authored-sense{border-top:1px solid var(--line);padding-top:14px}
.authored-sense .sense-meaning{margin:0 0 10px}
.sense-pos{font-size:13px;color:var(--muted);margin-right:8px}
.authored-sense .example-pair{min-width:0}

/* 1.7 shared top geometry: only viewport size changes these tokens, never tab.
   Keep learn's existing compact footprint; words/profile now use the same one. */
:root{--header-credit-top:9px;--header-credit-size:10px;--header-switch-space:8px;--header-switch-pad:3px;--header-tab-pad-y:7px;--header-tab-pad-x:8px;--header-tab-size:14px}
.app{display:flex;flex-direction:column}
#main{display:flow-root}
.app>.creator-credit{flex:0 0 auto;margin:var(--header-credit-top) 1px 0;font-size:var(--header-credit-size);line-height:1.5;letter-spacing:.4px}
#main>.library-switch{display:flex;flex:0 0 auto;align-self:start;width:100%;min-width:0;margin:var(--header-switch-space) 0;padding:var(--header-switch-pad);gap:4px}
#main>.library-switch button{flex:1 1 0;min-width:0;padding:var(--header-tab-pad-y) var(--header-tab-pad-x);font-size:var(--header-tab-size);line-height:1.5;white-space:nowrap}
@media(max-height:650px){
 :root{--header-credit-top:4px;--header-credit-size:9px;--header-switch-space:5px;--header-tab-pad-y:5px;--header-tab-size:13px}
}
@media(max-height:520px) and (orientation:portrait){
 :root{--header-credit-top:2px;--header-switch-space:3px}
}
@media(max-height:460px) and (orientation:landscape){
 :root{--header-credit-top:2px;--header-credit-size:9px;--header-switch-space:4px;--header-switch-pad:2px;--header-tab-pad-y:5px;--header-tab-pad-x:2px;--header-tab-size:12px}
 #main>.library-switch{width:100%;grid-column:1/-1;grid-row:1}
 .study-mode #main,.quiz-mode #main{grid-template-rows:auto auto auto minmax(0,1fr)}
 .study-mode .study-progress{grid-column:1/3;grid-row:3}
 .study-mode .section-head,.quiz-toolbar{grid-column:3;grid-row:3}
 .review-stage,.quiz-stage{grid-row:4}
}

/* Shared contact line wraps as one header at narrow widths on every tab. */
.app>.creator-credit{display:flex;align-items:center;flex-wrap:wrap;column-gap:12px;row-gap:2px}
.creator-credit>span{display:block;max-width:100%;overflow-wrap:anywhere}

/* Individually adjudicated caveats remain visible inside the bounded card. */
.usage-warning{padding:11px 12px;margin:8px 0 14px;border:1px solid var(--line);border-radius:11px;background:#f2eee1;overflow-wrap:anywhere}
.usage-warning p{font-size:12px;line-height:1.7;margin:5px 0 0;color:#5f6252}

/* Reviewed teaching limits remain inside each bounded, scrollable sense block. */
.usage-note{margin:5px 0 9px;font-size:12px;line-height:1.65;color:var(--muted);overflow-wrap:anywhere}

/* 1.8: one phrase-filter row on all four tabs. Threshold text never resizes it. */
:root{--scope-height:34px;--scope-bottom:8px}
#main>.phrase-scope{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;column-gap:8px;flex:0 0 auto;width:100%;min-width:0;margin:0 0 var(--scope-bottom);grid-column:1/-1;grid-row:2}
#main>.phrase-scope label{margin:0;font-size:11px;line-height:1.5;white-space:nowrap;color:var(--muted)}
#main>.phrase-scope #phrase-threshold{width:100%;min-width:0;height:var(--scope-height);min-height:var(--scope-height);padding:5px 10px;font-size:12px;line-height:1.5;white-space:nowrap;overflow:hidden}
#main>.phrase-scope #phrase-threshold>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#main>.phrase-scope p{display:none}
@media(max-height:650px){:root{--scope-height:30px;--scope-bottom:5px}}
@media(max-height:520px) and (orientation:portrait){:root{--scope-bottom:3px}}

/* 1.8: one viewport-anchored navigation shell for every page. */
:root{--nav-height:64px;--nav-pad-top:6px;--nav-pad-bottom:4px;--nav-icon-size:25px;--nav-icon-gap:5px;--nav-label-size:10px;--nav-label-line:15px;--nav-button-pad:4px}
.app{padding-bottom:calc(var(--nav-height) + env(safe-area-inset-bottom) + 16px)}
.study-mode .app,.quiz-mode .app{padding-bottom:calc(var(--nav-height) + env(safe-area-inset-bottom) + 4px)}
.app>nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:560px;height:calc(var(--nav-height) + env(safe-area-inset-bottom));margin:0;flex-shrink:0;padding:var(--nav-pad-top) 8px calc(var(--nav-pad-bottom) + env(safe-area-inset-bottom));backdrop-filter:none;background:#fcfcf6;align-items:stretch}
.app>nav button{font-size:var(--nav-label-size);line-height:var(--nav-label-line);padding:var(--nav-button-pad) 8px;min-height:0}
.app>nav .nav-icon{width:var(--nav-icon-size);height:var(--nav-icon-size);margin:0 auto var(--nav-icon-gap)}
@media(max-height:650px){:root{--nav-height:58px;--nav-pad-top:4px;--nav-pad-bottom:3px;--nav-icon-size:23px;--nav-icon-gap:3px}}
@media(max-height:460px) and (orientation:landscape){:root{--nav-height:37px;--nav-pad-top:3px;--nav-pad-bottom:4px;--nav-icon-gap:0px;--nav-label-size:0px;--nav-label-line:0px;--nav-button-pad:3px}}

/* Release entry lives only in Profile; it cannot resize shared top/navigation. */
.apk-download{display:block;text-align:center;text-decoration:none;margin-top:10px}
.apk-download:focus-visible{outline:3px solid var(--gold);outline-offset:3px}
.apk-release details{margin-top:10px;font-size:12px;color:var(--muted)}
.apk-release summary{cursor:pointer}
.apk-checksum{overflow-wrap:anywhere;word-break:break-all;font-family:monospace}

/* Static vocabulary downloads; requested only on click. */
.table-downloads{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px}.table-downloads a{display:flex;align-items:center;justify-content:center;min-height:48px;text-align:center;text-decoration:none;color:var(--ink);font-size:14px;padding:12px 8px}.table-downloads a:focus-visible{outline:3px solid var(--gold);outline-offset:3px}

/* Shared year/frequency scope: identical geometry on all four pages. */
#main>.study-scope{flex:0 0 auto;grid-column:1/-1;grid-row:2;width:100%;margin:0 0 8px;min-width:0}
.scope-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:8px;align-items:end}
.scope-controls label{display:block;margin:0 0 4px;font-size:11px;line-height:16px;color:var(--muted)}
.scope-controls .select-trigger{width:100%;height:34px;min-height:34px;padding:6px 10px;border-radius:13px;font-size:12px;line-height:18px;white-space:nowrap}
.scope-reset{height:34px;padding:6px 9px;background:#efeee5;border:0;border-radius:12px;font-size:11px;color:var(--muted)}
.scope-summary{margin:4px 0 0;font-size:10px;line-height:15px;color:var(--muted)}
@media(max-height:650px){#main>.study-scope{margin-bottom:5px}.scope-controls label{margin-bottom:2px}.scope-controls .select-trigger,.scope-reset{height:30px;min-height:30px;padding-top:4px;padding-bottom:4px}.scope-summary{margin-top:2px}}

/* 1.0.4: content and label length never determine the shared shell geometry.
   Grid works on WebView 83 without flex-gap support. Library switches are
   immediate: only ordinary controls retain small, local press feedback. */
.app{width:100%;min-width:0}
#main{width:100%;min-width:0}
.app>.creator-credit{width:100%;min-width:0}
#main>.library-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-self:stretch}
#main>.library-switch button{width:100%;min-width:0;overflow:hidden;text-overflow:ellipsis}
#main>.library-switch button,#main>.library-switch button:active:not(:disabled){transform:none!important;transition:none!important;animation:none!important}
.scope-controls{width:100%;min-width:0;grid-template-columns:repeat(2,minmax(0,1fr)) 40px}
.scope-controls>div{min-width:0}
.scope-controls label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.scope-controls .select-trigger{min-width:0;max-width:100%;overflow:hidden}
.scope-controls .select-trigger>span:first-child{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.scope-controls .select-chevron{flex:0 0 auto}
.scope-summary{height:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* Deferred example text never leaves an empty card or enables premature scoring. */
.example-loading{margin:.55rem 0;padding:.65rem .8rem;border-radius:12px;background:var(--wash,#f3f6f3);font-size:.85rem;line-height:1.55}
.example-loading p{margin:0 0 .35rem}.example-loading p:only-child{margin:0}
.example-loading button{min-height:38px}.startup-placeholder{margin-top:2rem}
