/* CMU Room Booking — iPhone/PWA layer (additive only, overrides nothing structural) */
:root{
  --bkNavy:#1e3a5f;
  --bkSafeTop:env(safe-area-inset-top,0px);
  --bkSafeBottom:env(safe-area-inset-bottom,0px);
  --bkSafeLeft:env(safe-area-inset-left,0px);
  --bkSafeRight:env(safe-area-inset-right,0px);
}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{overscroll-behavior-y:contain;-webkit-tap-highlight-color:rgba(20,104,237,.12)}

/* standalone (Add to Home Screen): เว้นระยะ status bar / home indicator */
@media (display-mode:standalone){
  body{padding-bottom:calc(var(--bkSafeBottom))}
  header{padding-top:var(--bkSafeTop)}
  footer{padding-bottom:calc(20px + var(--bkSafeBottom))}
}
body.bk-standalone{padding-bottom:var(--bkSafeBottom)}
body.bk-standalone header{padding-top:var(--bkSafeTop)}

/* iOS: input < 16px ทำให้ Safari ซูมเองเมื่อโฟกัส */
@media (max-width:700px){
  input,select,textarea{font-size:16px!important;min-height:44px}
  .submit-wrap button{min-height:48px;font-size:16px}
  .book-room{min-height:44px}
  .calendar-nav button{min-width:44px;min-height:44px}
  .cal-day{min-height:96px!important}
  main{padding-left:calc(14px + var(--bkSafeLeft));padding-right:calc(14px + var(--bkSafeRight))}
  header{padding-left:calc(14px + var(--bkSafeLeft));padding-right:calc(14px + var(--bkSafeRight))}
  .hero h1{font-size:25px}
  .calendar-tooltip{position:static!important;width:auto!important;max-width:none!important;display:none!important}
  .tablewrap{-webkit-overflow-scrolling:touch}
  table{font-size:13px}
  th,td{padding:9px 8px}
}

/* touch: ไม่มี hover → ปิด tooltip ลอยที่บังจอ */
@media (hover:none){
  .calendar-tooltip,.calendar-tooltip.is-visible{display:none!important;visibility:hidden!important}
  .cal-event{cursor:pointer}
  .book-room:hover,.calendar-nav button:hover{background:#fff}
}

/* ปุ่มติดตั้ง (แสดงเฉพาะเมื่อยังไม่ติดตั้ง และไม่ถูกปิด) */
.bk-install{position:fixed;left:12px;right:12px;bottom:calc(12px + var(--bkSafeBottom));z-index:2147483000;
  display:none;gap:12px;align-items:center;background:#fff;border:1px solid #dbe3ef;border-radius:14px;
  box-shadow:0 10px 28px rgba(16,32,64,.18);padding:12px 14px;font-size:13px;line-height:1.45;color:#24344e}
.bk-install.show{display:flex}
.bk-install .bk-ico{flex:0 0 40px;width:40px;height:40px;border-radius:9px;background:var(--bkNavy);
  display:grid;place-items:center;color:#fff;font-size:19px}
.bk-install b{display:block;font-size:14px;color:#101e3b;margin-bottom:1px}
.bk-install small{color:#5f6d82}
.bk-install .bk-x{border:0;background:#eef3fa;color:#33456b;border-radius:8px;width:32px;height:32px;font-size:16px;cursor:pointer}
@media (display-mode:standalone){.bk-install{display:none!important}}
