/* SHEPHERDS V27 — MILAN RHYTHM + IOS KEYBOARD STATE HARDENING
   Additive over V26. Prevents Safari toolbar/button focus from being misread as an open keyboard,
   restores the conversation surface when the keyboard is gone, and gives every Milan choice step
   a deliberate question-to-action rhythm on mobile and desktop. */

.v27-site .sage-question-label{
  margin-bottom:16px!important;
  padding-bottom:1px!important;
}
.v27-site .sage-options{
  gap:10px!important;
}
.v27-site .sage-option{
  min-height:50px!important;
  padding:8px 16px!important;
  line-height:1.25!important;
  white-space:normal!important;
  text-wrap:balance;
}
.v27-site .sage-multi-actions{
  margin-top:16px!important;
}
.v27-site .sage-composer-inner{
  min-width:0!important;
}

/* When a keyboard is NOT genuinely present, Milan returns to its normal conversation + composer layout. */
.v27-site .sage-portal:not([data-sage-keyboard="true"]) .sage-thread{
  display:block!important;
  flex:1 1 auto!important;
  min-height:0!important;
}
.v27-site .sage-portal:not([data-sage-keyboard="true"]) .sage-composer{
  flex:0 0 auto!important;
}

@media(max-width:900px){
  .v27-site .sage-composer{
    padding-top:22px!important;
    padding-left:16px!important;
    padding-right:16px!important;
  }
  .v27-site .sage-composer-inner{
    width:min(720px,100%)!important;
  }
  .v27-site .sage-question-label{
    margin-bottom:20px!important;
    gap:12px!important;
    align-items:flex-start!important;
  }
  .v27-site .sage-question-label span,
  .v27-site .sage-question-label small{
    line-height:1.35!important;
  }
  .v27-site .sage-options{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:12px!important;
    max-height:none!important;
    overflow:visible!important;
  }
  .v27-site .sage-option{
    width:100%!important;
    min-height:58px!important;
    padding:10px 18px!important;
    border-radius:22px!important;
    font-size:clamp(13px,3.55vw,15px)!important;
  }
  .v27-site .sage-multi-actions{
    margin-top:18px!important;
  }
}

@media(max-width:520px){
  .v27-site .sage-composer{
    padding-top:24px!important;
    padding-left:14px!important;
    padding-right:14px!important;
  }
  .v27-site .sage-question-label{
    margin-bottom:22px!important;
  }
  .v27-site .sage-option{
    min-height:60px!important;
    border-radius:24px!important;
  }
}

/* True typing mode keeps the V26 full-height intake behavior, but with a little more breathing room. */
.v27-site .sage-portal[data-sage-keyboard="true"] .sage-question-label{
  margin-bottom:16px!important;
}
.v27-site .sage-portal[data-sage-keyboard="true"] .sage-composer{
  padding-top:0!important;
}
