/* Felice Client Portal 14.6.27 - fix scroll mobile + drawer giorno con 100+ task */
:root{
  --fcp27-blue:#155eef;
  --fcp27-blue-dark:#0b3b8f;
  --fcp27-sky:#33b7ff;
  --fcp27-text:#0b2444;
  --fcp27-muted:#667085;
  --fcp27-line:#d7e5f5;
  --fcp27-bg:#f3f8ff;
  --fcp27-card:#ffffff;
  --fcp27-shadow:0 24px 80px rgba(15,35,65,.20);
}

html.fcp-mobile-calendar-14627,
html.fcp-mobile-calendar-14627 body.fcp-app-root-page{
  height:auto!important;
  min-height:100%!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  overscroll-behavior-y:auto!important;
  -webkit-overflow-scrolling:touch!important;
}
body.fcp-app-root-page:not(.fcp-mobile-task-open):not(.fcp-mobile-day-open):not(.fcp-mobile-lead-open):not(.fcp-mobile-ai-open):not(.fcp-mobile-edit-open){
  overflow-y:auto!important;
  position:static!important;
}
body.fcp-app-root-page .fcp-app-shell[data-fcp-app="1"]{
  height:auto!important;
  min-height:100dvh!important;
  overflow:visible!important;
}
body.fcp-app-root-page .fcp-app-main,
body.fcp-app-root-page .fcp-mobile-native-screen,
body.fcp-app-root-page .fcp-mobile-task-panel,
body.fcp-app-root-page .fcp-app-legacy-content{
  height:auto!important;
  max-height:none!important;
  min-height:0!important;
  overflow:visible!important;
}
body.fcp-app-root-page .fcp-mobile-task-panel:not(.is-active){display:none!important;}
body.fcp-app-root-page .fcp-mobile-task-panel.is-active{display:block!important;}

