/* ==========================================================================
   PHARMAPLUS MAIL V3.2.6 REV2
   COMPOSE FIRST-LINE / TOOLBAR OVERLAP CORRECTION

   Verified live geometry:
     textarea top          = 276px
     toolbar top           = 277px
     toolbar bottom        = 310px
     toolbar height        = 33px
     required clearance    = 34px

   Existing V3.1 textarea content spacing:
     padding-top           = 20px

   Correct content start:
     34px toolbar clearance
   + 20px normal spacing
   = 54px

   Presentation-only.
   No Roundcube mail/send/recipient logic changes.
   ========================================================================== */


/*
 * Retain the existing V3.2.6 container correction.
 */
body.task-mail.action-compose #composebodycontainer {
    overflow: visible !important;
}


/*
 * Preserve the existing border-box geometry.
 */
body.task-mail.action-compose #composebodycontainer > #composebody,
body.task-mail.action-compose #composebodycontainer > .tox-tinymce,
body.task-mail.action-compose #composebodycontainer .tox-tinymce {
    box-sizing: border-box !important;
}


/*
 * Root-cause correction.
 *
 * .editor-toolbar remains absolutely positioned.
 * We therefore reserve its verified 34px vertical occupation plus the
 * existing 20px visual content spacing.
 *
 * Because #composebody is border-box, its external size remains unchanged.
 */
body.task-mail.action-compose #composebodycontainer > #composebody,
body.task-mail.action-compose #composebody {
    margin-top: 0 !important;
    padding-top: 54px !important;
}


/*
 * Preserve previously deployed rich-editor shell behavior.
 */
body.task-mail.action-compose #composebodycontainer .tox-tinymce {
    position: relative !important;
    top: auto !important;
    margin-top: 0 !important;
}


/*
 * Mobile/tablet uses exactly the same measured clearance.
 */
@media screen and (max-width: 1024px) {
    body.task-mail.action-compose #composebodycontainer {
        overflow: visible !important;
    }

    body.task-mail.action-compose #composebodycontainer .tox-tinymce {
        margin-top: 0 !important;
    }

    body.task-mail.action-compose #composebodycontainer > #composebody,
    body.task-mail.action-compose #composebody {
        margin-top: 0 !important;
        padding-top: 54px !important;
    }
}
