/* Château La Châteline · PWA Professional Runtime v20.006
   Loaded LAST. This file deliberately owns mobile viewport, scrolling,
   safe-area and touch behaviour so older accumulated PWA rules cannot
   lock the document or hide controls on Android/iOS. */
:root{
  --pwa-viewport-height:100dvh;
  --pwa-safe-top:env(safe-area-inset-top,0px);
  --pwa-safe-right:env(safe-area-inset-right,0px);
  --pwa-safe-bottom:env(safe-area-inset-bottom,0px);
  --pwa-safe-left:env(safe-area-inset-left,0px);
  --pwa-nav-height:74px;
  --pwa-header-height:68px;
  --pwa-surface:#f7faf8;
  --pwa-card:#fff;
  --pwa-line:#dbe5df;
  --pwa-ink:#172b24;
  --pwa-muted:#697a72;
  --pwa-brand:var(--green,#0f5136);
  --pwa-accent:#c59a62;
  --pwa-shadow:0 12px 34px rgba(17,55,42,.075);
}

/* ---------- hard scroll recovery ---------- */
html{min-height:100%;height:auto;max-width:100%;overflow-x:hidden;scroll-behavior:smooth;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body.pwa-body:not(.chat-screen-active){
  position:static!important;inset:auto!important;width:100%!important;height:auto!important;min-height:100dvh!important;max-height:none!important;
  overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior-x:none!important;overscroll-behavior-y:auto!important;
  touch-action:pan-x pan-y pinch-zoom!important;-webkit-overflow-scrolling:touch!important;background:#eaf0ed!important
}
body.pwa-body:not(.chat-screen-active) .mobile-shell,
body.pwa-body:not(.chat-screen-active) .guest-hub{
  position:relative!important;inset:auto!important;height:auto!important;min-height:100dvh!important;max-height:none!important;
  overflow:visible!important;overscroll-behavior:initial!important;touch-action:auto!important
}
body.pwa-body:not(.chat-screen-active) .mobile-body,
body.pwa-body:not(.chat-screen-active) .guest-hub-main{
  position:relative!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;touch-action:auto!important
}
body.pwa-body:not(.chat-screen-active) .mobile-body{padding-bottom:calc(var(--pwa-nav-height) + var(--pwa-safe-bottom) + 26px)!important}
body.pwa-body:not(.chat-screen-active) .guest-hub-main{padding-bottom:calc(var(--pwa-nav-height) + var(--pwa-safe-bottom) + 36px)!important}

/* Avoid a child accidentally becoming a page-wide touch blocker. */
body.pwa-body:not(.chat-screen-active) .card,
body.pwa-body:not(.chat-screen-active) .list-card,
body.pwa-body:not(.chat-screen-active) .hero-card,
body.pwa-body:not(.chat-screen-active) .guest-section{touch-action:auto}

/* ---------- shell / visual quality ---------- */
.pwa-body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:var(--pwa-ink)}
.pwa-body .mobile-shell{width:min(100%,720px)!important;margin-inline:auto!important;background:linear-gradient(180deg,#f9fbfa 0,#eef4f1 100%)!important;box-shadow:0 0 0 1px rgba(20,65,50,.05),0 22px 70px rgba(16,53,40,.11)!important}
.pwa-body .mobile-top{
  position:sticky!important;top:0!important;z-index:80!important;min-height:calc(var(--pwa-header-height) + var(--pwa-safe-top))!important;
  padding:max(10px,var(--pwa-safe-top)) max(14px,var(--pwa-safe-right)) 10px max(14px,var(--pwa-safe-left))!important;
  background:linear-gradient(135deg,#0a4535 0%,#0d654c 66%,#15745a 100%)!important;
  border:0!important;box-shadow:0 10px 26px rgba(8,57,42,.16)!important;backdrop-filter:saturate(130%) blur(10px)
}
.pwa-body .mobile-brand-head{min-width:0}.pwa-body .mobile-brand-head>div{min-width:0}
.pwa-body .mobile-brand-head strong{display:block;max-width:48vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px!important;line-height:1.2}
.pwa-body .mobile-brand-head span{font-size:9px!important;letter-spacing:.08em;text-transform:uppercase}
.pwa-body .brand-logo{width:44px!important;height:44px!important;flex:0 0 44px!important;border-radius:12px!important;background:rgba(255,255,255,.97)!important;padding:4px!important}
.pwa-body .top-icon,.pwa-body .icon-btn,.pwa-body .icon-btn-light{min-width:44px!important;min-height:44px!important;display:inline-grid!important;place-items:center!important;touch-action:manipulation}
.pwa-body .mobile-body{padding:16px 14px calc(var(--pwa-nav-height) + var(--pwa-safe-bottom) + 26px)!important}
.pwa-body .hero-card,.pwa-body .list-card,.pwa-body .card,.pwa-body .guest-stay-card,.pwa-body .catch-form-card{
  border:1px solid rgba(26,72,57,.10)!important;border-radius:18px!important;background:rgba(255,255,255,.98)!important;box-shadow:var(--pwa-shadow)!important
}
.pwa-body .list-card{overflow:hidden!important}.pwa-body .list-item{min-width:0!important;padding:14px!important;gap:12px!important}
.pwa-body .list-item .grow,.pwa-body .actions,.pwa-body .form-grid>*{min-width:0!important}
.pwa-body img,.pwa-body video,.pwa-body canvas,.pwa-body svg{max-width:100%}
.pwa-body img,.pwa-body video{height:auto}
.pwa-body .stay-hero{width:100%!important;height:clamp(190px,42vw,270px)!important;object-fit:cover!important}
.pwa-body .section-head{margin:22px 2px 9px!important}.pwa-body .section-head h3{font-size:15px!important;letter-spacing:-.015em}
.pwa-body .mobile-metric-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:9px!important}
.pwa-body .mobile-metric{min-width:0!important;min-height:82px!important;padding:12px 7px!important;border-radius:15px!important;border:1px solid rgba(25,74,57,.09)!important;box-shadow:0 7px 20px rgba(18,58,44,.045)!important}
.pwa-body .mobile-metric strong{font-size:25px!important}.pwa-body .mobile-metric span{font-size:9px!important;line-height:1.25}
.pwa-body .staff-steak-grid{gap:10px!important}.pwa-body .staff-stek-card{height:148px!important;border-radius:16px!important;box-shadow:0 10px 25px rgba(13,53,39,.11)!important}
.pwa-body .card-link{min-height:84px!important;border-radius:15px!important;background:#fff!important;box-shadow:0 7px 22px rgba(18,55,43,.045)!important}

/* Inputs: 16px prevents iOS zoom and 44px gives real touch targets. */
.pwa-body input:not([type="checkbox"]):not([type="radio"]),.pwa-body select,.pwa-body textarea,
.visual-login input:not([type="checkbox"]):not([type="radio"]),.visual-login select,.visual-login textarea{
  max-width:100%!important;font-size:16px!important;line-height:1.35!important;touch-action:manipulation
}
.pwa-body .input,.pwa-body .select,.pwa-body .textarea,.pwa-body .input-unit,
.visual-login .input,.visual-login .select,.visual-login .textarea{min-height:46px!important;border-radius:12px!important}
.pwa-body textarea{min-height:96px}.pwa-body .btn,.visual-login .btn{min-height:46px!important;border-radius:12px!important;touch-action:manipulation}
.pwa-body button,.pwa-body a,.visual-login button,.visual-login a{-webkit-tap-highlight-color:transparent}
.pwa-body :focus-visible,.visual-login :focus-visible{outline:3px solid color-mix(in srgb,var(--pwa-brand) 35%,transparent)!important;outline-offset:2px!important}

/* Horizontal components may scroll sideways without stealing vertical page scroll. */
.pwa-body .table-wrap,.pwa-body .horizontal-chips,.pwa-body .segmented,.pwa-body .website-tabs{
  max-width:100%!important;overflow-x:auto!important;overflow-y:hidden!important;-webkit-overflow-scrolling:touch!important;touch-action:pan-x pan-y pinch-zoom!important;overscroll-behavior-inline:contain
}

/* ---------- bottom navigation: safe area + no content overlap ---------- */
.pwa-body .bottom-nav,.pwa-body .guest-hub-bottom{
  position:fixed!important;left:50%!important;right:auto!important;bottom:0!important;z-index:100!important;transform:translateX(-50%)!important;
  width:min(100%,720px)!important;height:calc(var(--pwa-nav-height) + var(--pwa-safe-bottom))!important;min-height:calc(var(--pwa-nav-height) + var(--pwa-safe-bottom))!important;
  padding:5px max(6px,var(--pwa-safe-right)) max(5px,var(--pwa-safe-bottom)) max(6px,var(--pwa-safe-left))!important;
  border:1px solid rgba(20,64,49,.10)!important;border-bottom:0!important;border-radius:18px 18px 0 0!important;
  background:rgba(255,255,255,.96)!important;box-shadow:0 -13px 36px rgba(12,48,36,.10)!important;backdrop-filter:blur(20px) saturate(150%)!important
}
.pwa-body .bottom-nav a,.pwa-body .guest-hub-bottom a{min-width:0!important;min-height:54px!important;border-radius:13px!important;color:#718078!important;font-size:10px!important;font-weight:720!important;touch-action:manipulation}
.pwa-body .bottom-nav a.active,.pwa-body .guest-hub-bottom a.active{background:#edf6f1!important;color:#075b43!important}
.pwa-body .bottom-nav a.active:before{display:none!important}.pwa-body .bottom-nav .ui-icon,.pwa-body .guest-hub-bottom .ui-icon{width:21px!important;height:21px!important}

/* ---------- guest hub scroll / layout recovery ---------- */
body.pwa-guest:not(.chat-screen-active) .guest-hub{padding-bottom:0!important;background:linear-gradient(180deg,#f9fbfa 0,#edf3f0 100%)!important}
body.pwa-guest:not(.chat-screen-active) .guest-hub-head{position:sticky!important;top:0!important;z-index:80!important;padding-top:max(8px,var(--pwa-safe-top))!important;padding-left:max(14px,var(--pwa-safe-left))!important;padding-right:max(14px,var(--pwa-safe-right))!important}
body.pwa-guest:not(.chat-screen-active) .guest-hub-main{width:min(1080px,100%)!important}
body.pwa-guest:not(.chat-screen-active) .guest-grid-menu>a{touch-action:manipulation}

/* ---------- true chat viewport: ONLY the message list scrolls ---------- */
body.pwa-body.chat-screen-active{
  position:fixed!important;inset:0!important;width:100%!important;height:var(--pwa-viewport-height)!important;min-height:0!important;max-height:var(--pwa-viewport-height)!important;
  overflow:hidden!important;overscroll-behavior:none!important;touch-action:auto!important;background:#efeae2!important
}
body.pwa-body.chat-screen-active>.mdesk-credit{display:none!important}
.pwa-body.chat-screen-active .pwa-chat-screen{
  position:fixed!important;top:0!important;left:50%!important;right:auto!important;bottom:auto!important;transform:translateX(-50%)!important;
  display:flex!important;flex-direction:column!important;width:min(100%,720px)!important;height:var(--pwa-viewport-height)!important;min-height:0!important;max-height:var(--pwa-viewport-height)!important;
  margin:0!important;padding:0!important;overflow:hidden!important;background:#efeae2!important;z-index:120!important
}
.pwa-body.chat-screen-active .pwa-chat-screen>.mobile-top{position:relative!important;top:auto!important;flex:0 0 auto!important;z-index:4!important}
.pwa-guest.chat-screen-active .guest-chat-screen>.mobile-top{display:none!important}
.pwa-body.chat-screen-active .pwa-chat-screen .chat-mobile-body{
  position:relative!important;display:flex!important;flex:1 1 0!important;flex-direction:column!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;
  padding:0!important;margin:0!important;overflow:hidden!important;background:#efeae2!important
}
.pwa-body.chat-screen-active .pwa-chat-screen #messages,.pwa-body.chat-screen-active .pwa-chat-screen .mobile-messages{
  position:relative!important;flex:1 1 0!important;height:auto!important;min-height:0!important;max-height:none!important;margin:0!important;
  overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-y:contain!important;touch-action:pan-y!important;
  scroll-behavior:auto!important;padding:15px clamp(9px,3.5vw,25px) 14px!important;border:0!important;border-radius:0!important;background:#efeae2!important
}
.pwa-body.chat-screen-active .pwa-chat-screen .mobile-compose{
  position:relative!important;inset:auto!important;transform:none!important;flex:0 0 auto!important;width:100%!important;max-height:190px!important;margin:0!important;
  padding:7px 8px calc(7px + var(--pwa-safe-bottom))!important;border-radius:0!important;border-top:1px solid #d8dedb!important;background:#f0f2f5!important;z-index:8!important
}
.pwa-body.chat-screen-active .pwa-chat-screen .mobile-compose textarea{font-size:16px!important;max-height:116px!important;resize:none!important}
.pwa-body.chat-screen-active .pwa-chat-screen>.bottom-nav{position:relative!important;left:auto!important;bottom:auto!important;transform:none!important;width:100%!important;flex:0 0 calc(var(--pwa-nav-height) + var(--pwa-safe-bottom))!important}
body.pwa-body.chat-keyboard-open .pwa-chat-screen>.bottom-nav{display:none!important}
body.pwa-body.chat-keyboard-open .pwa-chat-screen .mobile-compose{padding-bottom:max(7px,var(--pwa-safe-bottom))!important}

/* ---------- professional runtime banners ---------- */
.pwa-runtime-toast{position:fixed;left:50%;top:calc(10px + var(--pwa-safe-top));z-index:100000;display:flex;align-items:center;gap:9px;width:min(520px,calc(100% - 24px));transform:translate(-50%,-16px);padding:11px 13px;border:1px solid rgba(15,67,50,.14);border-radius:15px;background:rgba(255,255,255,.97);box-shadow:0 18px 48px rgba(8,38,28,.18);opacity:0;pointer-events:none;transition:.2s ease;color:#173a2e;font-size:12px;font-weight:700;backdrop-filter:blur(16px)}
.pwa-runtime-toast.show{transform:translate(-50%,0);opacity:1;pointer-events:auto}.pwa-runtime-toast.offline{background:#fff8e9;border-color:#ead5a9;color:#684b16}.pwa-runtime-toast.error{background:#fff1ef;border-color:#ebc6c0;color:#7b2f28}.pwa-runtime-toast.success{background:#edf9f3;border-color:#bee3cf;color:#145b3d}
.pwa-runtime-toast .grow{min-width:0;flex:1}.pwa-runtime-toast button{min-height:34px;border:0;border-radius:9px;padding:6px 10px;background:#0c654b;color:#fff;font:inherit;font-size:11px;font-weight:800;cursor:pointer}.pwa-runtime-toast .close{width:32px;padding:0;background:transparent;color:inherit;font-size:18px}
.pwa-sync-pill{position:fixed;right:max(10px,var(--pwa-safe-right));bottom:calc(var(--pwa-nav-height) + var(--pwa-safe-bottom) + 10px);z-index:95;display:none;align-items:center;gap:7px;min-height:36px;padding:7px 11px;border:1px solid #d7e2dc;border-radius:999px;background:rgba(255,255,255,.96);box-shadow:0 9px 24px rgba(13,52,39,.12);color:#365248;font-size:10px;font-weight:800}.pwa-sync-pill.show{display:inline-flex}.pwa-sync-pill.pending:before{content:"";width:8px;height:8px;border-radius:50%;background:#d8922d}.pwa-sync-pill.syncing:before{content:"";width:9px;height:9px;border:2px solid #a9c9bb;border-top-color:#0b7657;border-radius:50%;animation:pwaSpin .8s linear infinite}.pwa-sync-pill.ok:before{content:"✓";color:#08714f;font-size:12px}@keyframes pwaSpin{to{transform:rotate(360deg)}}

/* ---------- call overlay must remain scrollable on short screens ---------- */
.pwa-body .call-overlay{overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;align-items:safe center!important;padding:max(14px,var(--pwa-safe-top)) max(14px,var(--pwa-safe-right)) max(14px,var(--pwa-safe-bottom)) max(14px,var(--pwa-safe-left))!important}.pwa-body .call-card{max-height:calc(var(--pwa-viewport-height) - 28px)!important;overflow-y:auto!important}

/* ---------- login/install screen ---------- */
.visual-login{min-height:100dvh!important;overflow-y:auto!important;overflow-x:hidden!important;background:linear-gradient(145deg,#edf4f0,#f9fbfa)!important;-webkit-overflow-scrolling:touch!important}
.visual-login .login-shell{min-height:100dvh!important;height:auto!important;padding:max(22px,var(--pwa-safe-top)) max(16px,var(--pwa-safe-right)) max(22px,var(--pwa-safe-bottom)) max(16px,var(--pwa-safe-left))!important}
.visual-login .login-card{border-radius:25px!important;box-shadow:0 26px 70px rgba(14,54,40,.13)!important}

@media(max-width:520px){
  :root{--pwa-nav-height:70px;--pwa-header-height:64px}
  .pwa-body .mobile-body{padding-left:10px!important;padding-right:10px!important}
  .pwa-body .mobile-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .pwa-body .staff-steak-grid{grid-template-columns:1fr 1fr!important}
  .pwa-body .staff-stek-card{height:132px!important}
  .pwa-body .actions{flex-wrap:wrap!important}.pwa-body .actions>.btn,.pwa-body .actions>form{max-width:100%}
  .pwa-body .form-grid{grid-template-columns:1fr!important}.pwa-body .span-2{grid-column:auto!important}
}
@media(max-width:360px){
  .pwa-body .mobile-brand-head strong{max-width:39vw;font-size:13px!important}
  .pwa-body .bottom-nav a,.pwa-body .guest-hub-bottom a{font-size:9px!important}
  .pwa-body .staff-steak-grid{grid-template-columns:1fr!important}.pwa-body .staff-stek-card{height:160px!important}
}
@media(orientation:landscape) and (max-height:520px){
  :root{--pwa-nav-height:62px;--pwa-header-height:56px}
  .pwa-body .mobile-top{min-height:calc(var(--pwa-header-height) + var(--pwa-safe-top))!important;padding-block:6px!important}
  .pwa-body .brand-logo{width:38px!important;height:38px!important;flex-basis:38px!important}
  .pwa-body .bottom-nav a,.pwa-body .guest-hub-bottom a{min-height:46px!important}
}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}.pwa-runtime-toast{transition:none}.pwa-sync-pill.syncing:before{animation-duration:1.6s}}

/* ---------- Reception/Windows PWA mobile hardening ---------- */
@media(max-width:960px){
  body.reception-wa{min-height:100dvh!important;overflow-x:hidden!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-y:auto!important}
  body.reception-wa .reception-shell{min-height:100dvh!important;height:auto!important;overflow:visible!important}
  body.reception-wa .reception-main{min-width:0!important;min-height:100dvh!important;height:auto!important;overflow:visible!important;padding-bottom:calc(72px + var(--pwa-safe-bottom))!important}
  body.reception-wa .reception-page{min-width:0!important;height:auto!important;overflow:visible!important;padding:16px 12px calc(82px + var(--pwa-safe-bottom))!important}
  body.reception-wa .reception-top{position:sticky!important;top:0!important;z-index:75!important;padding-top:max(8px,var(--pwa-safe-top))!important}
  body.reception-wa .reception-mobile-nav{position:fixed!important;left:0!important;right:0!important;bottom:0!important;z-index:100!important;min-height:calc(66px + var(--pwa-safe-bottom))!important;padding-bottom:max(5px,var(--pwa-safe-bottom))!important;background:rgba(255,255,255,.97)!important;backdrop-filter:blur(18px)!important;box-shadow:0 -12px 32px rgba(12,48,36,.10)!important}
  body.reception-wa .reception-mobile-nav a{min-height:52px!important;touch-action:manipulation!important}
  body.reception-wa input:not([type=checkbox]):not([type=radio]),body.reception-wa select,body.reception-wa textarea{font-size:16px!important;max-width:100%!important}
  body.reception-wa .table-wrap{max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch!important}
}