/* Month calendar: compatto, leggibile e cliccabile */
body.fcp-app-root-page .fcp-mobile-month-title{
  position:relative!important;
  z-index:2!important;
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  margin:14px 0 12px!important;
  padding:0 2px!important;
}
body.fcp-app-root-page .fcp-mobile-month-title strong{
  color:var(--fcp27-text)!important;
  font-size:22px!important;
  line-height:1.15!important;
  font-weight:900!important;
}
body.fcp-app-root-page .fcp-mobile-month-title button{
  min-width:44px!important;
  width:44px!important;
  height:44px!important;
  border-radius:16px!important;
  background:#fff!important;
  border:1px solid var(--fcp27-line)!important;
  color:var(--fcp27-blue)!important;
  box-shadow:0 8px 22px rgba(15,35,65,.06)!important;
}
body.fcp-app-root-page .fcp-mobile-month-grid{
  width:100%!important;
  max-width:100%!important;
  display:grid!important;
  grid-template-columns:repeat(7,minmax(0,1fr))!important;
  gap:6px!important;
  overflow:visible!important;
  padding:8px!important;
  border-radius:22px!important;
  background:rgba(255,255,255,.72)!important;
  border:1px solid var(--fcp27-line)!important;
  box-sizing:border-box!important;
}
body.fcp-app-root-page .fcp-mobile-weekdays{
  grid-column:1/-1!important;
  display:grid!important;
  grid-template-columns:repeat(7,minmax(0,1fr))!important;
  gap:6px!important;
  margin:0!important;
}
body.fcp-app-root-page .fcp-mobile-weekdays span{
  min-width:0!important;
  text-align:center!important;
  font-size:11px!important;
  line-height:1!important;
  letter-spacing:.04em!important;
  font-weight:900!important;
  color:#667085!important;
  background:#f6f9ff!important;
  border-radius:10px!important;
  padding:8px 2px!important;
}
body.fcp-app-root-page .fcp-mobile-month-day{
  position:relative!important;
  min-width:0!important;
  min-height:88px!important;
  height:auto!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:flex-start!important;
  gap:4px!important;
  padding:8px 6px!important;
  border-radius:14px!important;
  background:#fff!important;
  border:1px solid var(--fcp27-line)!important;
  color:var(--fcp27-text)!important;
  cursor:pointer!important;
  touch-action:manipulation!important;
  overflow:hidden!important;
  box-sizing:border-box!important;
}
body.fcp-app-root-page .fcp-mobile-month-day strong{
  display:block!important;
  width:100%!important;
  text-align:left!important;
  font-size:15px!important;
  line-height:1!important;
  font-weight:950!important;
  color:var(--fcp27-text)!important;
}
body.fcp-app-root-page .fcp-mobile-month-day.is-out-month{
  opacity:.58!important;
  background:#f8fbff!important;
}
body.fcp-app-root-page .fcp-mobile-month-day.is-today{
  border-color:var(--fcp27-blue)!important;
  box-shadow:inset 0 0 0 1px var(--fcp27-blue),0 8px 20px rgba(21,94,239,.08)!important;
}
body.fcp-app-root-page .fcp-mobile-month-day[data-fcp-task-count]:not([data-fcp-task-count="0"])::after{
  content:attr(data-fcp-task-count);
  position:absolute!important;
  top:6px!important;
  right:6px!important;
  min-width:20px!important;
  height:20px!important;
  padding:0 6px!important;
  border-radius:999px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:var(--fcp27-blue)!important;
  color:#fff!important;
  font-size:11px!important;
  line-height:1!important;
  font-weight:900!important;
}
body.fcp-app-root-page .fcp-mobile-month-day span{
  display:block!important;
  max-width:100%!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  color:var(--fcp27-blue-dark)!important;
  background:#edf5ff!important;
  border:1px solid #d7eaff!important;
  border-radius:8px!important;
  padding:3px 5px!important;
  font-size:10px!important;
  line-height:1.12!important;
  font-weight:850!important;
}
body.fcp-app-root-page .fcp-mobile-month-day em{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:20px!important;
  padding:0 7px!important;
  border-radius:999px!important;
  font-style:normal!important;
  background:#0b3b8f!important;
  color:#fff!important;
  font-size:11px!important;
  font-weight:950!important;
  margin-top:auto!important;
  pointer-events:none!important;
}

/* Schedule: nessun blocco verticale, scroll orizzontale solo quando serve */
body.fcp-app-root-page .fcp-mobile-task-panel[data-mobile-task-panel="day"],
body.fcp-app-root-page .fcp-mobile-task-panel[data-mobile-task-panel="3days"],
body.fcp-app-root-page .fcp-mobile-task-panel[data-mobile-task-panel="week"]{
  overflow-x:auto!important;
  overflow-y:visible!important;
  -webkit-overflow-scrolling:touch!important;
  padding-bottom:24px!important;
}
body.fcp-app-root-page .fcp-mobile-schedule{
  max-width:100%!important;
  overflow:visible!important;
  touch-action:pan-x pan-y!important;
}
body.fcp-app-root-page .fcp-mobile-schedule[data-days="1"]{min-width:100%!important;}
body.fcp-app-root-page .fcp-mobile-schedule[data-days="3"]{min-width:620px!important;}
body.fcp-app-root-page .fcp-mobile-schedule[data-days="7"]{min-width:980px!important;}
body.fcp-app-root-page .fcp-mobile-schedule-body{
  max-height:none!important;
  min-height:760px!important;
  overflow:visible!important;
}
body.fcp-app-root-page .fcp-mobile-schedule-cell,
body.fcp-app-root-page .fcp-mobile-schedule-event,
body.fcp-app-root-page .fcp-mobile-schedule-more{
  cursor:pointer!important;
  touch-action:manipulation!important;
}
body.fcp-app-root-page .fcp-mobile-schedule-more{
  background:#0b3b8f!important;
  color:#fff!important;
  border-color:#0b3b8f!important;
  font-weight:950!important;
}

