
:root{--navy:#14243a;--blue:#4263eb;--pale:#f3f6fc;--ink:#172338;--muted:#718096;--green:#16845b;--red:#c34242}
*{box-sizing:border-box}body{margin:0;background:var(--pale);font-family:system-ui,-apple-system,"Noto Sans JP",sans-serif;color:var(--ink)}
header{background:var(--navy);color:white;padding:22px max(20px,calc((100% - 760px)/2)) 26px}
.brand{font-size:12px;letter-spacing:.14em;opacity:.75;font-weight:700}.headline{font-size:25px;font-weight:800;margin:7px 0 3px}.sub{font-size:13px;opacity:.75}
main{max-width:760px;margin:0 auto;padding:20px 16px 50px}.panel{background:white;border-radius:18px;padding:20px;box-shadow:0 5px 22px #1c31500d;margin-bottom:15px}
.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.between{justify-content:space-between}
label{font-size:13px;color:var(--muted);font-weight:700;display:block;margin-bottom:7px}
select,button,input{font:inherit}select,input{border:1px solid #dbe2ee;border-radius:10px;padding:11px;background:white;color:var(--ink);width:100%}
.field{flex:1;min-width:145px}.primary{background:var(--blue);color:white;border:0;border-radius:12px;padding:14px 18px;font-weight:800;cursor:pointer}.secondary{background:#edf1ff;color:#3454d1;border:0;border-radius:10px;padding:10px 13px;font-weight:700;cursor:pointer}.quiet{background:#f1f3f7;color:#46536a;border:0;border-radius:10px;padding:10px 13px;cursor:pointer}
.full{width:100%}.muted{color:var(--muted);font-size:13px}.big{font-size:30px;font-weight:850;letter-spacing:.02em}.prompt{font-size:13px;color:var(--muted);font-weight:700;margin-bottom:12px}
.progress{height:7px;background:#e9edf5;border-radius:20px;overflow:hidden;margin:12px 0}.bar{height:100%;background:var(--blue);width:0;transition:width .2s}
.choice{width:100%;text-align:left;padding:15px;border:1px solid #e0e6f0;border-radius:12px;background:white;margin:6px 0;cursor:pointer;font-weight:650;color:var(--ink)}
.choice:disabled{cursor:default}.choice.correct{border-color:#16845b;background:#eaf8f1}.choice.wrong{border-color:#c34242;background:#fff0f0}
.feedback{padding:12px;border-radius:10px;margin:12px 0;font-size:14px}.ok{background:#eaf8f1;color:#126b49}.ng{background:#fff0f0;color:#a52f2f}
.stat{background:#f5f7fb;border-radius:12px;padding:12px;flex:1;text-align:center}.stat strong{font-size:22px;display:block}
.hidden{display:none!important}.hint{font-size:15px;color:#53647c;letter-spacing:.16em;margin-top:8px}.footer{font-size:11px;color:#8792a4;text-align:center;margin-top:22px}

.tabs{display:flex;gap:8px;margin-bottom:16px}.tab{flex:1;border:0;border-radius:12px;padding:13px;background:#e5eaf5;color:#42516a;font-weight:800;cursor:pointer}.tab.active{background:var(--navy);color:white}
.meter{height:9px;border-radius:9px;background:#e7ebf4;overflow:hidden}.meter>div{height:100%;background:var(--blue)}
.setrow{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;padding:12px 0;border-bottom:1px solid #edf0f5;font-size:13px;align-items:center}.setrow button{border:0;background:transparent;text-align:left;color:#3454d1;font-weight:800;cursor:pointer;padding:0}.reviewcard{border:1px solid #e0e6f0;border-radius:13px;padding:15px;margin:9px 0;cursor:pointer;background:white;text-align:left;width:100%}.reviewcard strong{display:block;margin-bottom:4px}.reviewcard span{font-size:12px;color:var(--muted)}

.tab{font-size:13px;padding:12px 7px}.tabs{flex-wrap:wrap}.tabs .tab{flex:1 1 90px}
.lesson-card{border:1px solid #e1e7f0;border-radius:13px;padding:15px;margin:10px 0;background:#fff}.lesson-card h3{margin:0 0 7px}.lesson-card p{line-height:1.8;margin:7px 0}.pill{display:inline-block;border-radius:8px;background:#edf1ff;color:#304fc4;padding:4px 8px;font-size:12px;font-weight:750;margin:3px}.example{padding:12px;background:#f4f7fc;border-radius:10px;line-height:1.9;margin:10px 0}.note{border-left:3px solid #4263eb;padding:9px 12px;background:#f4f7fc;line-height:1.8}.topicbtn{border:1px solid #e0e6f0;border-radius:12px;background:white;padding:13px;text-align:left;width:100%;cursor:pointer;margin:5px 0}.topicbtn.active{background:#edf1ff;border-color:#4263eb}.reading-line{padding:10px 0;border-bottom:1px solid #e7ebf2;line-height:1.85}.translation{color:#3454d1;background:#f0f4ff;padding:9px 11px;border-radius:8px;margin-top:7px}.smallbtn{padding:5px 9px;border:1px solid #d5dded;background:white;color:#3454d1;border-radius:8px;cursor:pointer;font-size:12px}.structure{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}.chunk{background:#eef3fa;padding:9px;border-radius:8px;font-size:13px}.chunk b{display:block;color:#3454d1}.lesson-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px}.lesson-grid .topicbtn{height:100%}.progresslabel{font-size:12px;color:#718096}.question-context{white-space:pre-wrap;background:#f6f8fc;border-radius:12px;padding:15px;line-height:1.9}.actionrow{display:flex;gap:8px;flex-wrap:wrap}.actionrow button{flex:1}.tab:focus-visible,.choice:focus-visible,button:focus-visible{outline:3px solid #f2b544;outline-offset:2px}
.guide-step{padding:13px 15px;margin:10px 0;border-left:4px solid #4361ee;background:#f5f7ff;border-radius:9px}.guide-step p{margin:7px 0 0;line-height:1.8}.guide-table{width:100%;border-collapse:collapse;font-size:.92rem}.guide-table td{border:1px solid #dfe5f0;padding:11px;vertical-align:top}.guide-table tr:nth-child(odd){background:#f6f8fc}.lesson-check{margin-top:16px;padding:14px;border:1px solid #dfe5f0;border-radius:10px}.lesson-check summary{cursor:pointer;font-weight:700}
.compact-header{padding:10px max(16px,calc((100% - 760px)/2));display:flex;align-items:center;gap:10px;min-height:52px;font-size:14px;letter-spacing:.025em}
.home-icon{border:1px solid #5c708d;background:#263d5c;color:white;border-radius:9px;font-size:24px;line-height:1;width:34px;height:34px;cursor:pointer}
.version{margin-left:auto;font-size:11px;opacity:.7}main{padding-top:12px}.home-panel{padding:12px}.home-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.home-card{display:flex;flex-direction:column;align-items:flex-start;text-align:left;gap:7px;border:1px solid #dfe5f0;background:white;border-radius:14px;padding:16px;min-height:116px;cursor:pointer;color:var(--ink);transition:background .15s,border-color .15s}.home-card:hover{background:#f5f8ff;border-color:#8ba3e9}.home-card b{font-size:15px}.home-card small{font-size:12px;color:var(--muted)}.card-icon{font-size:25px;color:#4564d7;line-height:1}.home-footnote{text-align:center;font-size:11px;color:var(--muted);margin:14px 0 3px}.panel:not(.home-panel){scroll-margin-top:65px}
@media(max-width:550px){.home-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.home-card{min-height:100px;padding:12px;gap:5px}.home-card b{font-size:14px}.home-card small{font-size:11px}.card-icon{font-size:21px}main{padding:10px 10px 30px}.panel{padding:14px}.home-panel{padding:9px}}

.ref-header{margin-left:auto;background:#fff;color:#253b61;border:1px solid #bfc9da;border-radius:22px;padding:7px 12px;font-weight:700;cursor:pointer}.version{margin-left:6px!important}
.home-status{background:#f4f6fa;border-radius:13px;padding:13px;margin-bottom:12px}.status-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.status-head strong{color:#263c65}.status-head span{font-size:13px;color:#64748b}.status-meters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.status-meters span{display:flex;justify-content:space-between;font-size:12px;color:#52617b}.tiny-meter{height:5px;background:#e0e6ef;border-radius:10px;overflow:hidden;margin-top:7px}.tiny-meter i{display:block;height:100%;width:0;background:#647895;border-radius:10px}
.learning-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.learning-grid .home-card{min-height:96px;padding:13px;position:relative}.learning-grid .home-card.recommended{border:2px solid #9575e6;background:#fcfaff}.recommend-mark{font-size:11px;font-weight:800;color:#7944c8}.recommend-mark[hidden]{display:none}.progress-link{width:100%;display:flex;align-items:center;justify-content:space-between;border:0;background:#f4f6fa;border-radius:12px;padding:13px 16px;font-size:14px;font-weight:700;color:#273a55;cursor:pointer;margin-top:11px}
#library:not(.hidden){display:flex!important;position:fixed;inset:0;z-index:999;background:rgba(16,24,40,.5);align-items:center;justify-content:center;padding:12px;overflow:hidden;border:0;box-shadow:none;margin:0;max-width:none}
.reference-shell{height:80dvh;max-height:80vh;width:min(760px,100%);display:flex;flex-direction:column;background:white;border-radius:18px;overflow:hidden;box-shadow:0 18px 70px #14243a55}.reference-top{flex-shrink:0;padding:13px 16px;border-bottom:1px solid #e4e8ef;display:flex;align-items:center;justify-content:space-between;gap:12px}.reference-top strong{font-size:14px}.reference-close{border:1px solid #d5dce8;border-radius:9px;background:white;padding:8px 11px;cursor:pointer}.reference-scroll{overflow-y:auto;padding:16px;overscroll-behavior:contain}.reference-scroll>h2{margin:4px 0 10px}.reference-scroll>.prompt{display:none}
@media(max-width:550px){.compact-header{gap:7px}.compact-header strong{font-size:13px}.ref-header{padding:7px 9px;font-size:12px}.version{display:none}.home-status{padding:10px}.learning-grid .home-card{min-height:91px;padding:12px}.reference-shell{width:100%;border-radius:17px 17px 0 0;height:80dvh;max-height:80dvh}#library:not(.hidden){align-items:flex-end;padding:0}.reference-scroll{padding:12px}}
.audio-quick-settings{display:flex;align-items:center;justify-content:flex-end;gap:12px;flex-wrap:wrap;margin-left:auto}.audio-icon-group{display:flex;gap:4px}.audio-icon-option{width:38px;height:38px;min-width:38px;min-height:38px;display:inline-flex;align-items:center;justify-content:center;padding:0!important;border:1px solid #cbd5e1;border-radius:9px;background:#fff;font-size:21px;line-height:1;cursor:pointer;transition:background .15s,border-color .15s}.audio-icon-option:hover{background:#edf3ff}.audio-icon-option.is-selected{border:2px solid #285cbd;background:#eaf1ff}.audio-icon-option:focus-visible{outline:3px solid #76a8f5;outline-offset:2px}@media(max-width:430px){.audio-quick-settings{width:100%;justify-content:space-between;gap:8px}.audio-icon-option{width:40px;height:40px;min-width:40px;min-height:40px}}

/* Dev 7.5: structured answer explanations */
.vhn-answer-body .v75-section{border:1px solid #dce6ef;border-radius:13px;padding:15px;margin:12px 0;background:#fff}
.vhn-answer-body .v75-context{background:#f4f8fb;border-color:#dce6ef}
.vhn-answer-body .v75-kicker{font-size:.75rem;font-weight:800;letter-spacing:.08em;color:#63748a;margin-bottom:7px}
.vhn-answer-body .v75-word{font-size:1.45rem;font-weight:800;color:#17243b;overflow-wrap:anywhere}
.vhn-answer-body .v75-meaning{font-weight:700;color:#276d59;margin-top:4px}
.vhn-answer-body .v75-sentence{font-size:1.04rem;line-height:1.8;overflow-wrap:anywhere}
.vhn-answer-body .v75-sentence mark{background:#ffedab;color:#1a2b3c;padding:1px 3px;border-radius:4px;font-weight:800}
.vhn-answer-body .v75-ja{border-top:1px solid #dce6ef;padding-top:10px;margin-top:10px;color:#344a61;line-height:1.75}
.vhn-answer-body .v75-choice{display:flex;align-items:flex-start;gap:9px;margin:7px 0;padding:9px 10px;border-radius:9px;background:#f5f7fa;overflow-wrap:anywhere}
.vhn-answer-body .v75-choice.is-right{background:#eaf7ef;border:1px solid #b9dfc9}
.vhn-answer-body .v75-choice.is-wrong{background:#fff1ef;border:1px solid #efc7c3}
.vhn-answer-body .v75-bullet{font-size:.92rem;color:#43536a;line-height:1.75}
.vhn-answer-body .v75-explain-title{font-weight:800;color:#1b394a;margin:0 0 7px}
.vhn-answer-body .v75-section button{max-width:100%}

/* Dev 7.6: accessible result animations; rich explanation markup remains untouched. */
.vhn-answer-overlay{isolation:isolate;transition:background-color .2s ease}
.vhn-answer-overlay.vhn-result-wrong{background:rgba(126,20,32,.37)}
.vhn-answer-overlay.vhn-result-correct{background:rgba(10,34,33,.56)}
.vhn-answer-overlay.vhn-result-wrong::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:rgba(214,35,51,.18);animation:vhnErrorFlash .45s ease-out both}
.vhn-answer-card{position:relative;z-index:2}
.vhn-result-correct .vhn-answer-head{background:#edf8ef;color:#206443}
.vhn-result-wrong .vhn-answer-head{background:#fff0f0;color:#a53640}
.vhn-answer-head #vhnAnswerIcon{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:50%;font-size:24px;background:rgba(255,255,255,.8)}
.vhn-confetti{position:absolute;inset:0;z-index:3;pointer-events:none;overflow:hidden}
.vhn-confetti-piece{position:absolute;top:-14%;left:var(--x);width:var(--w);height:var(--h);border-radius:55% 10% 55% 10%;background:var(--c);opacity:0;transform:translate3d(0,0,0) rotate(var(--rot));animation:vhnPetalFall var(--dur) ease-in var(--delay) both}
@keyframes vhnPetalFall{0%{opacity:0;transform:translate3d(0,-15px,0) rotate(0deg)}12%{opacity:.95}82%{opacity:.9}100%{opacity:0;transform:translate3d(var(--drift),110dvh,0) rotate(var(--rot))}}
@keyframes vhnErrorFlash{0%{opacity:.85}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){.vhn-confetti-piece,.vhn-answer-overlay.vhn-result-wrong::before{animation:none!important}.vhn-confetti{display:none!important}}
/* Dev 8.2: reference above answer feedback, audio above both. */
#library:not(.hidden){z-index:25000!important;isolation:isolate}
#vhnAnswerOverlay:not([hidden]){z-index:20000}
#audioDialog:not(.hidden){z-index:30000}
