/* O2 VET GLOBAL LANGUAGE PHASE 3F - LANGUAGE SAFE LAYOUT */

/* Keep the accepted English layout untouched. These adjustments activate only
   for Portuguese or Traditional Chinese selected through the global language UI. */

html.o2-lang-pt body.o2-prescriptions-body #o2-rx-workspace-modal button,
html.o2-lang-zh body.o2-prescriptions-body #o2-rx-workspace-modal button,
html.o2-lang-pt body.o2-prescriptions-body .o2-rx-workspace-modal button,
html.o2-lang-zh body.o2-prescriptions-body .o2-rx-workspace-modal button,
html.o2-lang-pt body.o2-prescriptions-body #o2-rx-unified-browse-modal button,
html.o2-lang-zh body.o2-prescriptions-body #o2-rx-unified-browse-modal button,
html.o2-lang-pt body.o2-prescriptions-body #o2-rx-detail-modal button,
html.o2-lang-zh body.o2-prescriptions-body #o2-rx-detail-modal button {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-height: 1.12 !important;
  height: auto !important;
  min-height: 38px !important;
}

html.o2-lang-pt body.o2-prescriptions-body #o2-rx-workspace-modal button,
html.o2-lang-pt body.o2-prescriptions-body .o2-rx-workspace-modal button,
html.o2-lang-pt body.o2-prescriptions-body #o2-rx-unified-browse-modal button {
  font-size: 12px !important;
}

html.o2-lang-zh body.o2-prescriptions-body #o2-rx-workspace-modal button,
html.o2-lang-zh body.o2-prescriptions-body .o2-rx-workspace-modal button,
html.o2-lang-zh body.o2-prescriptions-body #o2-rx-unified-browse-modal button {
  font-size: 13px !important;
}

html.o2-lang-pt body.o2-prescriptions-body .o2-rx-actions,
html.o2-lang-zh body.o2-prescriptions-body .o2-rx-actions,
html.o2-lang-pt body.o2-prescriptions-body .o2-rx-toolbar,
html.o2-lang-zh body.o2-prescriptions-body .o2-rx-toolbar,
html.o2-lang-pt body.o2-prescriptions-body .o2-rx-workspace-actions,
html.o2-lang-zh body.o2-prescriptions-body .o2-rx-workspace-actions {
  align-items: stretch !important;
}

/* Billing actions: preserve the accepted row placement while allowing longer
   translated labels to wrap instead of pushing controls into a new position. */
html.o2-lang-pt .o2-pro-tools button,
html.o2-lang-zh .o2-pro-tools button,
html.o2-lang-pt .invoice-browser-head-actions button,
html.o2-lang-zh .invoice-browser-head-actions button,
html.o2-lang-pt .o2-quick-pay-list-btn,
html.o2-lang-zh .o2-quick-pay-list-btn,
html.o2-lang-pt .invoice-admin-delete,
html.o2-lang-zh .invoice-admin-delete {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.12 !important;
  height: auto !important;
  min-height: 40px !important;
}

/* Administration and Clinical action controls use the same principle. */
html.o2-lang-pt .o2-directory-head button,
html.o2-lang-zh .o2-directory-head button,
html.o2-lang-pt .o2clinical-patient-actions button,
html.o2-lang-zh .o2clinical-patient-actions button,
html.o2-lang-pt #diagnostics .entry button,
html.o2-lang-zh #diagnostics .entry button {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.12 !important;
}

/* Vaccination tabs may contain longer Portuguese labels. Keep the tab row
   stable and allow labels to wrap inside their existing footprint. */
html.o2-lang-pt .o2vax-tabs button,
html.o2-lang-zh .o2vax-tabs button {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  line-height: 1.12 !important;
}
/* === O2 VET GLOBAL LANGUAGE PHASE 3J - APPOINTMENTS TOOLBAR FIX ===
   Phase 5B3 accepted contract:
   + New appointment remains at the far-right of the Day/Week/Month toolbar.
   This is presentation-only and does not modify appointment logic. */

body.o2-calendar-body .o2-calendar-toolbar > .o2-lang-appt-toolbar-slot,
body.o2-calendar-body .o2-calendar-toolbar > .o2-appt-operational-actions{
  margin-left:auto!important;
  position:static!important;
  inset:auto!important;
  top:auto!important;
  right:auto!important;
  bottom:auto!important;
  left:auto!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  flex:0 0 auto!important;
  width:auto!important;
  max-width:none!important;
  z-index:auto!important;
}

body.o2-calendar-body .o2-calendar-toolbar .o2-appt-action-primary{
  position:static!important;
  margin:0!important;
  white-space:nowrap!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
  width:auto!important;
  min-width:max-content!important;
  max-width:none!important;
  height:44px!important;
  min-height:44px!important;
  padding-left:20px!important;
  padding-right:20px!important;
}

html.o2-lang-pt body.o2-calendar-body .o2-calendar-toolbar .o2-appt-action-primary{
  font-size:14px!important;
}

html.o2-lang-zh body.o2-calendar-body .o2-calendar-toolbar .o2-appt-action-primary{
  font-size:14px!important;
}

/* Keep the toolbar usable on narrower screens without returning to the
   floating hero position. */
@media (max-width: 980px){
  body.o2-calendar-body .o2-calendar-toolbar > .o2-lang-appt-toolbar-slot,
  body.o2-calendar-body .o2-calendar-toolbar > .o2-appt-operational-actions{
    margin-left:0!important;
  }

  body.o2-calendar-body .o2-calendar-toolbar .o2-appt-action-primary{
    white-space:normal!important;
    min-width:0!important;
  }
}
/* === END O2 VET GLOBAL LANGUAGE PHASE 3J === */