/* Drawer giorno: full screen usabile da mobile, con scroll interno per 90/100 task */
body.fcp-app-root-page .fcp-14623-day-backdrop,
body.fcp-app-root-page .fcp-14627-day-backdrop{
  display:none!important;
  position:fixed!important;
  inset:0!important;
  background:rgba(15,23,42,.50)!important;
  z-index:2147483000!important;
}
body.fcp-mobile-day-open .fcp-14623-day-backdrop,
body.fcp-mobile-day-open .fcp-14627-day-backdrop{
  display:block!important;
}
body.fcp-app-root-page .fcp-mobile-day-sheet{
  position:fixed!important;
  left:50%!important;
  top:50%!important;
  right:auto!important;
  bottom:auto!important;
  width:min(780px,calc(100vw - 32px))!important;
  max-height:calc(100dvh - 48px)!important;
  height:auto!important;
  display:flex!important;
  flex-direction:column!important;
  transform:translate(-50%,-48%) scale(.98)!important;
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
  z-index:2147483100!important;
  overflow:hidden!important;
  padding:22px!important;
  border-radius:24px!important;
  background:#fff!important;
  border:1px solid var(--fcp27-line)!important;
  box-shadow:var(--fcp27-shadow)!important;
}
body.fcp-mobile-day-open .fcp-mobile-day-sheet,
body.fcp-app-root-page .fcp-mobile-day-sheet.is-open{
  transform:translate(-50%,-50%) scale(1)!important;
  opacity:1!important;
  visibility:visible!important;
  pointer-events:auto!important;
}
body.fcp-app-root-page .fcp-mobile-day-sheet h3{
  flex:0 0 auto!important;
  margin:0 52px 14px 0!important;
  color:var(--fcp27-text)!important;
  font-size:22px!important;
  line-height:1.15!important;
  font-weight:950!important;
}
body.fcp-app-root-page .fcp-mobile-day-sheet-body{
  flex:1 1 auto!important;
  min-height:0!important;
  max-height:none!important;
  height:auto!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
  -webkit-overflow-scrolling:touch!important;
  overscroll-behavior:contain!important;
  display:grid!important;
  grid-template-columns:1fr!important;
  gap:12px!important;
  padding:2px 4px 18px!important;
}
body.fcp-app-root-page .fcp-mobile-day-sheet-body .fcp-mobile-task-card,
body.fcp-app-root-page .fcp-mobile-day-sheet-body [data-fcp-task-card]{
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
}
body.fcp-app-root-page .fcp-mobile-day-sheet .fcp-mobile-sheet-x{
  z-index:2147483200!important;
}

/* Modal nuova task mobile: mai tagliato a metà */
body.fcp-app-root-page .fcp-mobile-sheet-backdrop{
  z-index:2147483000!important;
}
body.fcp-app-root-page .fcp-mobile-task-sheet{
  z-index:2147483100!important;
}

