:root{--blue:#0868f9;--darkblue:#003da8;--bg:#f5f8fd;--surface:#fff;--ink:#111827;--muted:#64748b;--border:#e8edf5;--cyan:#17c5f8;--radius:20px;--shadow:0 4px 18px rgba(15,23,42,.045)}*{box-sizing:border-box}body{margin:0;background:var(--bg);font:14px/1.65 Prompt,system-ui,sans-serif;color:var(--ink)}button,input,select{font:inherit}button{cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}.app{display:flex;min-height:100vh}.sidebar{width:258px;background:#fff;border-right:1px solid var(--border);padding:24px 14px;position:sticky;top:0;height:100vh;overflow-y:auto;flex-shrink:0}.brand{padding:5px 12px 22px;font-size:24px;font-weight:800;letter-spacing:-1px;color:#061a44}.brand span{color:var(--blue)}.brand small{display:block;color:var(--muted);font-size:11px;font-weight:500;letter-spacing:0;margin-top:-4px}.navlabel{font-size:11px;text-transform:uppercase;color:#94a3b8;margin:18px 12px 6px;font-weight:700}.nav{width:100%;border:0;background:transparent;display:flex;align-items:center;gap:11px;padding:11px 13px;border-radius:14px;text-align:left;color:#475569;font-weight:600;margin:3px 0}.nav:hover{background:#f1f6ff}.nav.active{background:#eaf2ff;color:var(--blue)}.nav .symbol{font-size:18px;width:22px;text-align:center}.content{flex:1;min-width:0;padding:24px 32px 58px;max-width:1600px;margin:auto}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px;gap:12px}.topbar .eyebrow{font-size:12px;color:var(--muted)}h1{font-size:26px;margin:0;font-weight:800;line-height:1.4;letter-spacing:-.5px}h2{font-size:18px;margin:0 0 14px;font-weight:700}h3{font-size:15px;margin:0 0 8px}.muted{color:var(--muted)}.topright{display:flex;align-items:center;gap:10px}.avatar{background:#eaf2ff;border-radius:50%;width:40px;height:40px;display:grid;place-items:center;font-weight:800;color:var(--blue)}.chip{border:1px solid #dbe8ff;background:#f3f7ff;color:#135abe;border-radius:999px;padding:6px 12px;font-size:12px;font-weight:600}.btn{border:0;background:var(--blue);color:#fff;border-radius:999px;padding:11px 20px;font-weight:700;box-shadow:0 5px 14px rgba(8,104,249,.15)}.btn:hover{background:#0758d2}.btn.secondary{background:#edf4ff;color:var(--blue);box-shadow:none}.btn.ghost{background:#fff;border:1px solid var(--border);color:#334155;box-shadow:none}.btn.small{padding:7px 13px;font-size:12px}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:20px;box-shadow:var(--shadow)}.grid{display:grid;gap:16px}.grid.four{grid-template-columns:repeat(4,minmax(0,1fr))}.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.hero{background:linear-gradient(117deg,#052764,#0758d8 60%,#159bfa);color:#fff;border-radius:24px;padding:34px;display:flex;justify-content:space-between;align-items:center;gap:20px;overflow:hidden;position:relative}.hero::after{content:"";position:absolute;width:240px;height:240px;background:#fff1;border-radius:50%;right:-40px;top:-90px}.hero h2{font-size:27px;line-height:1.5;margin:4px 0 12px}.hero p{opacity:.85;margin:0 0 20px}.hero .btn{background:#fff;color:var(--blue)}.hero-icon{font-size:105px;z-index:1}.section{margin-top:24px}.stat-icon{background:#eaf2ff;color:var(--blue);display:grid;place-items:center;width:43px;height:43px;border-radius:15px;font-size:21px;margin-bottom:12px}.stat-number{font-weight:800;font-size:28px;line-height:1.2;color:#0c4cba}.card p{margin:4px 0}.flex{display:flex;gap:12px;align-items:center}.between{justify-content:space-between}.label{font-size:12px;color:var(--muted)}.progress{height:9px;background:#edf3ff;border-radius:99px;overflow:hidden;margin-top:8px}.progress b{display:block;height:100%;background:linear-gradient(90deg,#0868f9,#19b9f2);border-radius:inherit}.subject{margin-bottom:17px}.subject:last-child{margin-bottom:0}.subject .flex{justify-content:space-between}.mode{cursor:pointer;transition:.2s}.mode:hover{transform:translateY(-3px);border-color:#b9d4ff}.mode-icon{width:51px;height:51px;background:#eaf2ff;border-radius:16px;display:grid;place-items:center;font-size:26px;margin-bottom:12px}.mode h3{font-size:17px}.mode p{font-size:12px;color:var(--muted);min-height:40px}.mode .link{font-weight:700;color:var(--blue);margin-top:14px;display:block}.course{display:flex;gap:15px;align-items:center}.course-icon{font-size:31px;background:#eff6ff;border-radius:16px;width:63px;height:63px;display:grid;place-items:center}.course .btn{margin-left:auto}.rows{display:grid;gap:10px}.rowitem{padding:13px 15px;border:1px solid var(--border);border-radius:14px;display:flex;align-items:center;justify-content:space-between;gap:12px}.bar-plot{height:180px;display:flex;gap:10px;align-items:end;padding-top:16px}.bar-group{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:end;gap:6px;height:100%;font-size:11px;color:var(--muted)}.bar{width:100%;max-width:48px;min-height:4px;background:linear-gradient(#13b8fa,#0868f9);border-radius:8px 8px 3px 3px}.field{display:grid;gap:6px;font-size:12px;font-weight:600;color:#334155}.field input,.field select,.search{border:1px solid #e3eaf5;border-radius:14px;padding:11px 13px;background:#fbfdff;width:100%;outline:none}.field input:focus,.field select:focus,.search:focus{border-color:#0868f9}.formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}.exam-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:18px}.timer{font-size:20px;font-weight:800;color:var(--blue);background:#eaf2ff;border-radius:14px;padding:8px 15px;font-variant-numeric:tabular-nums}.answer{display:block;width:100%;padding:14px 16px;margin:10px 0;border:1px solid #e2e9f5;background:#fff;border-radius:13px;text-align:left}.answer:hover{background:#f4f8ff}.answer.selected{border-color:var(--blue);background:#eaf3ff;color:#074fbe;font-weight:600}.answer.correct{background:#e7f9ef;border-color:#50c98d}.answer.wrong{background:#fff0f0;border-color:#f4a5a5}.qnums{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.qnum{border:1px solid #e4eaf2;border-radius:10px;background:#fff;padding:8px}.qnum.active{background:var(--blue);color:white}.qnum.done{background:#d8ebff;border-color:#bad9ff}.notice{border-radius:15px;padding:13px 16px;background:#eef6ff;color:#1b529f}.hidden{display:none!important}.tablewrap{overflow:auto}table{border-collapse:collapse;width:100%;min-width:580px}th,td{padding:13px 10px;border-bottom:1px solid #edf0f5;text-align:left}th{font-size:12px;color:#64748b;font-weight:600}td{font-size:13px}.status{display:inline-block;border-radius:99px;padding:4px 9px;background:#e7f9ee;color:#15803d;font-size:11px}.status.gray{background:#f1f5f9;color:#64748b}.taglist{display:flex;flex-wrap:wrap;gap:8px}.tag{padding:7px 11px;background:#eff5ff;color:#0b59cf;border-radius:10px;font-size:12px;font-weight:600}.mobilebar{display:none}.question-label{color:#0868f9;font-size:12px;font-weight:700}.empty{padding:25px;text-align:center;color:var(--muted)}.notification{font-size:12px;background:#ecfdf5;color:#047857;padding:10px;border-radius:12px;margin-top:12px}.seg{display:flex;gap:8px;flex-wrap:wrap}.seg button{background:#fff;border:1px solid #dae5f4;border-radius:999px;padding:8px 13px;color:#475569}.seg button.active{background:#0868f9;border-color:#0868f9;color:#fff}.faq details{border:1px solid var(--border);border-radius:14px;padding:14px 16px;margin:10px 0;background:white}.faq summary{cursor:pointer;font-weight:600}.loginpanel{max-width:540px;margin:30px auto}.footer{text-align:center;margin-top:36px;color:#94a3b8;font-size:11px}@media(max-width:1100px){.grid.four{grid-template-columns:repeat(2,1fr)}.grid.three{grid-template-columns:repeat(2,1fr)}.content{padding:20px}.sidebar{width:215px}.hero-icon{font-size:70px}}@media(max-width:740px){.exam-layout{grid-template-columns:1fr!important}.sidebar{display:none}.content{padding:16px 16px 100px}.grid.four,.grid.three,.grid.two,.formgrid{grid-template-columns:1fr}.hero{padding:22px}.hero h2{font-size:20px}.hero-icon{font-size:55px}.topbar{align-items:start}.topright .chip{display:none}h1{font-size:22px}.mobilebar{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:10;background:white;border-top:1px solid var(--border);padding:8px 4px max(8px,env(safe-area-inset-bottom));justify-content:space-around;box-shadow:0 -7px 20px #0c2b5b0c}.mobilebar button{border:0;background:none;color:#64748b;font-size:10px;display:grid;place-items:center;gap:2px}.mobilebar button span{font-size:20px}.mobilebar button.active{color:var(--blue)}.course{flex-wrap:wrap}.course .btn{margin-left:0}.hero::after{width:110px;height:110px}.exam-head{flex-wrap:wrap}}

/* ===== เพิ่มเติมสำหรับระบบจริง ===== */
.qnums{grid-template-columns:repeat(auto-fill,minmax(40px,1fr));max-height:340px;overflow:auto;padding:2px}
.qnum.flag{outline:2px solid #f59e0b;outline-offset:-2px}
.qimg{max-width:100%;max-height:420px;border-radius:12px;border:1px solid var(--border);margin:8px 0;display:block}
.answer img{max-width:100%;max-height:220px;border-radius:8px;display:block;margin-top:6px}
.qtext{white-space:pre-line;font-size:17px;font-weight:600;line-height:1.75;margin:24px 0 14px}
.timer.warn{background:#fff4e5;color:#c2410c}.timer.danger{background:#fee2e2;color:#b91c1c;animation:pulse 1s infinite}
@keyframes pulse{50%{opacity:.6}}
.lock{display:inline-flex;align-items:center;gap:4px;font-size:11px;font-weight:700;color:#b45309;background:#fff7e6;border-radius:99px;padding:3px 9px}
.free{display:inline-flex;font-size:11px;font-weight:700;color:#047857;background:#e7f9ee;border-radius:99px;padding:3px 9px}
.setcard{cursor:pointer;transition:.2s;text-align:left;width:100%;font:inherit}.setcard:hover{transform:translateY(-2px);border-color:#b9d4ff}
.setcard.is-locked{opacity:.75}
.modal-bg{position:fixed;inset:0;background:#0b1b3a66;display:grid;place-items:center;z-index:50;padding:16px}
.modal{background:#fff;border-radius:22px;max-width:560px;width:100%;max-height:90vh;overflow:auto;padding:24px;box-shadow:0 20px 60px #0b1b3a33}
.modal.wide{max-width:860px}
.toast{position:fixed;left:50%;bottom:90px;transform:translateX(-50%);background:#0f172a;color:#fff;padding:11px 18px;border-radius:12px;z-index:60;font-size:13px;box-shadow:0 8px 24px #0003;max-width:90vw}
.toast.err{background:#b91c1c}
.login-wrap{min-height:100vh;display:grid;place-items:center;padding:16px;background:linear-gradient(160deg,#eaf2ff,#f5f8fd 50%)}
.login-card{max-width:420px;width:100%;text-align:center;padding:36px 28px}
.gbtn{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;border:1px solid #dadce0;background:#fff;border-radius:999px;padding:12px;font-weight:600;color:#1f2937}
.gbtn:hover{background:#f8fafc}
.spinner{width:34px;height:34px;border:4px solid #dbe8ff;border-top-color:var(--blue);border-radius:50%;animation:spin 1s linear infinite;margin:40px auto}
@keyframes spin{to{transform:rotate(360deg)}}
.badge-premium{background:linear-gradient(90deg,#f6c445,#f59e0b);color:#422006;border-radius:99px;padding:4px 10px;font-size:11px;font-weight:800}
.pill{display:inline-block;border-radius:99px;padding:3px 9px;font-size:11px;font-weight:600;background:#f1f5f9;color:#475569}
.pill.ok{background:#e7f9ef;color:#15803d}.pill.bad{background:#fee2e2;color:#b91c1c}.pill.blue{background:#eaf2ff;color:#0b59cf}
.review-q{border:1px solid var(--border);border-radius:16px;padding:16px;margin-bottom:12px;background:#fff}
.review-q .answer{cursor:default}
.answer .mark{float:right;font-weight:700}
.field textarea{border:1px solid #e3eaf5;border-radius:14px;padding:11px 13px;background:#fbfdff;width:100%;min-height:80px;font:inherit;resize:vertical}
.check{display:flex;gap:8px;align-items:center;font-size:13px;font-weight:600;color:#334155}
.actions{display:flex;gap:6px;flex-wrap:wrap}
.btn.danger{background:#fee2e2;color:#b91c1c;box-shadow:none}
.pager{display:flex;gap:8px;align-items:center;justify-content:flex-end;margin-top:12px}
.filters{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}.filters>*{flex:1;min-width:150px}
.filters select{border:1px solid #e3eaf5;border-radius:14px;padding:11px 13px;background:#fbfdff}
td img{max-height:40px;border-radius:6px}
.nav .count{margin-left:auto;font-size:11px;background:#eaf2ff;color:var(--blue);border-radius:99px;padding:1px 8px}
.sidebar .me{display:flex;gap:10px;align-items:center;padding:12px;border-radius:14px;background:#f8fbff;margin-top:20px}
.sidebar .me img,.avatar img{width:100%;height:100%;border-radius:50%;object-fit:cover}
.sidebar .me .avatar{flex-shrink:0;overflow:hidden}
.trend{display:flex;align-items:flex-end;gap:6px;height:150px;padding-top:10px}
.trend div{flex:1;background:linear-gradient(#13b8fa,#0868f9);border-radius:6px 6px 2px 2px;min-height:3px;position:relative}
.trend div span{position:absolute;top:-18px;left:50%;transform:translateX(-50%);font-size:10px;color:var(--muted)}
.result-hero{text-align:center;padding:26px 10px}
.result-hero .big{font-size:56px;font-weight:800;color:#0c4cba;line-height:1.1}
@media(max-width:740px){.qtext{font-size:15px}.toast{bottom:84px}.modal{padding:18px}}
