:root{--bg:#f5f6fa;--paper:#fff;--ink:#20242b;--muted:#6b7280;--line:#e5e7eb;--dark:#111827;--red:#991b1b;--redbg:#fee2e2;--yellow:#92400e;--yellowbg:#fef3c7;--blue:#1d4ed8;--bluebg:#dbeafe;--green:#166534;--greenbg:#cfeecd;--purple:#6d28d9;--purplebg:#f3e8ff;font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:var(--ink);background:var(--bg)}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink)}.appShell{max-width:1180px;margin:auto;min-height:100vh;padding:18px 22px 86px}.topbar{display:flex;justify-content:space-between;gap:12px;align-items:flex-start}.brand{font-size:28px;font-weight:800;letter-spacing:-.35px}.subbrand{color:var(--muted);margin:5px 0 14px;font-size:14px}.topStatus{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.pill{display:inline-flex;border:1px solid var(--line);border-radius:999px;background:#fff;padding:5px 9px;font-size:12px}.pill.ok{color:#08755b}.pill.strong{background:#f3f4f6}.ghost{background:#fff;border:1px solid var(--line);color:var(--ink)}.settingsBtn{white-space:nowrap}.panel{display:none;background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px}.panel.active{display:block}.bottomNav{display:flex;gap:7px;margin:14px 0;flex-wrap:wrap}.bottomNav button{font:inherit;border:0;cursor:pointer;border-radius:10px;padding:9px 12px;background:#e5e7eb;color:var(--ink)}.bottomNav button.active{background:var(--dark);color:#fff}.dashboardGrid{display:grid;grid-template-columns:1.4fr 1fr;gap:12px;margin-bottom:12px}.heroCard,.infoCard,.pack,.studyCard{background:#fff;border:1px solid var(--line);border-radius:16px}.heroCard{padding:20px;background:linear-gradient(145deg,#fff,#f8fbff);border-color:#dbeafe}.eyebrow{text-transform:uppercase;letter-spacing:.08em;font-size:13px;color:var(--muted)}.targetRow{margin:8px 0 4px}.targetRow label{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:14px;color:#334155}.targetRow select,.inlineActions select,.modeCard select{font:inherit;border:1px solid #d1d5db;background:#fff;border-radius:10px;padding:7px 10px}.helpWrap{position:relative;display:inline-flex;align-items:flex-start}.helpDot{position:relative;top:-3px;width:15px;height:15px;border-radius:50%;padding:0;border:1px solid #f59e0b;background:#fff7ed;color:#d97706;font-size:10px;font-weight:400;line-height:13px;cursor:pointer}.helpPopover{position:absolute;z-index:40;top:19px;left:0;width:min(360px,80vw);padding:10px 11px;border:1px solid #fdba74;border-radius:11px;background:#fff;color:#374151;font-size:12px;font-weight:400;line-height:1.45;box-shadow:0 10px 28px rgba(15,23,42,.14)}.planSummaryRow{display:flex;align-items:flex-start;gap:6px;margin-top:5px}.planLine{color:var(--muted);line-height:1.55}.planSummaryRow .helpWrap{margin-top:3px}.progressTrack{height:9px;background:#e5e7eb;border-radius:999px;overflow:hidden;margin-top:10px}.progressFill{height:100%;width:0;background:#6f8f73;transition:width .25s ease}.progressMeta{font-size:13px;margin-top:6px}.primary,.secondary,.rating,.fileButton,.danger{font:inherit;cursor:pointer;border-radius:10px;padding:9px 12px;border:0}.primary{background:var(--dark);color:#fff}.secondary,.fileButton{background:#e5e7eb;color:var(--ink)}.danger{background:#fff;color:var(--red);border:1px solid #fecaca}.big{font-size:18px;padding:12px 18px;font-weight:700}.small{padding:6px 10px;font-size:12px}.heroCard>.big{margin-top:14px}.hidden{display:none!important}.doneBox{margin-top:10px;color:#111827;font-size:13px;line-height:1.45}.overrun{margin-top:12px;padding:10px;border-radius:10px;background:#fff7ed;color:#9a3412;font-size:13px;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.inlineActions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:14px}.statsGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:9px}.stat,.metric{background:#fff;border:1px solid var(--line);border-radius:14px;padding:11px;text-align:center}.stat b,.metric b{display:block;font-size:23px}.stat span,.metric span{font-size:12px;color:var(--muted)}.principleCard{padding:14px;margin-top:10px}.principleCard p{font-size:13px;line-height:1.5;margin-bottom:0}.studyWrap{max-width:900px;margin:0 auto}.studyToolbar{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;margin-bottom:12px}.studyToolbar #studyCounter{justify-self:start}.studyToolbar #leaveStudy{justify-self:center}.studyCard{min-height:405px;padding:28px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}.front{font-size:44px;font-weight:780;margin:24px 0 18px}.accent{font-size:20px;color:#7c3aed;margin-top:8px}.back{font-size:27px;margin-top:10px}.grammarBox{max-width:700px;width:100%;margin-top:12px;padding:11px 14px;border-radius:12px;background:#f8fafc;font-size:14px;line-height:1.6}.exampleBox{text-align:left}.ratingGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:20px}.rating.again{background:var(--redbg);color:var(--red)}.rating.hard{background:var(--yellowbg);color:var(--yellow)}.rating.good{background:var(--bluebg);color:var(--blue)}.rating.easy{background:#c7edc4;color:#14532d;border:1px solid #86d884;font-weight:400}.skipBtn{margin-top:12px}.linkBtn{font:inherit;border:0;background:transparent;color:#717780;cursor:pointer;padding:8px 10px;margin-top:12px;border-radius:9px}.linkBtn:hover{background:#f3f4f6;color:#4b5563}.sectionTitle{margin:0 0 12px;font-size:24px;line-height:1.2;font-weight:700}.note{font-size:13px;color:var(--muted);line-height:1.5}.modeGrid,.libraryGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.modeCard,.pack{border:1px solid var(--line);border-radius:14px;padding:15px;background:#fff}.modeCard h3,.pack h2{margin:0 0 6px}.modeCard p,.pack p{margin:0 0 12px;color:var(--muted);font-size:13px;line-height:1.45}.modeCard select{width:100%;margin-bottom:8px}.trainingTargetSummary{font-size:13px;color:var(--muted);margin:8px 0 12px}.modeActionRow{display:flex;align-items:center;gap:8px;min-height:34px}.modeCount{font-size:11px;color:var(--muted);margin-left:auto}.modeDisabled{opacity:.45;cursor:not-allowed}.modeDisabled:hover{filter:none}.metricGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.metric{padding:16px;background:#f8fafc;text-align:left}.metric b{font-size:28px}.metric span{font-size:13px}.progressStats{margin-top:12px}.divider{height:1px;background:var(--line);margin:16px 0}.sectionHead{display:flex;justify-content:space-between;align-items:end}.dictionaryToolbar{display:grid;grid-template-columns:2fr 1fr 1fr 1fr;gap:8px;margin-bottom:10px}.dictionaryToolbar input,.dictionaryToolbar select{font:inherit;border:1px solid #d1d5db;background:#fff;border-radius:10px;padding:9px 12px;width:100%}.dictionaryActions{margin-bottom:10px}.tableWrap{overflow:auto;max-height:650px;border:1px solid var(--line);border-radius:12px}table{width:100%;border-collapse:collapse;background:#fff}td,th{padding:9px;border-bottom:1px solid var(--line);font-size:13px;text-align:left;vertical-align:top}.wordState{font-size:11px;color:var(--muted);margin-top:3px}.tiny{font-size:12px;padding:6px 8px}.settingsGrid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.settingsGrid .full{grid-column:1/-1}.infoCard{padding:14px}.infoCard h2{margin:0 0 10px;font-size:18px}.settingsGrid label{display:block;font-size:12px;color:var(--muted);margin:10px 0 5px}.settingsGrid input{padding:10px 12px;border:1px solid var(--line);border-radius:10px;font:inherit;width:100%}.settingsGrid .otp{width:115px}.settingSelect{font:inherit;border:1px solid #d1d5db;background:#fff;border-radius:10px;padding:9px 12px;width:100%}.wide{width:100%;margin-top:10px}.status{font:12px/1.45 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;background:#f4f1eb;border-radius:10px;padding:10px;margin-top:10px;min-height:36px}.editOverlay{position:fixed;z-index:80;inset:0;background:rgba(0,0,0,.35);padding:24px;overflow:auto}.editPanel{max-width:760px;margin:30px auto;background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px}.editPanel h2{margin-top:0}.editGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.editGrid input,.editGrid select,.editGrid textarea{font:inherit;border:1px solid #d1d5db;background:#fff;border-radius:10px;padding:9px 12px;width:100%}.editGrid textarea{min-height:80px}.full{grid-column:1/-1}.editActions{display:flex;gap:8px;flex-wrap:wrap}.authHelp{font-size:12px;margin-top:5px}.fileButton{display:inline-block}.pack{margin-bottom:0}
@media(max-width:820px){.appShell{padding:14px 12px 92px}.topbar{align-items:center}.subbrand{font-size:13px}.bottomNav{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}.bottomNav::-webkit-scrollbar{display:none}.bottomNav button{font-size:11px;padding:9px 7px;flex:1;min-width:max-content}.dashboardGrid,.modeGrid,.libraryGrid,.settingsGrid,.metricGrid{grid-template-columns:1fr}.statsGrid{grid-template-columns:1fr 1fr}.dictionaryToolbar{grid-template-columns:1fr 1fr}.front{font-size:36px}.studyCard{padding:22px 16px}.ratingGrid{grid-template-columns:1fr 1fr}.editGrid{grid-template-columns:1fr}.full{grid-column:auto}.studyToolbar{grid-template-columns:1fr auto}.studyToolbar #leaveStudy{justify-self:end}.settingsGrid .full{grid-column:auto}}

/* v0.12.1 HTML parity refinements */
button,select,input,textarea{font-family:inherit}.topStatus .pill{font-size:11px;padding:4px 8px}.modeCard h3{font-size:16px}.primary,.secondary,.rating,.fileButton,.danger{font-weight:400}.primary.big{font-weight:700}.bottomNav button{font-size:14px}

/* Clean-repo consolidated UI rules (2026-09-22) */
#todayPanel select{appearance:none;-webkit-appearance:none;padding-right:40px;background-image:linear-gradient(45deg,transparent 50%,#111827 50%),linear-gradient(135deg,#111827 50%,transparent 50%);background-position:calc(100% - 22px) 50%,calc(100% - 18px) 50%;background-size:5px 5px,5px 5px;background-repeat:no-repeat}
.modeCard{display:flex;flex-direction:column}.modeCard .modeActionRow{margin-top:auto;min-height:38px;align-items:flex-end}.modeActionRow .helpWrap{align-self:flex-start;margin-top:0}.modeActionRow .helpDot{position:static;top:auto}.modeActionRow .modeCount{margin-left:auto;align-self:flex-end;margin-top:0;min-height:0}
.dictionaryRowActions{white-space:nowrap}.dictionaryRowActions .deleteWord{margin-left:6px}
.studyWordActions{display:flex;justify-content:center;align-items:center;gap:8px;flex-wrap:wrap;margin-top:12px}.studyWordActions .skipBtn,.studyWordActions .studyDeleteWord{margin-top:0}.studyDeleteWord{color:#a33a3a}.studyDeleteWord:hover{background:#fff1f2;color:#8b1f2d}
.deletedWordsHead{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:8px}.deletedWordsList{margin-top:10px;border:1px solid var(--line);border-radius:12px;overflow:hidden}.deletedWordRow{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 10px;border-bottom:1px solid var(--line)}.deletedWordRow:last-child{border-bottom:0}.deletedWordRow b{display:block}.deletedWordRow span{display:block;font-size:12px;color:var(--muted);margin-top:2px}
.authInlineMessage{min-height:18px;margin-top:5px;font-size:12px}.authInlineMessage.error{color:#b91c1c}.authInlineMessage.ok{color:#08755b}.settingsGrid input.authEmailInvalid{border-color:#dc2626;box-shadow:0 0 0 3px rgba(220,38,38,.10)}
/* S4 silver: bright chrome, deliberately lighter than the rejected S3 */
.modeCard.trainingSilver{border-color:#a4adb7!important;background:linear-gradient(112deg,#fff 0%,#e8ebef 15%,#cfd5db 29%,#fff 44%,#b7c0c9 58%,#f8fafc 73%,#d5dae0 87%,#fff 100%)!important;background-size:260% 100%!important;box-shadow:inset 0 0 0 1px rgba(107,114,128,.14),0 6px 18px rgba(71,85,105,.09);animation:silverShimmer 4.8s ease-in-out infinite}
.modeCard.trainingGold{border-color:#cf940f!important;background:linear-gradient(108deg,#ffe9ad 0%,#f3c75d 24%,#f6d777 46%,#fff1b4 59%,#e8b535 72%,#d49612 100%)!important;background-size:240% 100%!important;box-shadow:inset 0 0 0 1px rgba(161,116,16,.22),0 7px 20px rgba(161,116,16,.15);animation:goldShimmer 4.4s ease-in-out infinite}
@keyframes silverShimmer{0%,100%{background-position:100% 0}50%{background-position:0 0}}@keyframes goldShimmer{0%,100%{background-position:100% 0}50%{background-position:0 0}}@media(prefers-reduced-motion:reduce){.modeCard.trainingSilver,.modeCard.trainingGold{animation:none!important}}
@media(max-width:820px){.deletedWordRow{align-items:flex-start;flex-direction:column}.deletedWordRow .restoreWord{width:100%}}@media(max-width:520px){.studyWordActions{flex-direction:column;gap:2px}}

/* v0.13.1 UI correctness pass */
.modeGrid{align-items:stretch}
.modeGrid .modeCard{display:grid;grid-template-rows:auto minmax(42px,auto) 1fr auto;height:100%}
.modeGrid .modeCard>h3{grid-row:1}
.modeGrid .modeCard>p{grid-row:2}
.modeGrid .modeCard>select{grid-row:3;align-self:start}
.modeGrid .modeCard>.modeActionRow{grid-row:4;align-self:end;margin-top:12px;min-height:38px}
.studyWordActions .studyDeleteWord{margin-top:0!important;background:#fff!important;border:1px solid #fecaca!important;color:#991b1b!important}
.studyWordActions .studyDeleteWord:hover{background:#fff1f2!important;color:#7f1d1d!important}
.modeCard.trainingSilver{border-color:#8d98a5!important;background:linear-gradient(110deg,#fdfefe 0%,#d8dde3 12%,#aeb8c2 24%,#f7f9fb 37%,#c3cbd3 50%,#ffffff 63%,#aab4bf 76%,#e9edf1 89%,#ffffff 100%)!important;background-size:300% 100%!important;box-shadow:inset 0 0 0 1px rgba(71,85,105,.22),0 7px 20px rgba(71,85,105,.12)!important;animation:silverShimmer 3.8s ease-in-out infinite!important}


/* v0.13.3 requested UI fixes */
.rating.again{border:1px solid var(--red)!important}
.rating.hard{border:1px solid var(--yellow)!important}
.rating.good{border:1px solid var(--blue)!important}
.rating.easy{border:1px solid #2f7d32!important}

.studyToolbar{grid-template-columns:auto auto 1fr;align-items:center}
.studyToolbarActions{justify-self:end;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.studyToolbarActions .studyDeleteWord{margin:0!important;white-space:nowrap;background:#fff!important;border:1px solid #991b1b!important;color:#991b1b!important}
.studyToolbarActions .studyDeleteWord:hover{background:#fee2e2!important;color:#7f1d1d!important}

.modeGrid{align-items:stretch;grid-auto-rows:1fr}
.modeGrid .modeCard{position:relative!important;display:block!important;height:100%!important;min-height:174px;padding-bottom:66px!important}
.modeGrid .modeCard>.modeActionRow{position:absolute!important;left:15px;right:15px;bottom:15px;margin:0!important;min-height:36px;display:flex!important;align-items:flex-end!important}
.modeGrid .modeCard>select{margin-bottom:8px}

.modeCard.trainingSilver{position:relative!important;overflow:hidden;border:2px solid #8f99a5!important;background:linear-gradient(108deg,#ffffff 0%,#d5dbe2 12%,#9faab6 23%,#f9fbfd 34%,#c0c8d1 47%,#ffffff 59%,#a7b1bc 72%,#e5e9ed 86%,#ffffff 100%)!important;background-size:320% 100%!important;box-shadow:inset 0 0 0 1px rgba(255,255,255,.75),0 7px 20px rgba(71,85,105,.18)!important;animation:silverShimmer 3.2s ease-in-out infinite!important}
.modeCard.trainingSilver::after{content:"";position:absolute;inset:-35% -70%;pointer-events:none;background:linear-gradient(115deg,transparent 36%,rgba(255,255,255,.9) 48%,rgba(255,255,255,.25) 54%,transparent 64%);transform:translateX(-45%);animation:silverSweep 3.2s ease-in-out infinite}
.modeCard.trainingSilver>*{position:relative;z-index:1}
@keyframes silverSweep{0%,22%{transform:translateX(-45%)}58%,100%{transform:translateX(45%)}}

@media(max-width:820px){
  .studyToolbar{grid-template-columns:1fr auto}
  .studyToolbarActions{grid-column:1/-1;justify-self:stretch;display:grid;grid-template-columns:1fr 1fr}
  .studyToolbarActions button{width:100%}
  .modeGrid .modeCard{min-height:164px}
}
