*{box-sizing:border-box}body{margin:0;background:linear-gradient(135deg,#fff8fb 0%,#f5fff9 100%);color:#27322e;font-family:Kanit,sans-serif}header{height:70px;padding:0 6%;display:flex;justify-content:space-between;align-items:center;background:#ffffffdf;backdrop-filter:blur(12px);border-bottom:1px solid #dff0e8;position:sticky;top:0;z-index:3}header b{font-size:20px;color:#263d34}header a{color:#d23979;text-decoration:none;font-weight:500}.brand-dot{color:#d83d7d;font-size:17px;margin-right:7px}.hero{max-width:950px;margin:auto;padding:52px 20px 32px}.hero small{color:#278e68;letter-spacing:2px;font-weight:600}.hero h1{font-size:clamp(42px,8vw,68px);line-height:1;margin:12px 0}.hero span{color:#d83d7d}.hero p{color:#6f8279}.card{max-width:950px;margin:auto;background:#fff;border:1px solid #dceee6;border-radius:28px;padding:30px;box-shadow:0 18px 55px #2b6e4d14}label{display:block;margin:14px 0;font-size:14px;font-weight:500}i{color:#d83d7d;font-style:normal}input,select,textarea{width:100%;margin-top:7px;padding:13px 14px;border:1px solid #d9e8e1;border-radius:14px;font:inherit;background:#fff;color:#27322e;outline:none}input:focus,select:focus,textarea:focus{border-color:#53a984;box-shadow:0 0 0 3px #53a98418}textarea{resize:vertical}.grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.title{display:flex;gap:12px;margin:28px 0 14px}.title>b{background:#fff0f6;color:#d83d7d;padding:6px 9px;border-radius:10px;font-size:12px;height:max-content}.title h2{margin:0;font-size:20px}.title p{margin:2px 0;color:#80928a;font-size:12px}.tabs{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.tabs button,.secondary{border:1px solid #dce9e3;border-radius:999px;padding:9px 16px;background:#f5faf7;color:#557268;font:inherit;cursor:pointer}.tabs button.active{background:#d83d7d;color:#fff;border-color:#d83d7d}.searchbox{display:flex;align-items:center;gap:8px;background:#f7fbf9;border:1px solid #dbeae3;border-radius:15px;padding:3px 8px 3px 13px}.searchbox span{font-size:24px;color:#4c9d79}.searchbox input{border:0;box-shadow:none;background:transparent;margin:0;padding:10px 4px}.searchbox button{border:0;background:transparent;color:#9aaba4;font-size:22px;cursor:pointer}.location-list{margin-top:10px;max-height:330px;overflow-y:auto;padding-right:4px}.location-group{margin:12px 2px 7px;color:#278e68;font-size:12px;font-weight:600}.location-option{width:100%;border:1px solid #e1ece7;background:#fff;border-radius:12px;padding:10px 13px;text-align:left;font:inherit;color:#33443d;cursor:pointer;margin:4px 0;display:flex;justify-content:space-between;align-items:center}.location-option:hover{border-color:#8bc8ad;background:#f7fffb}.location-option.selected{border-color:#d83d7d;background:#fff4f8;color:#b72e66;font-weight:600}.location-option.selected:after{content:'✓';color:#d83d7d}.building-unavailable{display:flex;align-items:center;justify-content:space-between;padding:11px 13px;margin:4px 0;border-radius:12px;background:#f2f4f3;color:#9ba6a1;border:1px dashed #d4dcd8}.building-unavailable span:last-child{font-size:11px}.camera-box{border:1px solid #dbeae3;border-radius:18px;background:#f7fbf9;min-height:190px;display:grid;place-items:center;overflow:hidden}.camera-icon{font-size:48px;color:#43a37b;text-align:center}.camera-box strong,.camera-box small{display:block;text-align:center}.camera-box small{color:#83958d;margin-top:4px}.camera{width:100%;max-height:420px;object-fit:cover}.preview{width:100%;max-height:420px;object-fit:contain}.camera-actions{display:flex;gap:9px;margin-top:10px}.camera-btn{border:1px solid #b9dfcd;border-radius:13px;padding:12px 18px;background:#eaf9f1;color:#247b59;font:inherit;font-weight:600;cursor:pointer}.camera-actions .primary,.camera-actions .secondary{border-radius:13px}.camera-hint{font-size:11px;color:#879790}.submit-btn{width:100%;margin-top:14px}.primary{border:0;border-radius:15px;padding:13px 20px;background:linear-gradient(135deg,#d83d7d,#3ca579);color:white;font:inherit;font-weight:600;cursor:pointer}.modal{position:fixed;inset:0;background:#1f302a99;display:grid;place-items:center;padding:20px;z-index:9}.dialog{background:white;border-radius:25px;padding:28px;max-width:520px;width:100%;position:relative}.dialog>#close{position:absolute;right:15px;top:12px;border:0;background:#f2f6f4;border-radius:50%;font-size:22px;cursor:pointer}.dialog pre{white-space:pre-wrap;background:#f6fbf8;padding:15px;border-radius:15px;font:14px Kanit}.dialog>div{display:flex;gap:10px}.dialog .primary,.dialog .secondary{flex:1;border-radius:14px}.hidden{display:none!important}@media(max-width:650px){.grid{grid-template-columns:1fr}.card{margin:0 12px;padding:21px}.hero{padding:40px 20px 25px}.location-list{max-height:300px}}

/* Beautiful report type selector */
.choice-card{padding:32px 28px 28px;overflow:hidden;position:relative}
.choice-head{margin-bottom:22px}
.choice-head>span{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;border-radius:999px;background:#fff1f7;color:#c93272;font-size:12px;font-weight:600;letter-spacing:.3px}
.choice-head h2{font-size:clamp(24px,5vw,34px);line-height:1.25;margin:14px 0 7px;color:#26322e}
.choice-head p{margin:0;color:#7b8b84;font-size:14px}
.choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.choice{position:relative;width:100%;min-height:178px;padding:21px 21px 19px;border:1px solid #dcece5;border-radius:22px;background:linear-gradient(145deg,#fff 0%,#fbfffd 100%);color:#26322e;text-align:left;font:inherit;cursor:pointer;overflow:hidden;transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease}
.choice:before{content:"";position:absolute;left:0;top:0;width:100%;height:5px;background:linear-gradient(90deg,#d83d7d,#47a67d)}
.choice:hover,.choice:focus-visible{transform:translateY(-3px);border-color:#a9d8c4;box-shadow:0 14px 32px #286e4b17;outline:none}
.choice:active{transform:translateY(0)}
.choice-icon{width:49px;height:49px;display:grid;place-items:center;border-radius:15px;background:#fff1f6;font-size:25px;margin-bottom:15px}
.choice:nth-child(2) .choice-icon{background:#eaf9f1}
.choice strong{display:block;font-size:18px;line-height:1.3;margin-bottom:7px;color:#27352f}
.choice small{display:block;color:#71837a;font-size:12px;line-height:1.65;max-width:95%}
.choice em{display:inline-flex;align-items:center;gap:5px;margin-top:15px;font-size:12px;font-style:normal;font-weight:600;color:#d03876}
.choice:nth-child(2) em{color:#28875f}
.choice em:after{content:"→";font-size:16px;transition:transform .18s ease}
.choice:hover em:after{transform:translateX(4px)}
@media(max-width:650px){.choice-card{padding:24px 17px 19px;border-radius:24px}.choice-grid{grid-template-columns:1fr;gap:12px}.choice{min-height:145px;padding:18px 18px 17px;border-radius:19px}.choice-icon{width:43px;height:43px;border-radius:13px;font-size:22px;margin-bottom:11px}.choice strong{font-size:17px}.choice small{font-size:12px;line-height:1.55}.choice em{margin-top:11px}}

/* Student ID first / future Supabase autofill */
.student-id-first{margin-top:8px;margin-bottom:18px}
.student-id-wrap{display:flex;align-items:center;gap:10px;margin-top:8px;padding:4px 14px;border:2px solid #e7d3de;border-radius:17px;background:linear-gradient(135deg,#fff8fb,#f7fffb);transition:.18s ease}
.student-id-wrap:focus-within{border-color:#d83d7d;box-shadow:0 0 0 4px #d83d7d12}
.student-id-wrap span{font-size:20px}
.student-id-wrap input{border:0;margin:0;padding:12px 0;background:transparent;box-shadow:none!important;font-size:16px;font-weight:500}
.student-id-wrap input:focus{outline:none}
.student-status{display:block;margin:7px 3px 0;color:#8a9992;font-size:11px;font-weight:400}
.student-status.success{color:#278e68;font-weight:500}
.student-status.error{color:#c33c69}
.auto-filled{background:#f2fbf6!important;border-color:#bde2d0!important}

/* Refined back-to-type controls */
.form-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:24px;flex-wrap:wrap}
.back-btn{font-family:Kanit,sans-serif!important;appearance:none!important;-webkit-appearance:none;display:inline-flex;align-items:center;gap:9px;border:1px solid #d9e9e1;border-radius:999px;padding:9px 14px;background:linear-gradient(135deg,#ffffff,#f4fbf7);color:#2f6f59;font:500 13px Kanit,sans-serif;line-height:1;cursor:pointer;box-shadow:0 5px 16px rgba(43,110,77,.08);transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease,background .16s ease}
.back-btn span:first-child{width:25px;height:25px;display:grid;place-items:center;border-radius:50%;background:#fff0f6;color:#d23979;font-size:16px;font-weight:600}
.back-btn span:last-child{white-space:nowrap}
.back-btn:hover,.back-btn:focus-visible{transform:translateY(-1px);border-color:#a9d8c4;background:linear-gradient(135deg,#fff7fb,#effaf5);box-shadow:0 8px 20px rgba(43,110,77,.12);outline:none}
.back-btn:active{transform:translateY(0);box-shadow:0 3px 10px rgba(43,110,77,.08)}
.form-top .pill{display:inline-flex;align-items:center;padding:8px 12px;border-radius:999px;background:#eef9f4;color:#27845f;font-size:12px;font-weight:600}

/* Strong mobile-safe back control */
.form-top .back-btn{
  min-height:44px;
  background:linear-gradient(135deg,#fff7fb 0%,#f0fbf6 100%)!important;
  border:1px solid #cfe5db!important;
  color:#2d6955!important;
  box-shadow:0 6px 18px rgba(42,105,80,.10)!important;
  -webkit-tap-highlight-color:transparent;
}
.form-top .back-btn span:first-child{
  flex:0 0 27px;
  background:linear-gradient(135deg,#ffe8f2,#e7f8ef)!important;
}
@media(max-width:650px){
  .form-top .back-btn{width:auto;max-width:100%;justify-content:center;min-height:44px}
}
@media(max-width:650px){.form-top{align-items:flex-start;margin-bottom:20px}.back-btn{padding:8px 12px;font-size:12px}.back-btn span:first-child{width:23px;height:23px;font-size:15px}.form-top .pill{font-size:11px}}


/* Premium grade picker - avoids the plain Android native select */
.grade-select{position:relative;margin-top:7px}
.grade-native{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important;margin:0!important;padding:0!important}
.grade-trigger{width:100%;min-height:54px;padding:0 15px 0 17px;border:1.5px solid #d9e8e1;border-radius:16px;background:linear-gradient(135deg,#fffafd 0%,#f5fcf8 100%);color:#34443d;font:500 15px Kanit,sans-serif;display:flex;align-items:center;justify-content:space-between;cursor:pointer;box-shadow:0 5px 18px rgba(43,110,77,.05);transition:.18s ease}
.grade-trigger span{display:flex;align-items:center;gap:10px}
.grade-trigger span:before{content:'🎓';width:30px;height:30px;border-radius:10px;background:linear-gradient(135deg,#ffe8f2,#e6f8ef);display:grid;place-items:center;font-size:15px}
.grade-trigger b{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:#eef8f3;color:#2f8663;font-size:18px;transition:transform .18s ease}
.grade-select.open .grade-trigger{border-color:#d83d7d;box-shadow:0 0 0 4px rgba(216,61,125,.09),0 10px 24px rgba(43,110,77,.08)}
.grade-select.open .grade-trigger b{transform:rotate(180deg);background:#fff0f6;color:#d23979}
.grade-menu{position:absolute;z-index:20;left:0;right:0;top:calc(100% + 8px);padding:7px;background:#fff;border:1px solid #dcece5;border-radius:18px;box-shadow:0 18px 45px rgba(35,72,59,.16);opacity:0;visibility:hidden;transform:translateY(-5px) scale(.985);transform-origin:top;transition:.16s ease;max-height:290px;overflow:auto}
.grade-select.open .grade-menu{opacity:1;visibility:visible;transform:translateY(0) scale(1)}
.grade-menu button{width:100%;border:0;background:transparent;border-radius:12px;padding:12px 13px;text-align:left;color:#34443d;font:500 15px Kanit,sans-serif;cursor:pointer;display:flex;align-items:center;justify-content:space-between}
.grade-menu button:before{content:'ม.';width:31px;height:31px;border-radius:9px;background:#f4faf7;color:#39866a;display:grid;place-items:center;font-size:11px;font-weight:600;margin-right:9px}
.grade-menu button:hover,.grade-menu button:focus-visible{background:linear-gradient(90deg,#fff0f6,#effaf5);outline:none;color:#bd316b}
.grade-menu button.selected{background:#fff1f7;color:#c92f70;font-weight:600}
.grade-menu button.selected:after{content:'✓';margin-left:auto;color:#d83d7d;font-size:18px}
@media(max-width:650px){.grade-trigger{min-height:56px;border-radius:17px;font-size:16px}.grade-menu{max-height:320px;border-radius:17px}.grade-menu button{padding:13px 12px;font-size:16px}}

/* Entry announcement */
.notice-gate{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;padding:20px;background:linear-gradient(145deg,rgba(19,49,39,.78),rgba(42,76,58,.72));backdrop-filter:blur(9px);-webkit-backdrop-filter:blur(9px)}
.notice-gate.hidden{display:none}
.notice-panel{position:relative;width:min(100%,520px);max-height:90vh;overflow:auto;background:linear-gradient(160deg,#fff 0%,#f5fff8 100%);border:1px solid rgba(255,255,255,.9);border-radius:28px;padding:28px 24px 24px;box-shadow:0 24px 80px rgba(0,0,0,.25);text-align:center}
.notice-mark{width:66px;height:66px;margin:0 auto 14px;border-radius:22px;display:grid;place-items:center;font-size:32px;background:linear-gradient(135deg,#ffe2f0,#dff8e7);box-shadow:0 8px 22px rgba(67,135,94,.12)}
.notice-kicker{font-size:11px;letter-spacing:2px;font-weight:700;color:#bd4c85}
.notice-panel h2{margin:7px 0 8px;color:#244b39;font-size:27px;line-height:1.3}
.notice-lead{margin:0 auto 19px;color:#68776e;font-size:14px;line-height:1.7}
.notice-rules{display:grid;gap:10px;text-align:left;margin:0 0 20px}
.notice-rule{display:flex;gap:12px;align-items:flex-start;padding:13px;border-radius:16px;background:#fff;border:1px solid #e4eee7;color:#46564c;font-size:14px;line-height:1.6}
.notice-rule b{display:block;color:#2d6248;margin-bottom:2px}
.notice-number{flex:0 0 29px;height:29px;border-radius:10px;display:grid;place-items:center;background:#fce5f0;color:#b7467e;font-weight:700}
.notice-warning{margin:0 0 18px;padding:12px 14px;border-radius:14px;background:#fff5e9;color:#95602b;font-size:13px;line-height:1.6}
.notice-accept{width:100%;border:0;border-radius:15px;padding:15px 18px;background:linear-gradient(100deg,#d95b9b,#459b6a);color:#fff;font-family:inherit;font-size:16px;font-weight:600;cursor:pointer;box-shadow:0 8px 18px rgba(86,143,103,.22)}
.notice-accept:active{transform:scale(.985)}
.notice-foot{margin:12px 0 0;color:#91a096;font-size:11px}
@media(max-width:420px){.notice-panel{padding:23px 17px 19px;border-radius:23px}.notice-panel h2{font-size:24px}.notice-rule{font-size:13px}}
