:root{color:#17211f;background:#f6f1e8;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}button,select,input{font:inherit}button:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid rgba(38,102,93,.4);outline-offset:2px}.app-shell{--bg: #f6f1e8;--panel: rgba(255, 253, 248, .82);--surface: #fffdfa;--surface-muted: #eef6f2;--surface-strong: #17211f;--text: #17211f;--muted: #60716a;--soft-muted: #7d8884;--accent: #26665d;--accent-soft: #e7f0ec;--warm: #8d4a3f;--warm-soft: #f2dfcf;--border: rgba(23, 33, 31, .14);--shadow: rgba(23, 33, 31, .16);--complete: #24784f;--complete-soft: #dff0e6;display:grid;grid-template-columns:300px minmax(0,1fr);height:100vh;min-height:0;overflow:hidden;background:linear-gradient(135deg,rgba(38,102,93,.12),transparent 35%),linear-gradient(315deg,rgba(156,62,55,.14),transparent 34%),var(--bg);color:var(--text)}.app-shell[data-theme=dark]{--bg: #121816;--panel: rgba(25, 35, 32, .9);--surface: #1d2824;--surface-muted: #263a34;--surface-strong: #edf6f1;--text: #edf6f1;--muted: #a5b7b0;--soft-muted: #82958e;--accent: #76c7a8;--accent-soft: #19382f;--warm: #e5a384;--warm-soft: #452d25;--border: rgba(237, 246, 241, .16);--shadow: rgba(0, 0, 0, .38);--complete: #8de0a9;--complete-soft: #173929;background:linear-gradient(135deg,rgba(118,199,168,.1),transparent 35%),linear-gradient(315deg,rgba(229,163,132,.1),transparent 34%),var(--bg)}.unit-rail{display:flex;flex-direction:column;gap:18px;min-height:0;padding:22px;border-right:1px solid var(--border);background:var(--panel)}.brand-lockup,.rail-heading{display:flex;align-items:center;gap:10px;font-weight:800}.brand-lockup{font-size:1.35rem}.brand-lockup>span:last-child{display:grid;line-height:1.02}.brand-lockup small{color:var(--muted);font-size:.72rem;font-weight:850}.brand-mark{position:relative;display:grid;place-items:center;width:38px;height:38px;border:1px solid var(--border);border-radius:8px;background:var(--surface-strong);color:var(--surface)}.brand-mark svg{width:20px;height:20px}.brand-mark svg:last-child{position:absolute;right:-5px;top:-5px;width:15px;height:15px;color:var(--warm)}.field-label,.eyebrow{color:var(--muted);font-size:.76rem;font-weight:800;letter-spacing:0;text-transform:uppercase}select,input[type=number]{width:100%;border:1px solid var(--border);border-radius:6px;background:var(--surface);color:var(--text);padding:9px 10px}.level-list{display:flex;flex:1;flex-direction:column;gap:8px;min-height:0;overflow-y:auto;padding-right:4px}.level-section{display:grid;gap:8px}.level-toggle{--row-progress: var(--level-progress, 0%);position:relative;overflow:hidden;isolation:isolate;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;min-height:54px;border:1px solid var(--border);border-radius:8px;background:var(--bg);color:var(--text);padding:9px 10px;text-align:left;cursor:pointer}.level-toggle:before,.unit-button:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;border-radius:inherit;background:var(--progress-color, var(--complete));clip-path:inset(0 calc(100% - var(--row-progress)) 0 0);opacity:.18;pointer-events:none}.level-toggle.active{border-color:var(--accent);background:var(--accent-soft)}.level-toggle>*,.unit-button>*{position:relative;z-index:1}.level-toggle>span{display:grid;min-width:0}.level-toggle strong{color:var(--warm);font-size:.92rem}.level-toggle small,.level-toggle em,.planned-level small{overflow:hidden;color:var(--muted);font-size:.76rem;font-style:normal;text-overflow:ellipsis;white-space:nowrap}.level-body{display:grid;gap:8px;padding-left:12px}.planned-level{display:grid;gap:3px;border:1px dashed var(--border);border-radius:8px;background:color-mix(in srgb,var(--surface) 58%,transparent);padding:10px}.planned-level strong{color:var(--warm);font-size:.82rem}.unit-button{--row-progress: var(--unit-progress, 0%);position:relative;overflow:hidden;isolation:isolate;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:4px 10px;min-height:58px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text);padding:10px;text-align:left;cursor:pointer}.unit-button.active{border-color:var(--accent);background:var(--accent-soft)}.unit-button.completed{border-color:color-mix(in srgb,var(--complete) 58%,var(--border));background:color-mix(in srgb,var(--complete-soft) 74%,var(--surface))}.unit-button.completed:before{opacity:.26}.unit-button>.unit-number{grid-row:span 2;color:var(--warm);font-size:.82rem;font-weight:800}.unit-button strong,.unit-button small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.unit-button small{color:var(--muted);font-size:.78rem}.complete-pill{grid-row:span 2;display:inline-flex;align-items:center;justify-content:center;gap:5px;border:1px solid color-mix(in srgb,var(--complete) 42%,transparent);border-radius:999px;background:var(--complete-soft);color:var(--complete);padding:4px 8px;font-size:.72rem;font-weight:900;white-space:nowrap}.complete-pill svg{width:14px;height:14px}.practice-panel{position:relative;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto auto;gap:14px;min-width:0;min-height:0;overflow:auto;padding:28px}.load-state{position:absolute;top:12px;left:50%;z-index:12;transform:translate(-50%);border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--muted);padding:8px 12px;font-size:.86rem;font-weight:800;box-shadow:0 10px 28px var(--shadow)}.load-state.error{color:var(--warm)}.practice-header{display:flex;justify-content:space-between;gap:18px;align-items:start}.practice-header h1{margin:0;font-size:clamp(1.8rem,4vw,3.3rem)}.practice-header p{margin:5px 0 0}.header-actions{display:flex;flex-wrap:wrap;justify-content:end;gap:8px}.icon-button,.practice-controls button,.card-jump{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text);padding:9px 12px;cursor:pointer}.icon-button:hover,.practice-controls button:hover:not(:disabled){border-color:var(--accent);background:var(--surface-muted)}.complete-action{border-color:color-mix(in srgb,var(--complete) 36%,var(--border));color:var(--complete)}.incomplete-action{border-color:color-mix(in srgb,var(--warm) 34%,var(--border));color:var(--warm)}.card-jump{min-width:150px;background:var(--surface-strong);color:var(--surface);font-weight:800;padding:8px 12px}.card-jump select{width:62px;border:0;border-radius:5px;background:color-mix(in srgb,var(--surface) 14%,transparent);color:var(--surface);padding:4px 6px;text-align:center;font-weight:850}.card-jump select option{color:var(--text)}.unit-progress{overflow:hidden;width:100%;height:8px;border:1px solid var(--border);border-radius:999px;background:color-mix(in srgb,var(--surface) 66%,transparent)}.unit-progress span{display:block;height:100%;border-radius:inherit;background:var(--progress-color, var(--complete));transition:width .14s ease}.settings-panel{position:absolute;top:92px;right:28px;z-index:10;display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:10px;width:min(720px,calc(100% - 56px));border:1px solid var(--border);border-radius:8px;background:color-mix(in srgb,var(--surface) 96%,transparent);box-shadow:0 18px 48px var(--shadow);padding:12px}.settings-panel label{display:grid;align-content:center;gap:6px;min-height:48px;color:var(--text);font-size:.92rem;font-weight:750}.settings-panel label:has(input[type=checkbox]){grid-template-columns:auto 1fr;align-items:center}.settings-panel input[type=checkbox]{width:18px;height:18px;accent-color:var(--accent)}.mode-strip{grid-column:1 / -1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.mode-strip button{min-height:40px;border:1px solid var(--border);border-radius:8px;background:var(--surface-muted);color:var(--text);font-weight:800;cursor:pointer}.mode-strip button:hover{border-color:var(--accent);background:var(--accent-soft)}.card-stage{display:grid;grid-template-rows:minmax(172px,auto) minmax(132px,auto) minmax(76px,auto) minmax(64px,auto);align-content:center;justify-items:center;gap:14px;min-height:0}.stage-slot{position:relative;display:grid;place-items:center;width:100%}.media-slot,.front-slot,.back-slot,.note-slot{transition:opacity .12s ease}.media-slot,.front-slot,.note-slot{animation:card-arrive .22s ease-out both}.front-slot{transform-origin:center bottom}.back-slot.is-revealed{overflow:hidden;border-radius:8px;animation:answer-settle .3s ease-out both}.back-slot.is-revealed:before{content:"";position:absolute;inset:8px max(8%,24px);border-radius:999px;background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--warm) 34%,transparent),transparent);filter:blur(10px);opacity:0;pointer-events:none;animation:ink-flourish .52s ease-out both}.back-slot.is-revealed>*{position:relative;z-index:1;animation:answer-text-in .36s ease-out both}.stage-slot.is-hidden{opacity:.38}.stage-slot.is-hidden .image-prompt{display:none}.hidden-slot-note{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:150px;color:var(--soft-muted);font-weight:750}.image-prompt{display:grid;place-items:center;width:min(100%,760px);min-height:150px;border:1px solid var(--border);border-radius:8px;background:color-mix(in srgb,var(--surface) 70%,transparent);color:var(--muted);padding:12px;text-align:center}.image-prompt img{max-width:100%;max-height:min(38vh,360px);border-radius:8px;object-fit:contain}.japanese-line{min-height:132px;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:.08em;max-width:980px;font-size:clamp(2.7rem,7vw,6.2rem);font-weight:850;line-height:1.08;text-align:center}.japanese-line.reading-mode{font-size:clamp(2rem,5vw,4.2rem)}.muted-line{color:var(--soft-muted);font-size:2rem}.prompt-placeholder{min-height:132px;display:grid;place-items:center;color:var(--muted);font-size:clamp(1.4rem,3vw,2.2rem);font-weight:850;text-align:center}.token{position:relative;border:0;border-radius:6px;background:transparent;color:inherit;font:inherit;line-height:inherit;padding:0 .03em;cursor:pointer}.token.lexical:hover{background:color-mix(in srgb,var(--accent-soft) 84%,var(--surface))}.token.grammar:hover{background:var(--warm-soft)}.token-tip{position:absolute;left:50%;bottom:calc(100% + 8px);z-index:5;display:none;width:max-content;max-width:240px;transform:translate(-50%);border-radius:8px;background:var(--surface-strong);color:var(--surface);padding:8px 10px;font-size:.9rem;line-height:1.25;text-align:center}.token-tip small{display:block;margin-top:2px}.token:hover .token-tip{display:block}.practice-controls button:disabled{color:var(--soft-muted);cursor:not-allowed}.english-front,.english-meaning{max-width:820px;margin:0;color:var(--warm);font-size:clamp(1.5rem,3vw,2.4rem);font-weight:850;line-height:1.15;text-align:center}.english-meaning{font-size:1.35rem}.fact-note{max-width:760px;margin:0;color:var(--muted);text-align:center}.practice-controls{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.keycap{display:inline-flex;align-items:center;justify-content:center;min-width:24px;min-height:22px;border:1px solid var(--border);border-radius:5px;background:color-mix(in srgb,var(--surface-strong) 10%,transparent);color:var(--muted);padding:1px 5px;font-size:.68rem;font-weight:900;line-height:1;white-space:nowrap}.status-row{display:flex;justify-content:space-between;gap:16px;color:var(--muted);font-size:.9rem}@keyframes card-arrive{0%{opacity:0;transform:translateY(8px) scale(.992)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes answer-settle{0%{transform:translateY(6px)}to{transform:translateY(0)}}@keyframes answer-text-in{0%{opacity:0;transform:translateY(10px);filter:blur(5px)}62%{opacity:1;filter:blur(0)}to{opacity:1;transform:translateY(0);filter:blur(0)}}@keyframes ink-flourish{0%{opacity:0;transform:translate(-34%) scaleX(.3)}36%{opacity:.75}to{opacity:0;transform:translate(34%) scaleX(1.08)}}@media (prefers-reduced-motion: reduce){.media-slot,.front-slot,.note-slot,.back-slot.is-revealed,.back-slot.is-revealed>*,.back-slot.is-revealed:before{animation:none}.unit-progress span{transition:none}}@media (max-width: 820px){.app-shell{grid-template-columns:1fr;height:auto;min-height:100vh;overflow:visible}.unit-rail{max-height:46vh;border-right:0;border-bottom:1px solid var(--border)}.level-list{grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}.practice-panel{padding:20px}.practice-header{align-items:stretch;flex-direction:column}.header-actions{justify-content:start}.settings-panel{position:static;width:100%;grid-template-columns:1fr 1fr;box-shadow:none}.practice-controls{grid-template-columns:repeat(2,minmax(0,1fr))}.practice-controls button span,.icon-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-row{flex-direction:column}}@media (max-width: 520px){.settings-panel{grid-template-columns:1fr}.mode-strip{grid-template-columns:1fr 1fr}.practice-controls{grid-template-columns:1fr}}
