/* KB Business Portal 21.6.311 – mobile overflow and bottom controls.
 * Loaded after PRO CLEAN métier CSS on standalone and after the portal stylesheet
 * on shortcode routes. Never changes desktop or unrelated WordPress pages. */
@media (max-width:760px) {
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7971-dashboard,
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7970-agenda-wrap,
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7970-day {
    box-sizing:border-box;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  /* Root cause: h2 flex:1/min-width:0 was crushed by a long date and link. */
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7970-day > .kbpc79-panel-head {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    align-items:center!important;
    justify-items:start!important;
    gap:8px 10px!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0 0 12px!important;
  }
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7970-day > .kbpc79-panel-head > #kbpc79-day-title {
    display:block!important;
    width:auto!important;
    max-width:100%!important;
    min-width:0!important;
    flex:none!important;
    grid-column:1 / -1!important;
    grid-row:1!important;
    margin:0!important;
    white-space:normal!important;
    word-break:normal!important;
    overflow-wrap:normal!important;
    hyphens:none!important;
    font-size:clamp(19px,5vw,22px)!important;
    line-height:1.3!important;
    letter-spacing:normal!important;
    writing-mode:horizontal-tb!important;
  }
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7970-day > .kbpc79-panel-head > .kbpc79-date {
    grid-column:1!important;grid-row:2!important;order:0!important;
    margin:0!important;width:auto!important;max-width:100%!important;
    white-space:normal!important;overflow-wrap:normal!important;
    font-size:12px!important;line-height:1.35!important;
  }
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7970-day > .kbpc79-panel-head > a {
    grid-column:2!important;grid-row:2!important;justify-self:end!important;
    display:inline-flex!important;align-items:center!important;max-width:100%!important;
    font-size:12px!important;line-height:1.35!important;
    color:#75531c!important;font-weight:700!important;text-align:right!important;
    overflow-wrap:normal!important;word-break:normal!important;
  }
  /* Keep appointment data usable without squashing the CTA or truncating names. */
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7970-day .kbpc79-event{
    min-width:0!important;max-width:100%!important;flex-wrap:wrap!important;column-gap:9px!important;
  }
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7970-day .kbpc79-event-detail{
    min-width:100px!important;flex:1 1 45%!important;overflow-wrap:break-word;
  }
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7970-day .kbpc79-event-cta{
    min-height:44px!important;max-width:100%!important;white-space:normal!important;
    text-align:center!important;scroll-margin-bottom:calc(115px + env(safe-area-inset-bottom,0px));
  }
  /* Compact repeated high cards without hiding their labels or links. */
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7971-dashboard .kbpc79-kpi{
    min-height:65px!important;padding:10px 12px!important;
  }
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7971-dashboard .kbpc79-kpi-content>span{
    font-size:13px!important;line-height:1.3!important;
  }
  /* The dock is fixed: reserve an actual landing area for the last action. */
  .kbbp-app {
    --kbbp-v311-dock-space:calc(113px + env(safe-area-inset-bottom,0px));
    scroll-padding-bottom:var(--kbbp-v311-dock-space);
  }
  body .kbbp-app[data-kbbp-trade="pro_clean"] .kbbp-main,
  body .kbbp-app .kbbp-main {
    padding-bottom:calc(155px + env(safe-area-inset-bottom,0px))!important;
    scroll-padding-bottom:var(--kbbp-v311-dock-space);
  }
  .kbbp-app .kbbp-mobile-dock{
    box-sizing:border-box!important;
    bottom:calc(8px + env(safe-area-inset-bottom,0px))!important;
    min-height:0!important;
    max-height:76px!important;
    padding:5px!important;
    z-index:9990!important;
  }
  .kbbp-app .kbbp-mobile-dock .kbbp-dock-link{
    min-height:49px!important;max-height:65px!important;
  }
  .kbbp-app :is(a,button,summary,input,select,textarea,[tabindex]):not(.kbbp-dock-link){
    scroll-margin-bottom:var(--kbbp-v311-dock-space);
  }
  .kbbp-app .kbbp-dock-more-panel{
    bottom:calc(80px + env(safe-area-inset-bottom,0px))!important;
    max-height:min(56dvh,440px)!important;
  }
  /* Coach is hosted by its own plugin; keep the business cockpit's
     important CTA clear of the existing right-side launcher on phones. */
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbbp301-coach-cta{
    box-sizing:border-box!important;
    width:calc(100% - 76px)!important;
    max-width:calc(100% - 76px)!important;
    margin-left:0!important;
    margin-right:76px!important;
    min-height:44px!important;
  }
}
@media (max-width:370px) {
  /* On the smallest iPhones the date and link need independent rows. */
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7970-day > .kbpc79-panel-head {
    grid-template-columns:minmax(0,1fr)!important;
  }
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7970-day > .kbpc79-panel-head > .kbpc79-date{
    grid-column:1!important;grid-row:2!important;
  }
  .kbbp-app[data-kbbp-trade="pro_clean"].kbbp-view-dashboard .kbpc7970-day > .kbpc79-panel-head > a{
    grid-column:1!important;grid-row:3!important;justify-self:start!important;text-align:left!important;
  }
}
@media (prefers-reduced-motion:reduce){
  .kbbp-app .kbbp-mobile-dock *{transition:none!important;animation:none!important;}
}
