 :root{color-scheme:light;--bg:#f5f6f2;--card:#fff;--tx:#182e26;--sub:#62746b;--line:#dfe7df;--ac:#12684e;--soft:#e6f1e9;--ok:#167548;--bad:#bd3a31;--badbg:#fff0ed;--shadow:0 4px 20px #203c2407}
[data-theme=dark]{color-scheme:dark;--bg:#101a16;--card:#19271f;--tx:#edf4ef;--sub:#a4b6aa;--line:#35443b;--ac:#80d6ac;--soft:#233f30;--ok:#80d6ac;--bad:#ff9d91;--badbg:#452b29;--shadow:none}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}body{margin:0;background:var(--bg);color:var(--tx);font:16px/1.65 -apple-system,BlinkMacSystemFont,"Hiragino Sans","Noto Sans Myanmar","Myanmar Sangam MN",sans-serif}button,input,select,textarea{font:inherit}button,a,input,select,summary{touch-action:manipulation}button{cursor:pointer;color:inherit}button:disabled{cursor:default;opacity:.45}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #d19c3d;outline-offset:3px}a{color:var(--ac)}h1,h2,h3,p{margin:0}h1{font-size:28px;line-height:1.35;letter-spacing:-.6px}h2{font-size:19px;line-height:1.4}h3{font-size:16px}.muted,small{color:var(--sub)}small{font-size:12px}.wrap{max-width:720px;margin:auto;padding:calc(env(safe-area-inset-top) + 24px) 20px calc(env(safe-area-inset-bottom) + 105px)}.brand{display:flex;align-items:center;gap:10px;margin-bottom:26px;font-size:14px;font-weight:700}.brand img{width:36px;height:36px;border-radius:10px}.brand span:last-child{margin-left:auto;font-size:11px;font-weight:500;color:var(--sub)}.eyebrow{font-size:11px;letter-spacing:1.8px;font-weight:700;color:var(--ac);margin-bottom:8px}.intro{margin-bottom:22px}.intro p{margin-top:8px;color:var(--sub);font-size:14px}.hero{background:#12684e;color:#fff;border-radius:22px;padding:24px;margin-bottom:22px;box-shadow:var(--shadow)}.hero p,.hero small{color:#d9eae1}.hero h2{font-size:23px;margin:8px 0}.hero .btn{background:#fff;color:#12684e;margin-top:18px}.row{display:flex;gap:12px;align-items:center;justify-content:space-between}.row>*{min-width:0}.stack{display:grid;gap:12px}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:22px}.card{background:var(--card);border:1px solid var(--line);border-radius:18px;padding:18px;box-shadow:var(--shadow)}button.card{width:100%;text-align:left}.card h3{margin-top:10px}.card p{font-size:13px;color:var(--sub);margin-top:4px}.icon{display:inline-flex;width:36px;height:36px;align-items:center;justify-content:center;background:var(--soft);border-radius:11px;color:var(--ac);font-size:19px;font-weight:600}.section-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:24px 0 12px}.section-title small{white-space:nowrap}.btn{display:block;width:100%;padding:13px 18px;background:var(--ac);color:var(--bg);border:1px solid transparent;border-radius:12px;font-weight:650;text-align:center;text-decoration:none}.btn.secondary{background:var(--card);color:var(--ac);border-color:var(--line)}.btn.danger{color:var(--bad);background:var(--badbg)}.text-btn{padding:8px 0;border:0;background:none;color:var(--ac);text-align:left}.pill{display:inline-block;border-radius:99px;padding:3px 10px;background:var(--soft);color:var(--ac);font-size:11px;font-weight:650}.bar{height:6px;background:var(--line);border-radius:5px;overflow:hidden;margin-top:12px}.bar i{display:block;height:100%;background:var(--ac);border-radius:5px}.topic{display:block;width:100%;text-align:left;padding:17px 18px;margin-bottom:10px;border:1px solid var(--line);border-radius:16px;background:var(--card)}.topic b{font-size:16px}.topic small{display:block;margin-top:3px}.top{display:flex;align-items:center;gap:12px;margin-bottom:20px}.top h1{font-size:22px}.back{border:1px solid var(--line);background:var(--card);border-radius:12px;font-size:24px;line-height:1;padding:9px 14px}.nav{position:fixed;z-index:5;bottom:0;left:0;right:0;background:var(--card);border-top:1px solid var(--line);padding:8px 10px calc(env(safe-area-inset-bottom) + 8px);display:flex;justify-content:center;gap:4px}.nav button{width:132px;max-width:20%;min-height:52px;background:none;border:0;border-radius:12px;font-size:11px;color:var(--sub)}.nav button span{display:block;font-size:20px;line-height:1.4}.nav button.active{color:var(--ac);background:var(--soft);font-weight:700}.input{width:100%;border:1px solid var(--line);border-radius:12px;padding:12px;background:var(--card);color:var(--tx)}label{display:block;font-size:13px;font-weight:600;margin-bottom:6px}.filters{display:flex;gap:7px;overflow:auto;padding:4px 0 12px;margin-top:12px}.chip{white-space:nowrap;border:1px solid var(--line);background:var(--card);border-radius:99px;padding:7px 12px;font-size:12px}.chip.active{background:var(--ac);color:var(--bg)}.lesson{display:flex;gap:14px;align-items:center}.lesson .icon{flex-shrink:0;width:44px;height:54px}.lesson .meta{flex:1}.lesson b{font-size:15px}.lesson small{font-size:11px}.empty{text-align:center;padding:36px 20px;color:var(--sub)}.q{font-size:19px;white-space:pre-wrap;line-height:1.85;margin:22px 0}.option{display:flex;align-items:flex-start;gap:12px;width:100%;padding:15px;text-align:left;background:var(--card);border:1.5px solid var(--line);border-radius:14px;margin-bottom:10px;line-height:1.65}.option .number{flex-shrink:0;color:var(--sub)}.option.selected{border-color:var(--ac);background:var(--soft)}.option.correct{border-color:var(--ok);background:var(--soft)}.option.wrong{border-color:var(--bad);background:var(--badbg)}.option:disabled{opacity:1}.explanation{white-space:pre-wrap;line-height:1.8}.explanation .answer{font-size:17px;font-weight:700;margin-bottom:8px;color:var(--ok)}.explanation .answer.wrong{color:var(--bad)}.source{font-size:12px;color:var(--sub);margin-top:14px}.actions{display:flex;gap:10px;margin-top:20px}.actions>*{flex:1}.quiz-top{display:flex;align-items:center;gap:10px}.quiz-top .pill{margin-left:auto}.star{background:none;border:0;font-size:26px;color:var(--ac);padding:4px 10px}.timer{font-variant-numeric:tabular-nums;color:var(--ac);font-weight:700}.jump-grid{display:grid;grid-template-columns:repeat(10,1fr);gap:5px;margin:14px 0}.jump-grid button{min-height:35px;padding:2px;border:1px solid var(--line);border-radius:7px;background:var(--card);font-size:12px}.jump-grid button.answered{background:var(--soft)}.jump-grid button.current{border:2px solid var(--ac)}.score{text-align:center;margin:25px 0}.score strong{font-size:60px;line-height:1.2}.score p{color:var(--sub)}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:20px 0}.stats .card{padding:16px 8px;text-align:center}.stats strong{display:block;font-size:24px;line-height:1.4}.stats small{font-size:11px}.flash{min-height:260px;display:flex;flex-direction:column;justify-content:center;font-size:20px;white-space:pre-wrap;width:100%;text-align:left}.flash small{display:block;margin-bottom:14px}.flash .explanation{font-size:16px}.note{font-size:12px;color:var(--sub);margin:18px 0;line-height:1.8}.table-wrap{overflow:auto;margin-bottom:18px}.table-wrap h2{margin-bottom:12px}table{border-collapse:collapse;font-size:13px;min-width:440px;width:100%}th,td{border:1px solid var(--line);padding:10px;text-align:left;vertical-align:top}th{background:var(--soft)}video{display:block;width:100%;max-height:60vh;border-radius:16px;background:#000;margin:16px 0}progress{width:100%;height:6px;accent-color:var(--ac)}details summary{cursor:pointer;font-weight:600;padding:10px 0}#toast{position:fixed;bottom:100px;left:50%;transform:translateX(-50%);max-width:90%;padding:12px 18px;border-radius:12px;background:var(--tx);color:var(--bg);z-index:20;font-size:13px;display:none}#toast.show{display:block}.loading{padding:30px}.spaced{margin-top:18px}.fallback{font-size:11px;color:var(--sub);margin-bottom:8px}.screen-title{outline:none}.history-item{border-bottom:1px solid var(--line);padding:12px 0}.history-item:last-child{border:0}.result-review{margin-top:22px}.footnote{margin-top:24px;border-top:1px solid var(--line);padding-top:15px;color:var(--sub);font-size:11px}.backup{height:160px;font:12px/1.5 monospace;resize:vertical}.status-banner{padding:10px;background:var(--badbg);color:var(--bad);font-size:12px;border-radius:10px;margin-bottom:16px}
@media(min-width:760px){.wrap{padding-top:36px}.intro h1{font-size:34px}.hero{padding:28px}.grid{gap:16px}}@media(max-width:370px){.wrap{padding-left:14px;padding-right:14px}h1{font-size:25px}.jump-grid{grid-template-columns:repeat(5,1fr)}.stats strong{font-size:21px}.nav button{font-size:10px}}
/* Japanese-first study interface: clear hierarchy, compact cards, consistent line icons. */
:root{--bg:#f5f7fa;--card:#fff;--tx:#223046;--sub:#69788c;--line:#e1e6ee;--ac:#294c7d;--soft:#eef3fa;--ok:#257651;--bad:#b94644;--badbg:#fff1ef;--shadow:none}
[data-theme=dark]{color-scheme:dark;--bg:#101923;--card:#182433;--tx:#e7edf5;--sub:#a1afc0;--line:#304156;--ac:#b1caeb;--soft:#23384f;--ok:#83cba5;--bad:#f2a39c;--badbg:#402b2c}
body{font-size:15px;letter-spacing:.015em}h1{font-size:25px;letter-spacing:.02em;line-height:1.5}h2{font-size:18px}h3{font-size:15px}.wrap{max-width:680px;padding-top:calc(env(safe-area-inset-top) + 20px)}.brand{margin-bottom:26px;gap:9px;font-size:15px}.brand img{width:32px;height:32px;border-radius:8px}.brand span:last-child{font-size:10px}.connection-dot:before{content:'';display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--ok);margin-right:5px}.intro{margin-bottom:18px}.intro p{font-size:13px;margin-top:5px}.eyebrow{letter-spacing:.06em;font-size:11px;color:var(--sub);font-weight:500}.study-summary{display:grid;grid-template-columns:1.15fr 1fr 1fr;border:1px solid var(--line);border-radius:12px;padding:15px 0;background:var(--card);margin-bottom:20px}.study-summary>div{padding:0 12px;border-right:1px solid var(--line)}.study-summary>div:last-child{border-right:0}.study-summary strong{display:block;font-size:22px;font-weight:650;line-height:1.5;font-variant-numeric:tabular-nums}.study-summary strong small{font-size:11px;font-weight:400}.study-summary span{font-size:10px;color:var(--sub);display:block;line-height:1.5}.hero{background:var(--card);color:var(--tx);border:1px solid var(--line);border-left:4px solid var(--ac);border-radius:12px;padding:18px 20px;margin-bottom:24px}.hero small{color:var(--ac);font-size:11px;font-weight:650}.hero h2{font-size:22px;margin:6px 0}.hero p{color:var(--sub);font-size:13px}.hero .btn{background:var(--ac);color:var(--bg);margin-top:16px}.hero-icon{color:var(--ac);display:flex}.section-title{margin:24px 0 12px}.section-title h2{font-size:16px}.card,.topic{border-radius:12px;box-shadow:none}.grid{gap:10px;margin-bottom:24px}.grid .card{padding:16px}.grid .card h3{margin-top:10px;font-weight:650}.grid .card p{font-size:11px;line-height:1.7}.icon{background:transparent;border-radius:0;width:25px;height:25px;color:var(--ac)}.topic{padding:16px;margin-bottom:8px}.topic b{font-size:15px}.topic small{font-size:11px}.pill{border-radius:5px;font-size:10px;padding:2px 7px;font-weight:600}.bar{height:4px;margin-top:11px}.btn{font-size:14px;border-radius:8px;padding:12px 14px;min-height:46px}.back{border:0;background:transparent;padding:8px 5px;margin-right:4px;font-size:25px}.top h1{font-size:21px}.nav{padding-top:7px}.nav button{border-radius:8px;font-size:10px;min-height:51px}.nav button span{display:flex;justify-content:center;margin-bottom:3px}.nav button.active{background:transparent}.nav button.active:after{content:'';display:block;background:var(--ac);width:18px;height:2px;margin:4px auto 0;border-radius:2px}.nav svg{width:21px;height:21px}.lesson .icon{background:var(--soft);border-radius:8px;font-size:19px}.chip{border-radius:7px;font-size:11px}.q{font-size:18px;line-height:1.9}.option{font-size:15px;border-radius:10px}.input{border-radius:8px}.brand svg{vertical-align:middle}.network-screen{position:fixed;inset:0;z-index:100;background:var(--bg);display:flex;align-items:center;justify-content:center;padding:calc(env(safe-area-inset-top) + 24px) 24px calc(env(safe-area-inset-bottom) + 24px)}.network-screen[hidden]{display:none}.network-card{max-width:420px;width:100%;text-align:center}.network-card img{width:56px;height:56px;border-radius:12px;margin-bottom:22px}.network-card h1{font-size:22px;margin-bottom:14px}.network-card p{font-size:14px;color:var(--sub);margin-bottom:22px}.network-card small{display:block;margin-top:18px;color:var(--sub)}.network-card .spinner{display:block;width:24px;height:24px;border:2px solid var(--line);border-top-color:var(--ac);border-radius:50%;animation:spin 1s linear infinite;margin:20px auto}@keyframes spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.network-card .spinner{animation:none}}
@media(min-width:760px){.intro h1{font-size:28px}.hero{padding:20px 24px}}@media(max-width:360px){.study-summary>div{padding:0 8px}.study-summary strong{font-size:20px}.brand{font-size:13px}.grid .card{padding:14px}}
.network-screen[hidden]{display:none}
