:root{--bg:#f5f7fb;--card:#fff;--text:#172033;--muted:#667085;--line:#e7eaf0;--brand:#2563eb;--brand2:#0ea5e9;--red:#ef4444;--green:#16a34a;--amber:#f59e0b}*{box-sizing:border-box}body{margin:0;font-family:Inter,Segoe UI,Arial,sans-serif;background:linear-gradient(135deg,#eef5ff,#f9fafb);color:var(--text)}a{color:inherit;text-decoration:none}.top{position:sticky;top:0;z-index:9;display:flex;justify-content:space-between;align-items:center;padding:14px 22px;background:rgba(255,255,255,.85);backdrop-filter:blur(12px);border-bottom:1px solid var(--line);box-shadow:0 8px 30px rgba(15,23,42,.05)}.brand{display:flex;gap:10px;align-items:center;font-weight:800}.brand:before{content:'✓';display:grid;place-items:center;width:34px;height:34px;border-radius:12px;background:linear-gradient(135deg,var(--brand),var(--brand2));color:white}.wrap{max-width:1180px;margin:auto;padding:22px}.navline{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px}.card{background:rgba(255,255,255,.95);border:1px solid var(--line);border-radius:22px;padding:20px;margin:16px 0;box-shadow:0 14px 40px rgba(15,23,42,.07)}.hero{display:grid;grid-template-columns:1.4fr .8fr;gap:18px;align-items:center}.hero h1,.card h2{margin-top:0}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.stat{border-radius:18px;padding:16px;background:linear-gradient(135deg,#fff,#eff6ff);border:1px solid var(--line)}.stat b{font-size:28px}label{display:block;margin:12px 0 6px;font-weight:700}input,select,textarea{width:100%;border:1px solid #d8dee9;border-radius:14px;padding:11px 12px;background:white;font:inherit}textarea{min-height:110px}.btn,button{display:inline-flex;align-items:center;gap:8px;border:0;border-radius:14px;padding:10px 14px;background:linear-gradient(135deg,var(--brand),var(--brand2));color:white;font-weight:700;cursor:pointer;margin:3px}.btn.gray{background:#eef2f7;color:#344054}.btn.red{background:var(--red)}.btn.green{background:var(--green)}table{width:100%;border-collapse:collapse;overflow:hidden;border-radius:16px}th,td{padding:12px;border-bottom:1px solid var(--line);vertical-align:top}th{background:#f8fafc;text-align:left;color:#344054}.imgq{max-width:220px;border-radius:16px;border:1px solid var(--line)}.badge{display:inline-block;padding:5px 10px;border-radius:999px;background:#eaf1ff;color:#1d4ed8;font-weight:800}.timer{position:sticky;top:72px;z-index:8;background:#111827;color:white;border-radius:18px;padding:14px 18px;display:flex;justify-content:space-between;align-items:center;box-shadow:0 16px 32px rgba(0,0,0,.15)}.timer b{font-size:22px}.sheetWrap{overflow:auto;border:1px solid var(--line);border-radius:16px;background:white}.sheet{border-collapse:collapse;min-width:720px}.sheet th{position:sticky;top:0;background:#eef2ff;text-align:center}.sheet td,.sheet th{border:1px solid #d7dce7;padding:0}.sheet input{border:0;border-radius:0;padding:8px;min-width:95px;background:white}.sheet input:focus{outline:2px solid var(--brand);position:relative;z-index:2}.loginbox{max-width:420px;margin:8vh auto}.questionNav{display:flex;flex-wrap:wrap;gap:6px}.questionNav a{width:36px;height:36px;display:grid;place-items:center;border-radius:12px;background:#eef2f7}.questionNav a.done{background:#dcfce7;color:#166534}.rank1{font-weight:900;color:#ca8a04}@media(max-width:800px){.wrap{padding:12px}.hero,.grid,.stats{grid-template-columns:1fr}.top{align-items:flex-start;gap:8px;flex-direction:column}.card{border-radius:16px;padding:14px}table{display:block;overflow-x:auto}.timer{top:105px;align-items:flex-start;gap:6px;flex-direction:column}.btn,button{width:100%;justify-content:center}.navline .btn{width:auto}}
/* Patch: spreadsheet auto width */
.sheetWrap{overflow:auto;max-width:100%;padding-bottom:8px}.sheet.autoWidthSheet{table-layout:auto;width:max-content;min-width:100%;border-collapse:collapse}.sheet.autoWidthSheet td{width:auto;min-width:74px}.sheet.autoWidthSheet input{min-width:72px;width:auto;box-sizing:border-box;transition:width .12s ease;background:#fff}.statusBox{border-left:5px solid #16a34a;background:#f0fdf4}.statusBox h2{color:#166534}.actions{display:flex;gap:8px;flex-wrap:wrap}.btn.small{padding:6px 10px;font-size:13px}

/* Responsive question image + zoom */
.imgq{display:block;width:auto;max-width:min(100%,920px);max-height:72vh;object-fit:contain;margin:12px 0;border-radius:18px;border:1px solid var(--line);box-shadow:0 10px 28px rgba(15,23,42,.12);cursor:zoom-in;transition:transform .18s ease, box-shadow .18s ease}.imgq:hover{transform:scale(1.035);box-shadow:0 18px 45px rgba(15,23,42,.18)}table .imgq{max-width:min(100%,420px);max-height:320px}.imageZoomOverlay{position:fixed;inset:0;z-index:9999;background:rgba(15,23,42,.86);display:none;align-items:center;justify-content:center;padding:18px}.imageZoomOverlay.active{display:flex}.imageZoomOverlay img{max-width:96vw;max-height:92vh;object-fit:contain;border-radius:18px;background:white;box-shadow:0 24px 80px rgba(0,0,0,.38);cursor:zoom-out}.imageZoomClose{position:fixed;top:14px;right:14px;border:0;border-radius:999px;width:44px;height:44px;background:white;color:#111827;font-size:24px;font-weight:900;line-height:1;display:grid;place-items:center;cursor:pointer}.imageZoomHint{position:fixed;left:50%;bottom:14px;transform:translateX(-50%);background:rgba(255,255,255,.95);color:#111827;border-radius:999px;padding:9px 14px;font-size:13px;font-weight:700}@media(max-width:800px){.imgq{width:100%;max-width:100%;max-height:60vh;border-radius:14px;margin:10px 0}.imgq:hover{transform:none}.imageZoomOverlay{padding:8px}.imageZoomOverlay img{max-width:100vw;max-height:88vh;border-radius:12px}.imageZoomHint{width:calc(100% - 24px);text-align:center;border-radius:14px}.imageZoomClose{top:10px;right:10px}}

/* Spreadsheet professional mode */
.notice{background:#eef6ff;border:1px solid #bfdbfe;border-radius:14px;padding:12px;margin:10px 0;color:#1e3a8a}
.readonlyCell{background:#f8fafc;color:#334155}
.sheetWrap{max-width:100%;overflow:auto}
