*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;background:#f2f6fa;color:#142b40;font:17px/1.6 system-ui;overflow-wrap:anywhere}
header,main,footer{max-width:850px;margin:auto;padding:24px}
header{font-weight:800}
header a{color:inherit}
a{color:#12669a}
h1{font-size:clamp(36px,7vw,65px);line-height:1.08;margin:12px 0 20px}
h2,h3,h4{line-height:1.25;margin:0 0 8px}
p{margin:8px 0 16px}
.tag{color:#12669a;font-weight:700;font-size:16px;letter-spacing:.04em}
.hint,footer{color:#456;font-size:16px}
section{background:white;border:1px solid #dbe5ed;border-radius:18px;padding:24px;margin:24px 0}
form{max-width:420px;display:grid;gap:12px;margin:20px 0 8px}
form .hint{margin:-8px 0 0}
label{display:grid;gap:4px;font-weight:650}
input,button,.button{min-height:44px;min-width:44px;padding:8px 12px;border:1px solid #b9cbd9;border-radius:8px;background:white;font:inherit;color:inherit}
input{width:100%}
button,.button{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;cursor:pointer}
button:hover,.button:hover{background:#e5f4ff}
button:disabled{opacity:.7;cursor:wait}
.primary{background:#12669a;color:white;border-color:#12669a;font-weight:650}
.primary:hover{background:#0d527d}
.account-actions,.dashboard-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.dashboard-head{justify-content:space-between;border-bottom:1px solid #dbe5ed;padding-bottom:16px;margin-bottom:20px}
.dashboard-head p{margin:0}
.account-actions{margin-top:12px}
.notice{padding:12px 16px;background:#e5f4ff;border-radius:8px}
.notice[data-error]{background:#fff2e9;border:1px solid #f1c9ac;color:#763512}
dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:16px 0}
dl div,.membership{background:#f2f6fa;border:1px solid #dbe5ed;border-radius:12px;padding:12px}
dd{margin:4px 0 0;font-size:1.35rem;font-weight:700}
.membership{margin-top:24px}
.membership .tag{margin-top:0}
.study-library{margin-top:28px;padding-top:24px;border-top:1px solid #dbe5ed}
.library-heading{display:flex;align-items:start;justify-content:space-between;gap:12px;flex-wrap:wrap}
.library-heading .tag{margin:0}
.library-draft{display:inline-block;background:#f8edd9;color:#674719;border-radius:6px;padding:3px 8px;font-weight:650}
.library-meter{display:grid;gap:6px;margin-top:16px}
.library-meter progress{width:100%;height:12px;accent-color:#12669a}
.library-modes{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:20px 0 16px}
.library-modes button[aria-pressed="true"]{background:#12669a;border-color:#12669a;color:white;font-weight:650}
.library-filter{font-weight:650;max-width:340px;margin-bottom:16px}
.library-filter select{min-height:44px;border:1px solid #b9cbd9;border-radius:8px;background:white;color:inherit;font:inherit;padding:8px;width:100%}
.study-items{display:grid;gap:10px;min-width:0}
.study-item{padding:14px;border:1px solid #dbe5ed;border-radius:12px;background:#f7faff;min-width:0}
.study-item p:last-child{margin-bottom:0}
.study-item summary{min-height:44px;cursor:pointer;font-weight:700;padding:8px 0}
.study-item summary .study-mark{margin-left:8px}
.study-item .tag{margin:0 0 6px;letter-spacing:.025em}
.study-mark{color:#255e46;font-weight:650;font-size:16px}
.study-choices,.study-navigation{display:grid;gap:8px;margin:12px 0}
.study-choices button{justify-content:flex-start;text-align:left;width:100%}
.study-choices button[data-correct]{border-color:#3c7d59;background:#e7f4ed;opacity:1}
.study-choices button[data-incorrect]{border-color:#ad7450;background:#fff2e9;opacity:1}
.study-navigation{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
.study-progress-message{margin:8px 0 0}
.study-feedback{border-left:3px solid #12669a;padding:8px 12px;background:white;white-space:pre-line}
.study-body{white-space:pre-line}
.study-jump{margin-right:8px;margin-bottom:8px}
:focus-visible{outline:2px solid #12669a;outline-offset:3px}
@media (max-width:640px){
  header,main,footer,section{padding:16px}
  h1{font-size:clamp(32px,8vw,44px)}
  header a{display:inline-flex;align-items:center;min-height:44px}
  input,button,.button{font-size:16px}
  .library-modes{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:390px){
  dl{grid-template-columns:1fr}
  dl div{display:flex;align-items:center;justify-content:space-between;gap:8px}
  dd{margin:0}
}
