/* v0.3 | Readability-first exam portal
   Reference patterns: clear learning paths, numbered question navigation, visible answer status.
   Type scale and keyboard focus target WCAG 2.2 AA principles; no external fonts required.
*/
:root {
  --ink:#172c40; --sub:#42566b; --muted:#526579;
  --blue:#005b9c; --blue-hover:#004775; --line:#d6dfe8;
  --bg:#f5f7fa; --white:#fff; --radius:8px;
  font-size:18px;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
}
html[data-readability="0"] {font-size:16px}
html[data-readability="1"] {font-size:18px}
html[data-readability="2"] {font-size:20px}
body {font-size:1rem; line-height:1.78; background:var(--bg); color:var(--ink)}
button, input, textarea, select {font-size:1rem}
a {text-underline-offset:.16em}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible,[tabindex]:focus-visible {
  outline:3px solid #007fc1!important;outline-offset:3px!important;
}
.skip-link {position:fixed;top:-200px;left:12px;z-index:1000;background:#fff;color:var(--blue);padding:12px 22px;border:2px solid var(--blue)}
.skip-link:focus {top:12px}
.sidebar {width:254px;padding:27px 18px 22px;background:#fff}
.brand {padding:0 13px 25px;margin-bottom:21px}
.brand-rule{height:4px;width:42px;margin-bottom:16px}
.brand-name {font-size:1.03rem;line-height:1.5;white-space:normal;letter-spacing:-.025em}
.brand-caption {font-size:.76rem;line-height:1.6;color:var(--sub);margin-top:4px}
.nav-label {font-size:.73rem;color:var(--muted);margin:10px 0 6px;padding:0 12px}
.management-label {margin-top:23px}
.sidenav {gap:5px}
.nav-item {padding:12px 13px;font-size:.91rem;line-height:1.55;min-height:48px;font-weight:600;border-radius:6px;color:#354c61}
.nav-item.active {border-left-color:var(--blue);background:#eaf3f9;color:#004a82}
.nav-item:hover {background:#f1f6f9}
.sidebar-bottom {font-size:.72rem;color:var(--muted);line-height:1.55}
.topbar {height:72px;padding:0 40px;gap:15px}
#currentTitle {font-size:1rem;font-weight:750;color:var(--ink)}
.top-right {gap:14px}
.top-date {font-size:.76rem;color:var(--muted)}
.top-tag {font-size:.74rem;color:#40566c;border-color:#aebfce;padding:2px 9px}
.font-controls {display:flex;gap:5px;align-items:center;white-space:nowrap}
.font-controls span {font-size:.75rem;color:var(--sub);margin-right:4px}
.font-controls button {background:#fff;border:1px solid #9aafc1;border-radius:6px;min-width:45px;height:40px;font-size:.92rem;font-weight:750;color:var(--blue);padding:0 7px}
.font-controls button:hover {background:#ebf4fa}
.font-controls button[aria-disabled="true"] {opacity:.5;cursor:default}
.content {padding:36px 44px 65px;max-width:1180px}
.footer {padding:22px 40px;font-size:.72rem;color:#4f6378}
.alert {font-size:.78rem;line-height:1.7;padding:13px 16px;gap:12px;margin-bottom:28px;border-left-width:4px;color:#304a60;background:#eff6fa;border-color:#cfdee9}
.alert strong {font-size:.8rem;color:#173a55}
.alert button {font-size:1.3rem;min-width:30px;min-height:30px;line-height:1;color:#31526d}
.eyebrow {font-size:.78rem;letter-spacing:.02em;color:#005b9c}
.h-title {font-size:2rem;line-height:1.35;margin:10px 0 17px;letter-spacing:-.025em}
.lead {font-size:1rem;line-height:1.85;color:var(--sub);margin:0;max-width:52rem}
.page-intro {margin:4px 0 29px}
.section-head {margin:35px 0 15px;align-items:center}
.section-head h2 {font-size:1.25rem;line-height:1.5;margin:0 0 4px}
.section-head p {font-size:.83rem;line-height:1.7;color:var(--sub)}
.btn {font-size:.91rem;border-radius:6px;min-height:52px;padding:12px 20px;line-height:1.5;font-weight:750;border-color:var(--blue);background:var(--blue)}
.btn:hover:not(:disabled) {background:var(--blue-hover)}
.btn.outline,.btn.ghost {border-color:#8eacc4;color:#004f88;background:#fff}
.btn.outline:hover,.btn.ghost:hover {background:#eef6fb}
.btn.small {font-size:.81rem;min-height:44px;padding:8px 13px}
.btn:disabled {opacity:.6}
.pill {font-size:.75rem;line-height:1.4;border-radius:5px;padding:6px 10px}
.card,.panel,.stat,.quiz-panel,.quiz-side,.review-card,.locked {border-color:var(--line);border-radius:8px;background:#fff}
.panel {padding:29px;margin-top:21px}
.panel h3 {font-size:1.16rem;margin-bottom:16px}
.hint {font-size:.8rem;color:var(--sub);line-height:1.78}
.small-note {font-size:.78rem;line-height:1.85;padding:16px 18px;color:#614918;border-color:#e4d3a8}
.copyright-small {font-size:.76rem;color:var(--sub)}
/* Home: two decisive routes, no ornament or forced statistics. */
.page-intro-home {margin-bottom:29px}
.primary-actions {display:grid;grid-template-columns:1fr 1fr;gap:18px}
.feature-card {background:#fff;border:1px solid var(--line);border-top:4px solid #9eb6c8;border-radius:8px;padding:27px 27px 25px;display:flex;flex-direction:column;min-height:300px}
.feature-card.featured {border-top-color:#0064a7}
.feature-type {font-size:.81rem;font-weight:750;color:#36526b;margin-bottom:9px}
.feature-card h2 {font-size:1.43rem;letter-spacing:-.02em;margin:0 0 14px;line-height:1.4}
.feature-card p {font-size:.92rem;color:var(--sub);line-height:1.85;margin:0 0 18px}
.feature-meta {font-size:.82rem;font-weight:700;color:#354d63;margin-top:auto;margin-bottom:22px;line-height:1.65}
.feature-card .btn {align-self:flex-start;min-width:218px}
.text-link-btn {border:0;background:transparent;color:var(--blue);font-weight:750;font-size:.86rem;text-decoration:underline;text-underline-offset:4px;min-height:44px;padding:5px}
.stats {gap:12px;margin-top:14px}
.stat {padding:18px 21px}
.stat-k {font-size:.77rem;color:var(--sub);font-weight:700}
.stat-v {font-size:1.8rem;line-height:1.4;margin-top:6px;color:#173a55}
.stat-v span {font-size:.8rem;color:var(--sub)}
.home-howto .steps {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:13px}
.step {padding:19px 17px;background:#fff;border:1px solid var(--line);border-radius:8px;display:flex;gap:13px}
.step-count {flex:0 0 33px;width:33px;height:33px;background:#eaf2f8;color:#005b9c;font-size:.94rem;font-weight:750;border-radius:50%;text-align:center;line-height:33px}
.step h3 {font-size:.91rem;margin:2px 0 9px;line-height:1.6}
.step p {font-size:.82rem;color:var(--sub);margin:0;line-height:1.77}
/* Regular content */
.welcome {padding:25px;gap:18px}
.welcome h2{font-size:1.25rem}
.welcome p{font-size:.88rem}
.cards{gap:14px}
.card{padding:25px 22px;min-height:250px}
.card h3{font-size:1.1rem}
.card p{font-size:.88rem;color:var(--sub)}
.card-no{font-size:.79rem}
.grid2 {gap:19px}
.info-row {font-size:.9rem;gap:18px;line-height:1.85}
.info-row b {min-width:105px}
.field {font-size:.88rem;color:var(--ink);font-weight:750;gap:9px;line-height:1.6}
.field input,.field textarea,.field select {min-height:51px;padding:11px 14px;border-color:#a7b9c9;border-radius:6px;font-size:.95rem;color:var(--ink)}
.field textarea {min-height:124px;line-height:1.75}
.field input::placeholder {color:#718198}
.actions {gap:12px}
.record-row {padding:15px 0;font-size:.94rem}
.record-row small {color:var(--sub);font-size:.79rem}
/* Exam: question is visually dominant; choices are generous, clearly selected. */
.quiz-header {margin-bottom:19px;align-items:center}
.step-title {font-size:1.43rem;line-height:1.45;margin:6px 0 4px}
.quiz-header .hint {font-size:.84rem}
.progressbar {height:9px;margin:15px 0 21px;background:#e0e7ee;border-radius:10px}
.progressbar>div {border-radius:10px;background:var(--blue)}
.quiz-layout {grid-template-columns:minmax(0,1fr) 240px;gap:19px;align-items:start}
.quiz-panel {padding:30px 31px}
.quiz-side {padding:22px;position:sticky;top:18px}
.quiz-side h4{font-size:1rem;line-height:1.6;margin:0 0 8px}
.answered-note{font-weight:700;font-size:.87rem;margin:0 0 15px;color:var(--sub)}
.question-eyebrow {font-size:.8rem;gap:10px;color:var(--sub);line-height:1.65}
.qtext {font-size:1.25rem;line-height:1.9;margin:20px 0 14px;color:#102e46;letter-spacing:.005em;font-weight:750;overflow-wrap:anywhere}
.choice-guide {font-size:.83rem;color:var(--sub);margin:0 0 14px;line-height:1.7}
.choices {gap:12px}
.choice {font-size:1.02rem;line-height:1.75;min-height:73px;padding:15px 18px;border:2px solid #bdcbd8;border-radius:7px;gap:15px;color:var(--ink);font-weight:500;align-items:center}
.choice .letter {font-size:.87rem;flex:0 0 38px;height:38px;border:1px solid #9db1c0;border-radius:5px;color:#1e3c55;background:#f3f6f8}
.choice:hover {border-color:#005b9c;background:#f3f9fc}
.choice.active {background:#eaf4fa;border-color:#005b9c;box-shadow:inset 4px 0 #005b9c}
.choice.active .letter {background:#005b9c;border-color:#005b9c}
.quiz-controls {margin-top:30px;gap:14px}
.quiz-controls .btn {min-width:145px}
.number-pad {gap:7px;grid-template-columns:repeat(4,minmax(0,1fr))}
.number-pad button {font-size:.84rem;border:2px solid #c1ced9;border-radius:5px;min-height:43px;aspect-ratio:auto;background:#fff;color:#234961}
.number-pad button.now {outline:3px solid #005b9c;outline-offset:1px;background:#fff;color:#004e85}
.number-pad button.done {background:#005b9c;color:#fff;border-color:#005b9c}
.number-pad button.done.now {background:#005b9c;color:#fff;outline:3px solid #123f61}
.number-pad button.flagged {text-decoration:underline;text-decoration-color:#ca6405;text-decoration-thickness:3px;text-underline-offset:5px}
.side-info{font-size:.77rem;color:var(--sub);line-height:1.9;margin:14px 0}
.review-toggle {background:#fff;color:#07588e;border:1px solid #8eadc2;border-radius:5px;min-height:47px;padding:9px 12px;width:100%;font-size:.78rem;font-weight:700;text-align:center}
.review-toggle:hover {background:#edf6fb}
.review-toggle[aria-pressed="true"]{color:#7d430a;background:#fff7e9;border-color:#e5b97a}
.timer {font-size:1.3rem;color:#163b58}
/* Results: full explanations readable, not tiny table rows. */
.results-hero {padding:34px 22px}
.results-hero h2{font-size:1.36rem;line-height:1.5}
.results-hero p{font-size:.92rem;color:var(--sub)}
.result-ring {width:136px;height:136px}
.result-ring b {font-size:1.9rem}
.review-card {padding:25px 29px;margin:15px 0}
.review-card h4{font-size:1.09rem;line-height:1.85;margin:15px 0}
.review-options {font-size:.89rem;line-height:1.85;gap:9px;margin:18px 0}
.review-text {font-size:.9rem;line-height:1.9;color:#354f64;margin:18px 0}
.review-card a {font-size:.87rem;font-weight:750}
/* Editing admin stays functional and comfortably readable. */
.editor-grid {grid-template-columns:270px minmax(0,1fr);gap:17px}
.question-line {font-size:.82rem;padding:12px;gap:10px;line-height:1.6;min-height:54px;overflow-wrap:anywhere}
.question-line small {font-size:.72rem;color:var(--sub)}
.question-list {gap:5px;max-height:750px}
/* Certificate retains its own formal paper scale. */
.certificate {border-width:2px;padding:52px 43px;max-width:790px}
.cert-kicker{font-size:.78rem}.cert-title{font-size:2.03rem}
.cert-name{font-size:1.5rem}.cert-copy{font-size:.92rem}
.cert-details{font-size:.84rem}.cert-footer{font-size:.85rem}.cert-note{font-size:.78rem;line-height:1.85}
.locked {padding:45px 25px}
.locked h2{font-size:1.3rem}.locked p{font-size:.92rem}
.toast {font-size:.85rem;line-height:1.65}
@media (max-width:1180px) {
 .sidebar {width:228px;padding-left:14px;padding-right:14px}
 .content{padding:29px 27px 51px}
 .topbar{padding:0 28px}
 .quiz-layout{grid-template-columns:minmax(0,1fr) 205px;gap:14px}
 .quiz-panel{padding:23px}
 .quiz-side{padding:16px}
 .home-howto .steps{grid-template-columns:1fr}
 .step{padding:15px 18px}
}
@media (max-width:800px) {
 .sidebar {position:fixed;width:min(300px,88vw);height:100dvh;top:0;z-index:40;box-shadow:10px 0 24px #17334a1e;transform:translateX(-110%)}
 .sidebar.open{transform:translateX(0)}
 .mobile-menu {display:block;min-width:46px;min-height:45px;font-size:1.2rem;border-color:#b1c1ce}
 .topbar{height:69px;padding:0 18px}
 .content{padding:22px 17px 42px}
 .top-date{display:none}
 .top-right{gap:7px}
 .font-controls span{display:none}
 .font-controls button{min-width:42px;height:42px}
 .primary-actions,.cards,.grid2,.topic-panel,.editor-grid,.quiz-layout{grid-template-columns:1fr}
 .feature-card{min-height:0;padding:24px}
 .feature-card .btn{align-self:stretch;width:100%}
 .quiz-side{position:static;order:-1}
 .number-pad{grid-template-columns:repeat(5,minmax(0,1fr))}
 .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .panel,.quiz-panel,.quiz-side{padding:20px}
 .alert{font-size:.8rem;gap:7px;flex-wrap:wrap}
 .alert strong{width:auto}.alert span{flex-basis:75%}
 .section-head{align-items:flex-start;flex-wrap:wrap}
 .quiz-controls .btn{min-width:0;flex:1}
 .certificate{padding:30px 20px}
 .cert-details{display:grid;gap:8px}
 .footer{padding:20px}
}
@media (max-width:460px) {
 .topbar{padding:0 12px}
 #currentTitle{font-size:.83rem}
 .top-left{gap:8px}
 .top-tag{display:none}
 .content{padding:18px 13px 37px}
 .alert{margin-bottom:20px}
 .h-title{font-size:1.63rem}
 .lead{font-size:.91rem}
 .feature-card h2{font-size:1.29rem}
 .feature-card p{font-size:.91rem}
 .stats{gap:8px}
 .stat{padding:15px}
 .stat-v{font-size:1.5rem}
 .quiz-panel{padding:19px 14px}
 .qtext{font-size:1.14rem;line-height:1.87}
 .choice{font-size:.96rem;padding:14px 11px;min-height:70px;gap:10px}
 .choice .letter{flex-basis:34px;height:34px}
 .quiz-header .pill{max-width:126px;flex-wrap:wrap}
 .quiz-controls{flex-wrap:wrap}
 .quiz-controls .btn{width:100%;flex:1 1 100%}
 .review-card{padding:20px 16px}
 .font-controls button{min-width:39px;padding:0 4px}
 .cert-title{font-size:1.7rem}
}
@media (prefers-reduced-motion:reduce){ *,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
@media print {
 html,html[data-readability]{font-size:16px}
 .print-sheet .certificate{padding:25mm 12mm;max-width:none}
 .font-controls,.skip-link{display:none!important}
}
/* Place the question first on small screens, with status below it. */
@media(max-width:800px) {.quiz-side{order:0}.quiz-panel{order:0}}