@media (max-width:760px){
  body.fcp-app-root-page .fcp-native-mobile-header{
    position:sticky!important;
    top:0!important;
    z-index:100!important;
  }
  body.fcp-app-root-page .fcp-app-main{
    padding-bottom:calc(150px + env(safe-area-inset-bottom))!important;
  }
  body.fcp-app-root-page .fcp-mobile-native-screen{
    padding-left:14px!important;
    padding-right:14px!important;
    padding-bottom:calc(150px + env(safe-area-inset-bottom))!important;
  }
  body.fcp-app-root-page .fcp-mobile-calendar-viewbar{
    display:flex!important;
    gap:10px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    scroll-snap-type:x proximity!important;
    padding:4px 2px 10px!important;
    margin-inline:-2px!important;
  }
  body.fcp-app-root-page .fcp-mobile-calendar-viewbar button{
    flex:0 0 auto!important;
    scroll-snap-align:start!important;
    min-height:46px!important;
    border-radius:18px!important;
    padding:0 18px!important;
  }
  body.fcp-app-root-page .fcp-mobile-month-grid{
    gap:4px!important;
    padding:6px!important;
    border-radius:18px!important;
  }
  body.fcp-app-root-page .fcp-mobile-weekdays{gap:4px!important;}
  body.fcp-app-root-page .fcp-mobile-weekdays span{
    font-size:9px!important;
    padding:6px 1px!important;
  }
  body.fcp-app-root-page .fcp-mobile-month-day{
    min-height:74px!important;
    border-radius:12px!important;
    padding:7px 4px 5px!important;
  }
  body.fcp-app-root-page .fcp-mobile-month-day strong{
    font-size:13px!important;
  }
  body.fcp-app-root-page .fcp-mobile-month-day span{
    font-size:8.5px!important;
    padding:2px 4px!important;
    max-width:100%!important;
  }
  body.fcp-app-root-page .fcp-mobile-month-day[data-fcp-task-count]:not([data-fcp-task-count="0"])::after{
    min-width:18px!important;
    height:18px!important;
    padding:0 5px!important;
    top:4px!important;
    right:4px!important;
    font-size:10px!important;
  }
  body.fcp-app-root-page .fcp-mobile-month-day em{
    min-height:18px!important;
    padding:0 5px!important;
    font-size:10px!important;
  }
  body.fcp-app-root-page .fcp-mobile-day-sheet{
    left:max(8px,env(safe-area-inset-left))!important;
    right:max(8px,env(safe-area-inset-right))!important;
    top:max(54px,env(safe-area-inset-top))!important;
    bottom:max(10px,env(safe-area-inset-bottom))!important;
    width:auto!important;
    max-width:none!important;
    height:auto!important;
    max-height:none!important;
    transform:translateY(12px)!important;
    border-radius:24px!important;
    padding:18px 14px 16px!important;
  }
  body.fcp-mobile-day-open .fcp-mobile-day-sheet,
  body.fcp-app-root-page .fcp-mobile-day-sheet.is-open{
    transform:translateY(0)!important;
  }
  body.fcp-app-root-page .fcp-mobile-day-sheet h3{
    font-size:20px!important;
    margin-right:48px!important;
  }
  body.fcp-app-root-page .fcp-mobile-day-sheet-body{
    padding-bottom:calc(88px + env(safe-area-inset-bottom))!important;
  }
  body.fcp-app-root-page .fcp-mobile-task-sheet{
    left:max(10px,env(safe-area-inset-left))!important;
    right:max(10px,env(safe-area-inset-right))!important;
    top:max(58px,env(safe-area-inset-top))!important;
    bottom:max(10px,env(safe-area-inset-bottom))!important;
    width:auto!important;
    max-width:none!important;
    height:auto!important;
    max-height:none!important;
    transform:translateY(14px)!important;
    overflow:auto!important;
    -webkit-overflow-scrolling:touch!important;
  }
  body.fcp-mobile-task-open .fcp-mobile-task-sheet{
    transform:translateY(0)!important;
  }
  body.fcp-mobile-task-open,
  body.fcp-mobile-day-open{
    overflow:hidden!important;
    touch-action:none!important;
  }
  body.fcp-mobile-task-open .fcp-mobile-task-sheet,
  body.fcp-mobile-day-open .fcp-mobile-day-sheet,
  body.fcp-mobile-task-open .fcp-mobile-task-sheet *,
  body.fcp-mobile-day-open .fcp-mobile-day-sheet *{
    touch-action:auto!important;
  }
}

@media (max-width:390px){
  body.fcp-app-root-page .fcp-mobile-native-screen{
    padding-left:10px!important;
    padding-right:10px!important;
  }
  body.fcp-app-root-page .fcp-mobile-month-day{
    min-height:68px!important;
    padding:6px 3px!important;
  }
  body.fcp-app-root-page .fcp-mobile-month-day span{
    display:none!important;
  }
  body.fcp-app-root-page .fcp-mobile-month-day em{
    display:inline-flex!important;
  }
}
