:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Noto Sans",sans-serif;color:#192b29;background:#f5f7f6;font-size:15px}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.45}header{background:#fff;border-bottom:1px solid #e1e9e5;position:sticky;top:0;z-index:2}.bar{max-width:1120px;margin:auto;padding:16px 24px;display:flex;align-items:center;justify-content:space-between;gap:16px}.brand{font-weight:800;font-size:19px;color:#163d35}.brand span{display:inline-grid;place-items:center;background:#146b58;color:white;border-radius:6px;width:32px;height:32px;margin-right:9px;font-size:16px}.header-right{display:flex;align-items:center;gap:14px;color:#637570;font-size:13px}main{max-width:1120px;margin:auto;padding:36px 24px 80px}h1,h2,h3,p{margin-top:0}h1{font-size:29px;margin-bottom:8px}h2{font-size:20px}p{line-height:1.65}.muted{color:#71817b}.eyebrow{font-size:12px;color:#16806a;font-weight:700;margin-bottom:10px}.welcome{display:flex;justify-content:space-between;align-items:end;margin-bottom:30px}.stats{display:flex;gap:32px;text-align:right}.stats strong{display:block;font-size:24px}.stats span{font-size:12px;color:#71817b}.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.feature{background:white;border:1px solid #e2eae6;border-radius:8px;padding:24px;text-align:left;min-height:166px;display:flex;flex-direction:column;align-items:flex-start;transition:border-color .15s,transform .15s}.feature:hover{border-color:#8fb9aa;transform:translateY(-2px)}.feature .icon{width:40px;height:40px;border-radius:8px;display:grid;place-items:center;font-size:19px;background:#e4f2ec;color:#14705c;margin-bottom:18px}.feature:nth-child(2) .icon{background:#fff0d8;color:#b57616}.feature:nth-child(3) .icon{background:#fbe9e6;color:#bd5e50}.feature:nth-child(4) .icon{background:#e8eef8;color:#5277a2}.feature strong{font-size:17px;margin-bottom:6px}.feature small{color:#788984;font-size:13px;line-height:1.5}.section-title{margin:34px 0 15px;font-size:16px}.history{background:#fff;border:1px solid #e2eae6;border-radius:8px}.history-row{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid #edf1ef}.history-row:last-child{border:0}.primary,.secondary,.ghost,.danger{border:0;border-radius:6px;padding:11px 16px;font-weight:650}.primary{background:#176d59;color:#fff}.primary:hover{background:#105945}.secondary{background:#e8f1ed;color:#176d59}.ghost{background:transparent;color:#596e66}.danger{background:#f8e8e6;color:#ac473e}.auth{max-width:420px;margin:8vh auto;background:white;border:1px solid #e2eae6;border-radius:8px;padding:32px}.auth .brand{margin-bottom:32px}.auth h1{font-size:25px}.auth label,.field{display:block;font-size:13px;font-weight:650;margin:18px 0 6px}input,textarea,select{width:100%;padding:11px 12px;border:1px solid #d5dfda;border-radius:6px;background:white;color:#192b29}textarea{min-height:100px;resize:vertical}.auth .primary{width:100%;margin-top:22px}.auth-switch{text-align:center;margin-top:18px}.error{color:#bd5148;font-size:13px;margin:12px 0}.topline{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:24px}.back{padding-left:0}.pill{font-size:12px;color:#48776a;background:#e5f2ec;padding:6px 10px;border-radius:4px}.question-wrap{max-width:760px;margin:auto}.progress-track{height:5px;background:#e3ebe7;border-radius:5px;overflow:hidden;margin-bottom:28px}.progress-track span{display:block;height:100%;background:#20836c}.question{background:white;border:1px solid #e0e9e4;border-radius:8px;padding:30px}.question h2{font-size:20px;line-height:1.65;margin:16px 0 24px;white-space:pre-wrap}.question img{display:block;max-width:100%;max-height:360px;object-fit:contain;margin:0 auto 24px}.options{display:grid;gap:10px}.option{display:flex;align-items:center;gap:13px;width:100%;text-align:left;padding:14px;border:1px solid #dce5e0;border-radius:6px;background:#fff;line-height:1.5;color:#253731}.option:hover:not(:disabled){border-color:#65a38e;background:#f7fbf9}.option b{display:grid;place-items:center;flex:0 0 30px;height:30px;border:1px solid #d9e3dd;border-radius:50%;font-size:13px}.option.correct{border-color:#5baa83;background:#e9f7ee;color:#176942}.option.wrong{border-color:#d98279;background:#fff0ee;color:#ae3f36}.option.chosen{border-color:#398b75;background:#eef8f3}.option:disabled{opacity:1}.feedback{background:#f1f3f2;padding:16px;border-radius:6px;margin-top:18px;line-height:1.7}.feedback strong{color:#176d59}.controls{display:flex;justify-content:space-between;gap:12px;margin-top:20px}.controls button{min-width:104px}.empty{text-align:center;color:#7a8c84;padding:45px 20px}.admin-tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:22px}.admin-list{display:grid;gap:8px}.admin-row{background:#fff;border:1px solid #e0e9e4;border-radius:6px;padding:14px;display:flex;align-items:center;gap:12px}.admin-row .text{flex:1;min-width:0}.admin-row .text p{margin:4px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-row small{color:#71817b}.form{max-width:700px;background:#fff;border:1px solid #e0e9e4;padding:24px;border-radius:8px}.form label{display:block;margin-top:14px}.form .check{display:flex;align-items:center;gap:8px}.check input{width:auto}.form-actions{display:flex;gap:10px;margin-top:22px}.notice{padding:14px 16px;background:#fff6e5;color:#8a641e;border-radius:6px;margin-bottom:20px;font-size:13px;line-height:1.6}@media(max-width:600px){.bar{padding:13px 16px}.header-right{gap:5px}main{padding:27px 16px 72px}.welcome{align-items:start;gap:15px}.welcome h1{font-size:24px}.stats{gap:17px}.stats strong{font-size:20px}.grid{gap:10px}.feature{padding:17px;min-height:155px}.feature strong{font-size:15px}.question{padding:20px 16px}.question h2{font-size:18px}.auth{margin:4vh auto;padding:24px}.admin-row{flex-wrap:wrap}}
:root .history-button{width:100%;background:#fff;border:0;border-bottom:1px solid #edf1ef;text-align:left;color:inherit;gap:16px}.history-button:hover{background:#f5faf7}.history-button>span:last-child{text-align:right}.history-date,.history-action{display:block;margin-top:5px;font-size:12px}.history-action{color:#176d59}.exam-detail{margin-bottom:12px}
:root .brand-home{padding:0;border:0;background:transparent;text-align:left;white-space:nowrap}.brand-home:focus-visible{outline:2px solid #176d59;outline-offset:4px;border-radius:3px}

/* Keep content and controls usable on narrow screens and around device cutouts. */
html{-webkit-text-size-adjust:100%}
body{min-width:0;overflow-wrap:anywhere}
.bar{padding-left:max(24px,env(safe-area-inset-left));padding-right:max(24px,env(safe-area-inset-right))}
main{padding-left:max(24px,env(safe-area-inset-left));padding-right:max(24px,env(safe-area-inset-right));padding-bottom:max(80px,env(safe-area-inset-bottom))}
.bar,.header-right,.welcome,.history-row,.topline,.controls{min-width:0}
.header-right>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.question-wrap,.question,.form,.feature,.history-button>span,.option span{min-width:0}
.question h2,.feedback,.option span,.history-button strong,.eyebrow{overflow-wrap:anywhere;word-break:normal}
.question img{height:auto}
.option{min-height:48px}
.history-button>span:first-child{flex:1}
.history-button>span:last-child{flex-shrink:0}
.topline input{min-width:0}
.topline button,.controls button{flex-shrink:0}
.auth{width:min(420px,calc(100% - 32px))}
@media(max-width:600px){
  .bar{padding:12px max(16px,env(safe-area-inset-right)) 12px max(16px,env(safe-area-inset-left));gap:8px 12px;flex-wrap:wrap}
  .brand-home{font-size:17px}
  .header-right{margin-left:auto;max-width:100%;gap:2px}
  .header-right>span{max-width:100px}
  .header-right .ghost{padding:10px 8px;white-space:nowrap}
  main{padding:24px max(16px,env(safe-area-inset-right)) max(72px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
  input,textarea,select{font-size:16px}
  .welcome{align-items:flex-start;flex-wrap:wrap}
  .welcome p{margin-bottom:0}
  .stats{margin-left:auto}
  .feature{height:auto;min-height:155px}
  .topline{gap:8px}
  .pill{white-space:nowrap}
  .controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .controls button{min-width:0;min-height:44px;padding:10px 8px}
  .controls button:nth-child(2):nth-last-child(2){grid-column:1 / -1;grid-row:2}
  .history-row{padding:14px;gap:10px}
  .history-button>span:last-child{max-width:45%}
  .form{padding:20px 16px}
}
@media(max-width:390px){
  .bar{align-items:center}
  .header-right{flex:1 1 100%;justify-content:flex-end}
  .header-right>span{margin-right:auto;max-width:45%}
  .welcome{display:block}
  .stats{margin:20px 0 0;text-align:left;justify-content:flex-start}
  .feature{padding:14px;min-height:150px}
  .feature small{font-size:12px}
  .question{padding:18px 14px}
  .option{padding:12px 10px;gap:10px}
  .history-button>span:last-child{max-width:42%}
}

/* Question rows must not expand the grid beyond the viewport. */
#admin-list{grid-template-columns:minmax(0,1fr);min-width:0;max-width:100%}
#admin-list .admin-row{min-width:0;max-width:100%;flex-wrap:nowrap;align-items:flex-start}
#admin-list .admin-row[hidden]{display:none}
#admin-list .text{flex:1 1 0;min-width:0}
#admin-list .text small,#admin-list .text p{overflow-wrap:anywhere;word-break:normal}
#admin-list .text p{white-space:normal;overflow:visible;line-height:1.5}
#admin-list .admin-row button{flex:0 0 auto;min-height:44px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.language-control{display:inline-flex;flex:0 0 auto}
.language-select{width:auto;min-height:40px;padding:6px 8px;border:1px solid #d5dfda;border-radius:6px;background:#fff;color:#192b29;font-size:13px}
.auth-language{display:flex;justify-content:flex-end;margin:-8px 0 12px}
@media(max-width:600px){.header-right{flex-wrap:wrap;justify-content:flex-end}.header-right>span{max-width:80px}.language-select{font-size:14px}}
