.m4-page{margin:0;background:#fcfaf7}
#m4-exam{--ink:#2e2529;--muted:#655b5e;--red:#9d2434;--dark:#781729;--line:#e5dbd7;--soft:#fff1ec;--cream:#fcfaf7;color:var(--ink);background:var(--cream);min-height:100vh;font-family:"Leelawadee UI","Noto Sans Thai",Tahoma,system-ui,sans-serif;font-size:16px;line-height:1.65;text-align:left}
#m4-exam *{box-sizing:border-box}
#m4-exam :is(h1,h2,h3,p,fieldset){margin:0;padding:0}
#m4-exam h1,#m4-exam h2,#m4-exam h3{line-height:1.35;color:inherit;letter-spacing:normal;font-family:inherit;font-weight:750}
#m4-exam :is(button,select,input){font:inherit;letter-spacing:normal}
#m4-exam :is(button,a,input,select):focus-visible{outline:3px solid #285d92;outline-offset:3px}
#m4-exam button,#m4-exam select{cursor:pointer}
#m4-exam .m4-wrap{width:min(1120px,calc(100% - 48px));margin-inline:auto}
#m4-exam .m4-head{background:#fff;border-bottom:1px solid var(--line)}
#m4-exam .m4-nav,#m4-exam .m4-row,#m4-exam .m4-actions{display:flex;align-items:center;justify-content:space-between;gap:16px}
#m4-exam .m4-nav{min-height:70px}
#m4-exam .m4-brand{display:inline-flex;align-items:center;gap:12px;color:var(--ink);font-weight:800;text-decoration:none}
#m4-exam .m4-mark{color:white;background:var(--red);border-radius:11px;font-size:17px;padding:5px 9px}
#m4-exam .m4-hero{background:linear-gradient(114deg,#801727,#a72637);color:#fff}
#m4-exam .m4-hero-inner{display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,340px);gap:30px;align-items:end;padding-block:55px}
#m4-exam .m4-kicker{font-size:.86rem;color:#ffe6db;font-weight:700;margin-bottom:6px}
#m4-exam .m4-hero h1{font-size:clamp(2.4rem,5.5vw,4.4rem)}
#m4-exam .m4-intro{margin-top:8px;color:#fff3e9}
#m4-exam .m4-totals{padding:16px 20px;border:1px solid #ffffff60;border-radius:18px;display:flex;justify-content:space-between;gap:13px}
#m4-exam .m4-totals strong,#m4-exam .m4-totals small{display:block}
#m4-exam .m4-totals strong{font-size:clamp(1.5rem,3vw,2rem);line-height:1.2}
#m4-exam .m4-totals small{font-size:.8rem;color:#ffe8df}
#m4-exam .m4-body{padding-block:35px 72px}
#m4-exam .m4-row{flex-wrap:wrap}
#m4-exam .m4-search,#m4-exam .m4-select{color:var(--ink);background:#fff;border:1px solid #c9bbba;padding:9px 14px;min-height:44px;border-radius:11px}
#m4-exam .m4-search{width:min(100%,340px)}
#m4-exam .m4-filter,#m4-exam .m4-actions{display:flex;flex-wrap:wrap;gap:9px;margin:18px 0}
#m4-exam :is(.m4-btn,.m4-out,.m4-chip,.m4-link,.m4-num){border:1px solid transparent;border-radius:10px;line-height:1.45;padding:9px 15px;min-height:42px;font-weight:700;transition:background-color .12s ease}
#m4-exam .m4-link{background:transparent;color:var(--red);padding:7px}
#m4-exam .m4-btn,#m4-exam .m4-chip[aria-pressed="true"]{background:var(--red);color:#fff}
#m4-exam .m4-btn:hover,#m4-exam .m4-chip[aria-pressed="true"]:hover{background:var(--dark)}
#m4-exam .m4-out,#m4-exam .m4-chip{color:var(--ink);background:#fff;border-color:var(--line)}
#m4-exam .m4-chip{border-radius:22px;font-size:.9rem}
#m4-exam :is(.m4-out,.m4-chip,.m4-num):hover{background:var(--soft)}
#m4-exam .m4-out:disabled{opacity:.46;cursor:default}
#m4-exam .m4-caption,#m4-exam .m4-facts,#m4-exam .m4-meta,#m4-exam .m4-source{color:var(--muted)}
#m4-exam .m4-caption{font-size:.9rem;margin:8px 0 14px}
#m4-exam .m4-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,270px),1fr));gap:15px}
#m4-exam .m4-card,#m4-exam .m4-panel,#m4-exam .m4-side{border:1px solid var(--line);border-radius:18px;background:#fff;padding:22px}
#m4-exam .m4-card{display:flex;align-items:flex-start;flex-direction:column;gap:8px;overflow-wrap:anywhere}
#m4-exam .m4-card h3{font-size:1.23rem}
#m4-exam .m4-source{display:block;font-size:.82rem;overflow-wrap:anywhere}
#m4-exam .m4-subject{font-size:.83rem;color:var(--dark);font-weight:750}
#m4-exam .m4-open{color:var(--red);font-weight:750;text-decoration:none;margin-top:auto;padding-top:10px}
#m4-exam .m4-open:hover{text-decoration:underline}
#m4-exam .m4-reader-link{display:inline-block;color:#fff;background:#ffffff12;border:1px solid #ffffff9c;border-radius:10px;padding:6px 12px;margin-top:15px;font-weight:700;text-decoration:none}
#m4-exam .m4-reader-link:hover{text-decoration:underline}
#m4-exam .m4-card-actions{display:flex;align-items:baseline;gap:8px 15px;flex-wrap:wrap;margin-top:auto}
#m4-exam .m4-study-link{color:var(--muted);text-underline-offset:3px;font-size:.92rem}
#m4-exam .m4-study-title{font-size:1.25rem;margin-top:18px}
#m4-exam .m4-study-nav{justify-content:flex-start}
#m4-exam .m4-title{font-size:clamp(1.8rem,5vw,3.4rem);margin:6px 0 14px}
#m4-exam .m4-body>.m4-panel{margin-block:22px}
#m4-exam .m4-panel>p{margin:12px 0}
#m4-exam .m4-worktitle{font-size:clamp(1.45rem,3.4vw,2.35rem)}
#m4-exam .m4-time{text-align:right}
#m4-exam .m4-time small{display:block;color:var(--muted)}
#m4-exam .m4-clock{font:700 1.7rem/1.2 ui-monospace,monospace;font-variant-numeric:tabular-nums}
#m4-exam .is-low{color:var(--red)}
#m4-exam .m4-layout{margin-top:18px;display:grid;grid-template-columns:minmax(0,1fr) 280px;align-items:start;gap:18px}
#m4-exam .m4-side{position:sticky;top:25px}
#m4-exam .m4-side h2,#m4-exam .m4-qnumber{font-size:1.19rem}
#m4-exam .m4-map{display:grid;grid-template-columns:repeat(auto-fill,minmax(39px,1fr));gap:5px;margin:12px 0;max-height:320px;overflow:auto;padding:3px}
#m4-exam .m4-num{border:1px solid var(--line);background:#fff;color:var(--ink);font-size:.88rem;padding:3px;min-height:38px}
#m4-exam .m4-num.is-answered{color:white;background:#5a4449}
#m4-exam .m4-num[aria-current="true"]{outline:2px solid var(--red);outline-offset:0}
#m4-exam .m4-side .m4-out{margin-top:15px;width:100%}
#m4-exam .m4-stem,#m4-exam .m4-explain,#m4-exam .m4-choice-text{white-space:pre-wrap;overflow-wrap:anywhere}
#m4-exam .m4-stem{font-size:1.09rem}
#m4-exam .m4-images:empty{display:none}
#m4-exam .m4-transcript{padding:8px 12px;margin:10px 0;background:#fbf7f4;border-radius:8px}
#m4-exam .m4-transcript summary{cursor:pointer;color:var(--dark);font-size:.9rem;font-weight:650}
#m4-exam .m4-transcript p{margin-top:10px}
#m4-exam .m4-images img{display:block;height:auto;max-width:100%;max-height:none;margin:12px auto}
#m4-exam .m4-panel{min-width:0}
#m4-exam .m4-table-frame{position:relative;max-width:100%;overflow-x:auto;margin-block:1rem}
#m4-exam .m4-table-frame:focus-visible{outline:3px solid #285d92;outline-offset:2px}
#m4-exam .m4-data-table{width:100%;border-collapse:collapse;color:var(--ink);font:inherit;font-variant-numeric:tabular-nums}
#m4-exam .m4-data-table caption{text-align:start;font-weight:700;padding-bottom:.4rem}
#m4-exam .m4-data-table th,#m4-exam .m4-data-table td{padding:.4rem .65rem;border:1px solid #a99b9c;text-align:start;vertical-align:top;white-space:pre-line}
#m4-exam .m4-data-table th{background:#f5eeeb;font-weight:700}
#m4-exam .m4-matrix{width:100%;max-width:30rem;table-layout:fixed}
#m4-exam .m4-matrix thead{position:absolute;clip-path:inset(50%);overflow:hidden;width:1px;height:1px;white-space:nowrap}
#m4-exam .m4-matrix tbody td,#m4-exam .m4-matrix tbody th{text-align:center;vertical-align:middle}
#m4-exam .m4-data-table .m4-cell-marked{background:#fde9db;font-weight:750}
#m4-exam .m4-data-table .m4-mark-top{border-top:3px solid var(--dark)}
#m4-exam .m4-data-table .m4-mark-bottom{border-bottom:3px solid var(--dark)}
#m4-exam .m4-data-table .m4-mark-left{border-left:3px solid var(--dark)}
#m4-exam .m4-data-table .m4-mark-right{border-right:3px solid var(--dark)}
@media(max-width:520px){#m4-exam .m4-data-table th,#m4-exam .m4-data-table td{padding:.25rem .35rem}}
@media print{#m4-exam .m4-table-frame{overflow:visible}#m4-exam .m4-data-table{font-size:9pt}#m4-exam .m4-data-table tr{break-inside:avoid}#m4-exam .m4-data-table th,#m4-exam .m4-data-table td{padding:.2em .35em;overflow-wrap:anywhere}}
#m4-exam .m4-options{border:0;display:grid;gap:8px;margin:18px 0}
#m4-exam .m4-choice{display:flex;align-items:baseline;gap:10px;background:#fff;border:1px solid var(--line);padding:12px 14px;border-radius:10px;cursor:pointer}
#m4-exam .m4-choice:hover,#m4-exam .m4-choice:has(input:checked){background:var(--soft);border-color:var(--red)}
#m4-exam .m4-choice input{width:1.1em;height:1.1em;flex:none;accent-color:var(--red)}
#m4-exam .m4-score{border-radius:18px;background:#311c23;color:white;padding:28px}
#m4-exam .m4-score .m4-subject{color:#ffbca9}
#m4-exam .m4-scoreline{font-size:clamp(2rem,5vw,3rem);font-weight:bold;margin:5px 0}
#m4-exam .m4-review-list{display:grid;gap:12px;margin-top:12px}
#m4-exam .m4-outcome{font-size:.88rem;font-weight:bold;border-radius:20px;padding:3px 10px}
#m4-exam .is-right{background:#e3f2e8;color:#225434}
#m4-exam .is-wrong,#m4-exam .m4-warning{background:#fff1eb;color:#852b20}
#m4-exam .m4-correct{font-weight:700;color:#225434}
#m4-exam .m4-answer{color:#852b20}
#m4-exam .m4-reviewed-choices{padding-left:1.7em;margin:12px 0}
#m4-exam .m4-reviewed-choices li{padding:3px 0}
#m4-exam .m4-solution-heading{margin:1.1em 0 .4em;font:inherit;font-weight:700}
#m4-exam .m4-solution-steps{margin:.35em 0 1em;padding-inline-start:2.1em;list-style:decimal outside}
#m4-exam .m4-solution-steps li{padding-inline-start:.2em;white-space:pre-wrap;overflow-wrap:anywhere}
#m4-exam .m4-solution-steps li+li{margin-top:.55em}
#m4-exam .m4-solution-steps li::marker{color:var(--dark);font-weight:700}
#m4-exam .m4-solution-caveat{padding:.65em 1em;margin:1em 0;border-inline-start:3px solid #995e29;background:#fff6eb}
#m4-exam .m4-solution-caveat h4{margin:0 0 .25em;font:inherit;font-weight:700}
#m4-exam .m4-solution-caveat p{margin:0}
@media print{#m4-exam .m4-review-list{display:block}#m4-exam .m4-solution-heading{break-after:avoid}#m4-exam .m4-solution-steps li{break-inside:avoid}#m4-exam .m4-solution-steps li::marker{color:#111}}
#m4-exam .m4-label{font-size:.8em;margin-left:8px;padding:1px 6px;border:1px solid currentColor;border-radius:5px}
#m4-exam .m4-status{font-size:.8rem;font-weight:bold;color:#225434}
#m4-exam .m4-empty,#m4-exam .m4-warning{padding:18px;border:1px solid var(--line);border-radius:12px}
#m4-exam .m4-sr{position:absolute;overflow:hidden;clip-path:inset(50%);width:1px;height:1px;white-space:nowrap}
@media(max-width:800px){#m4-exam .m4-layout{grid-template-columns:1fr}#m4-exam .m4-side{position:static}#m4-exam .m4-map{max-height:175px}#m4-exam .m4-hero-inner{grid-template-columns:1fr;gap:20px;padding-block:32px}#m4-exam .m4-totals{max-width:340px}}
@media(max-width:520px){#m4-exam .m4-wrap{width:calc(100% - 28px)}#m4-exam .m4-card,#m4-exam .m4-panel,#m4-exam .m4-side{padding:16px}#m4-exam .m4-search{width:100%}#m4-exam .m4-totals{width:100%}#m4-exam .m4-body{padding-block:22px 45px}#m4-exam .m4-nav{min-height:58px}#m4-exam .m4-worktitle{max-width:100%}}
@media print{.m4-page{background:white}#m4-exam{font-size:10pt;background:#fff}#m4-exam .m4-head,#m4-exam .m4-actions,#m4-exam .m4-select{display:none}#m4-exam .m4-wrap{width:100%;padding:0}#m4-exam .m4-score{color:#000;background:#fff;border:0;padding:0}#m4-exam .m4-score .m4-subject{color:#444}#m4-exam .m4-review{border:0;border-top:1px solid #bbb;border-radius:0;padding:12px 0}#m4-exam .m4-images img{max-height:195mm;object-fit:contain;break-inside:avoid}#m4-exam .m4-review h3{break-after:avoid}}

