:root{--ink:#253e36;--muted:#707a70;--paper:#f6f4ec;--green:#285747;--line:#dedfd3;--accent:#c35b3d}
*{box-sizing:border-box}
body{margin:0;background:var(--paper);color:var(--ink);font-family:Segoe UI,Arial,sans-serif;font-size:14px}
button,input,select{font:inherit}
button,select,summary{cursor:pointer}
button{border:0;border-radius:7px;padding:9px 14px;font-weight:600;font-size:13px;min-height:36px}
button:disabled{opacity:.5;cursor:default}
header{height:48px;padding:6px 18px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line)}
.brand{display:flex;gap:8px;align-items:center;color:var(--ink);text-decoration:none;font-size:17px;font-weight:650}
.seal{background:var(--accent);color:white;border-radius:6px;padding:1px 6px;font:23px serif}
.local{font-size:11px;color:var(--muted)}
main{max-width:1600px;margin:auto;padding:14px 18px}
.layout{display:grid;grid-template-columns:280px minmax(0,1fr);gap:16px;align-items:start}
aside,.practice,#manager{border:1px solid var(--line);border-radius:12px;min-width:0}
aside{padding:14px;background:#eeeee3;position:sticky;top:14px}
.settings-grid{display:grid;gap:10px}
.field{min-width:0}
label{display:block;font-size:12px;font-weight:600;margin:0 0 5px}
select,input{width:100%;min-width:0;min-height:36px;border:1px solid #d0d5c8;background:#fffef8;color:var(--ink);border-radius:7px;padding:7px 9px;font-size:13px}
.primary{background:var(--green);color:white}
.primary span{float:right}
.secondary{background:#e9ecdf;color:var(--ink);border:1px solid #d5dccb}
.subtle{background:transparent;color:var(--muted)}
aside>#start,aside>#manage{width:100%;margin-top:8px}
.selection-total{font-size:13px;font-weight:650;padding:9px 10px;border:1px solid #cdd6c5;background:#e3e9da;border-radius:7px;margin:12px 0 0}
aside .selection-total+#start{margin-top:8px}
.progress-details{margin-top:12px;border-top:1px solid var(--line);padding-top:10px}
.progress-details summary{font-size:12px;font-weight:600}
.hint{font-size:12px;line-height:1.5;color:var(--muted);overflow-wrap:anywhere}
.stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.stats strong{display:block;font-size:22px;font-weight:600}
.stats span{font-size:11px;color:var(--muted)}
.direction-progress{border-top:1px solid var(--line);margin-top:12px;padding-top:8px}
.direction-progress h3{font-size:12px;margin:8px 0 4px}
.direction-progress p{margin:4px 0}
.practice{padding:22px;background:#fffef8;min-height:300px}
.practice>div{width:100%}
#empty{color:var(--muted);font-size:14px}
h2{font-size:18px;font-weight:600;margin:0 0 12px}
.quiz-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.pill{display:inline-block;font-size:11px;color:var(--green);background:#eef1e6;padding:5px 8px;border-radius:20px;overflow-wrap:anywhere}
#counter{font-size:12px;color:var(--muted);white-space:nowrap}
.track{height:4px;background:#edf0e4;margin:14px 0 18px;border-radius:5px}
#bar{height:100%;background:#8ba581;border-radius:5px;transition:width .2s}
.eyebrow{font-size:11px;font-weight:600;letter-spacing:.7px;color:var(--accent);margin:16px 0 8px}
#question{font-size:clamp(28px,3vw,42px);line-height:1.3;margin:8px 0;overflow-wrap:anywhere}
#reading{color:var(--muted);font-size:13px;line-height:1.5;margin:8px 0 16px;overflow-wrap:anywhere}
#answer{font-size:16px;padding:10px;min-height:42px}
.actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:10px}
#feedback{border-top:1px solid var(--line);margin-top:16px;padding-top:6px}
#result{font-weight:600;line-height:1.5}
#solution{font-size:20px;white-space:pre-line;line-height:1.5;margin:10px 0;overflow-wrap:anywhere}
#solutionReading{color:var(--muted);font-size:13px;overflow-wrap:anywhere}
#source{font-size:11px;margin:8px 0}
#selfGrade p{font-size:12px;margin:10px 0 8px}
#selfGrade button{margin-bottom:4px}
#next{margin-top:10px}
#summary p{line-height:1.5}
#storageWarning{color:#a33e24;background:#fff0e6;padding:12px;border-radius:8px}
#manager{background:#fffef8;padding:14px;height:calc(100dvh - 78px);display:flex;flex-direction:column;gap:10px}
.manager-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.manager-head h2{margin:0;font-size:16px}
#manager>p{margin:0}
.table-options{display:flex;gap:8px;flex-wrap:wrap;border:0;padding:0;margin:0}
.table-options legend{font-size:12px;font-weight:600;margin-bottom:6px}
.table-options label{display:flex;gap:7px;align-items:center;margin:0;padding:8px 12px;border:1px solid var(--line);border-radius:7px;cursor:pointer}
.table-options input{width:auto;min-height:0;margin:0;accent-color:var(--green)}
.table-options label:has(input:checked){background:#e3e9da;border-color:#8ba581}
.knowledge-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;flex-shrink:0;border:1px solid var(--line);border-radius:7px;background:#f0f3e8}
.knowledge-card{padding:6px;text-align:center;display:flex;flex-direction:column;justify-content:space-between;gap:2px}
.knowledge-card+.knowledge-card{border-left:1px solid var(--line)}
.knowledge-card h3{font-size:11px;font-weight:600;margin:0;line-height:1.3}
.knowledge-card strong{display:block;font-size:17px;font-weight:600;color:var(--green);line-height:1.2}
.knowledge-card p{font-size:10px;color:var(--muted);margin:0;line-height:1.3}
.table-wrap{overflow:auto;flex:1;min-height:80px}
table{width:100%;min-width:960px;border-collapse:collapse;font-size:13px}
th,td{text-align:left;border-bottom:1px solid var(--line);padding:9px}
th{color:var(--muted);font-size:11px;background:#fffef8;position:sticky;top:0;z-index:1}
.status-ok{color:#28764d;font-weight:700}.status-ko{color:#b13d2e;font-weight:700}
td.status-ok,td.status-ko{text-align:center;font-size:22px}
.status-legend{font-size:11px;line-height:1.5;color:var(--muted)}
[hidden]{display:none!important}
:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
@media(max-width:800px){
  .layout{grid-template-columns:1fr;gap:12px}aside{position:static;padding:12px}
  .settings-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 12px}
  .practice{padding:16px;min-height:180px}
  main{padding:10px 12px}header{padding:6px 12px}
  #manager{height:calc(100dvh - 68px);padding:12px;gap:8px}
}
@media(max-width:420px){
  .local{font-size:10px;max-width:58%;text-align:right}
  .settings-grid{gap:8px}.field label{font-size:11px}select{font-size:12px;padding-left:6px}
  .knowledge-card{padding:5px 3px}
  .table-options label{padding:7px 9px;font-size:12px}
}
@media(max-width:960px){
  #manager{gap:6px}
  .table-wrap{overflow-x:hidden;min-height:0}
  table{display:block;min-width:0;width:100%;font-size:14px}
  thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  tbody{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 8px;padding:10px;border:1px solid var(--line);border-radius:8px;background:#fffef8;align-content:start}
  tbody td{border:0;padding:0;min-width:0;overflow-wrap:anywhere}
  tbody td:nth-child(1){font-size:21px;font-weight:600;line-height:1.3}
  tbody td:nth-child(2){font-size:12px;color:var(--muted);text-align:right;align-self:center;line-height:1.4}
  tbody td:nth-child(3){grid-column:1/-1;font-size:14px;line-height:1.5;margin:3px 0}
  tbody td:nth-child(4),tbody td:nth-child(5),tbody td:nth-child(6),tbody td:nth-child(8),tbody td:nth-child(9){display:none}
  tbody td:nth-child(7),tbody td:nth-child(10){display:flex;align-items:center;gap:6px;font-size:19px;min-height:22px}
  tbody td:nth-child(7)::before{content:'JP → CA';font-size:10px;font-weight:500;color:var(--muted)}
  tbody td:nth-child(10)::before{content:'CA → JP';font-size:10px;font-weight:500;color:var(--muted)}
}
@media(max-width:560px){tbody{grid-template-columns:minmax(0,1fr)}}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
