:root{font-family:Arial,Noto Sans Thai,sans-serif;color:#172033;background:#f4f7fb}*{box-sizing:border-box}body{margin:0}button,input,textarea{font:inherit}.shell{max-width:1500px;margin:auto;padding:22px}.top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px}.title{font-size:28px;font-weight:800}.nav{display:flex;align-items:center;gap:8px}.ghost,.nav button,.primary{border:0;border-radius:10px;padding:10px 14px;cursor:pointer}.primary{background:#2367e8;color:white}.ghost,.nav button{background:white;border:1px solid #dce3ee}.month{font-size:22px;font-weight:700;min-width:190px;text-align:center}.week{display:grid;grid-template-columns:repeat(7,minmax(155px,1fr));min-width:1085px}.weekday{padding:10px;text-align:center;font-weight:700;color:#667085}.grid{display:grid;grid-template-columns:repeat(7,minmax(155px,1fr));min-width:1085px;border-left:1px solid #dce3ee;border-top:1px solid #dce3ee}.scroller{overflow:auto;background:white;border-radius:14px;box-shadow:0 4px 22px #18223012}.cell{min-height:170px;padding:9px;border-right:1px solid #dce3ee;border-bottom:1px solid #dce3ee;cursor:pointer;background:#fff}.cell.out{background:#f8fafc;color:#98a2b3}.cell.weekend{background:#ffd6d6}.cell.weekend.out{background:#fbe6e6}.cell.off{background:#ffbdbd}.cell.off.out{background:#f8dcdc}.cell.off .day,.cell.weekend .day{color:#b42318}.cell.today .day{background:#2367e8;color:white}.day{width:31px;height:31px;border-radius:50%;display:grid;place-items:center;font-weight:800;margin-bottom:6px}.event{padding:7px 8px;margin:5px 0;border-radius:8px;background:#eaf2ff;font-size:13px;line-height:1.25;overflow:hidden}.event b{margin-right:5px}.event:hover{outline:2px solid #9bbcff}.modalback{position:fixed;inset:0;background:#11182766;display:grid;place-items:center;padding:18px;z-index:10}.modal{background:white;border-radius:16px;padding:20px;width:min(480px,100%);box-shadow:0 24px 70px #0003}.modal h2{margin:0 0 16px}.row{display:grid;grid-template-columns:1fr 1fr;grid-gap:10px;gap:10px}label{display:block;font-size:13px;font-weight:700;margin:10px 0 5px}input,textarea{width:100%;border:1px solid #d0d5dd;border-radius:9px;padding:10px}.actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}.danger{margin-right:auto;color:#b42318}.hint{font-size:12px;color:#667085;margin-top:6px}@media(max-width:700px){body{overflow-x:hidden}.shell{padding:10px}.title{font-size:22px}.top{align-items:stretch;flex-direction:column}.nav{flex-wrap:wrap;justify-content:center}.month{min-width:0;flex:1 1;font-size:19px}.scroller{overflow:hidden;touch-action:pan-y}.grid,.week{grid-template-columns:repeat(7,minmax(0,1fr));min-width:0}.weekday{padding:8px 0;font-size:13px}.cell{min-height:78px;padding:3px;overflow:hidden}.day{width:24px;height:24px;font-size:13px;margin:0 auto 3px}.event{font-size:10px;padding:2px 3px;margin:2px 0;white-space:nowrap;text-overflow:ellipsis;border-left-width:3px}.event b,.event div{display:none}.legend{font-size:12px}}.quick{display:flex;gap:8px;margin:12px 0}.quick input{flex:1 1}.cat-ประชุม{background:#eaf2ff;border-left:4px solid #2367e8}.cat-ตรวจงาน{background:#eaf8ef;border-left:4px solid #25a55f}.cat-ซ่อมบำรุง{background:#fff3df;border-left:4px solid #e99a24}.cat-อบรม{background:#f3eaff;border-left:4px solid #8b5cf6}.cat-ส่วนตัว{background:#ffecec;border-left:4px solid #e5484d}.legend{display:flex;gap:12px;flex-wrap:wrap;margin:12px 2px;font-size:13px;color:#667085}.cat-วันลา,.cat-วันหยุดราชการ{background:#e5484d;color:white;font-weight:700;border-left:4px solid #9f1d22}.offbtn{color:#b42318;border-color:#f3b5b5}.typechips{display:flex;gap:6px;margin:-6px 0 6px;flex-wrap:wrap}.typechips button{border:1px solid #dce3ee;background:white;border-radius:999px;padding:6px 12px;cursor:pointer}.typechips button.on{background:#2367e8;color:white;border-color:#2367e8}.modal.hm{width:min(440px,100%);max-height:92vh;overflow:auto}.hm-nav{display:flex;align-items:center;justify-content:space-between;margin:-4px 0 4px}.hm-nav b{font-size:18px}.hm-nav button{border:1px solid #dce3ee;background:white;border-radius:10px;padding:6px 14px;font-size:18px;cursor:pointer}.hm-grid{display:grid;grid-template-columns:repeat(7,1fr);grid-gap:5px;gap:5px;margin:10px 0}.hm-wd{text-align:center;font-size:12px;font-weight:700;color:#667085}.hm-wd.we{color:#b42318}.hm-day{aspect-ratio:1;border:1px solid #e4e7ec;background:white;border-radius:10px;font-weight:700;font-size:15px;cursor:pointer}.hm-day.we{background:#ffd6d6;color:#b42318;border-color:#ffd6d6}.hm-day.on{background:#e5484d;color:white;border-color:#b42318}.hm-day.locked{opacity:.75;outline:2px dashed #9f1d22}.hm-list{flex-direction:column;margin-top:6px}.hm-item,.hm-list{display:flex;gap:6px}.hm-item{align-items:center}.hm-date{min-width:64px;font-weight:700;color:#b42318;font-size:14px}.hm-item input{padding:8px}.hm-item .ghost{padding:8px 10px}.primary:disabled{opacity:.5;cursor:default}.modal{max-height:calc(100dvh - 36px);overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}.modal .actions{position:-webkit-sticky;position:sticky;bottom:-20px;background:white;padding:12px 0 20px;margin-bottom:-20px;z-index:1}@media(max-width:700px){.scroller{overflow-x:auto;overflow-y:hidden;touch-action:auto;display:flex;flex-direction:column;height:calc(100dvh - 20px);-webkit-overflow-scrolling:touch}.grid,.week{grid-template-columns:repeat(7,minmax(105px,1fr));min-width:735px}.week{flex:none}.grid{flex:1 1;grid-template-rows:repeat(6,minmax(0,1fr))}.cell{min-height:0;padding:4px;overflow:hidden}.event{font-size:11px;padding:3px 4px}.event b{display:inline}}.nav .primary{background:#2367e8;color:white;border-color:#2367e8}.event{white-space:normal;word-break:break-word;overflow-wrap:anywhere}@media(max-width:700px){.event{white-space:normal;text-overflow:clip;line-height:1.3}.event b{display:block}.cell{overflow-y:auto}}.cell{position:relative}.shift{position:absolute;right:4px;bottom:4px;min-width:26px;height:24px;padding:0 6px;border-radius:7px;background:#0f766e;color:white;font-weight:800;font-size:14px;display:grid;place-items:center;z-index:1;box-shadow:0 1px 3px #0003;letter-spacing:1px}.cell:has(.shift){padding-bottom:30px}.shiftpick{display:flex;gap:8px;align-items:center}.shiftpick button{width:52px;height:46px;border-radius:10px;border:1px solid #0f766e;background:#ecfdf5;color:#0f766e;font-size:20px;font-weight:800;cursor:pointer}.shiftpick button:disabled{opacity:.4;cursor:default}.shiftpick .ghost{width:auto;font-size:14px;border-color:#dce3ee;background:white;color:inherit;margin-left:auto}.shiftval{min-width:60px;text-align:center;font-size:24px;font-weight:800;color:#0f766e}.hdr{position:relative;background:#fff;border-radius:18px;box-shadow:0 4px 18px rgba(20,40,80,.08);padding:10px 14px;margin-bottom:12px}.hdr-row{gap:10px}.hdr-date,.hdr-row{display:flex;align-items:center}.hdr-date{width:42px;height:42px;flex:none;border:1px solid #e3e8f0;border-radius:12px;background:#fff;font-size:18px;font-weight:800;color:#1e293b;cursor:pointer;justify-content:center;position:relative;padding:0}.hdr-date:after{content:"";position:absolute;left:11px;right:11px;bottom:7px;height:3px;border-radius:2px;background:#2367e8}.hdr-title{font-size:22px;font-weight:800;flex:1 1}.hdr-actions{display:flex;align-items:center;gap:8px}.hdr-add{border:0;border-radius:12px;background:#2367e8;color:#fff;font-size:26px;line-height:1;box-shadow:0 3px 10px rgba(35,103,232,.35)}.hdr-add,.hdr-gear{width:40px;height:40px;cursor:pointer;padding:0}.hdr-gear{border:1px solid #e3e8f0;border-radius:12px;background:#fff;font-size:20px;color:#475569}.hdr-month{justify-content:center;margin-top:6px}.hdr-month .month{font-size:24px;font-weight:800;min-width:0;padding:0 6px}.hdr-arrow{width:36px;height:36px;border:0;border-radius:50%;background:#f1f5fb;font-size:22px;color:#2367e8;cursor:pointer;padding:0;line-height:1}.set-back{position:fixed;inset:0;z-index:40}.set-menu{position:absolute;right:14px;top:58px;z-index:41;background:#fff;border-radius:14px;box-shadow:0 10px 30px rgba(20,40,80,.18);padding:8px;min-width:230px;display:flex;flex-direction:column;gap:4px}.set-item{padding:8px 10px;border-radius:10px}.set-item span{display:flex;flex-wrap:wrap;gap:6px;align-items:center}.set-item span button{margin-left:0!important}.set-link{display:block;text-align:left;border:0;background:none;font-size:15px;color:inherit;text-decoration:none;cursor:pointer}.set-link:hover{background:#f1f5fb}@media(max-width:700px){.hdr{padding:8px 10px;border-radius:16px;margin-bottom:8px}.hdr-title{font-size:20px}.hdr-month .month{font-size:21px}.hdr-month{margin-top:4px}}.set-menu .set-link{font-size:16px;padding:10px 14px}@media (orientation:landscape) and (min-width:701px) and (pointer:coarse){.shell{height:100dvh;display:flex;flex-direction:column;padding:12px 16px;max-width:none}.hdr,.legend{flex:none}.legend{font-size:13px;margin:0 0 8px}.scroller{flex:1 1;min-height:0;display:flex;flex-direction:column;overflow:hidden}.grid,.week{grid-template-columns:repeat(7,minmax(0,1fr));min-width:0}.week{flex:none}.weekday{padding:6px}.grid{flex:1 1;grid-template-rows:repeat(6,minmax(0,1fr))}.cell,.grid{min-height:0}.cell{padding:5px 6px;overflow-y:auto}.day{width:28px;height:28px;margin-bottom:3px}.event{padding:4px 6px;margin:3px 0;font-size:13px}}@media(max-width:700px){.scroller .grid{min-height:0}}