/* Account text size respects the browser's preferred base size. */
:root { font-size: 100%; }
:root[data-text-size="120"] { font-size: 120%; }
:root[data-text-size="140"] { font-size: 140%; }

html, body { min-width: 0; max-width: 100%; }
body { overflow-wrap: anywhere; }
:where(main, section, article, header, nav, form, div) { min-width: 0; }
button, input, select, textarea { font: inherit; max-width: 100%; }
button, summary { white-space: normal; overflow-wrap: anywhere; }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select {
  height: auto; min-height: 2.5rem;
}
img, svg { max-width: 100%; flex-shrink: 0; }
textarea { resize: vertical; }

.zreev-text-size {
  display: inline-flex; flex: 0 0 auto; flex-direction: column;
  align-items: center; justify-content: center; gap: .125rem;
  width: 2.75rem; min-height: 2.75rem; padding: .25rem;
  border: 1px solid #E5EAF2; border-radius: .75rem;
  background: #fff; color: #6b7280; cursor: pointer;
  font-family: inherit; line-height: 1;
}
.zreev-text-size.is-active { border-color: #2F6BFF; background: #EFF4FF; color: #2F6BFF; }
.zreev-text-size:focus-visible { outline: 2px solid #2F6BFF; outline-offset: 3px; }
.zreev-text-size-symbol { display: inline-flex; align-items: baseline; gap: .125rem; font-weight: 700; }
.zreev-text-size-symbol > :first-child { font-size: .75rem; }
.zreev-text-size-symbol > :last-child { font-size: 1.125rem; }
.zreev-text-size-level { font-size: .375rem; letter-spacing: .125rem; }
.zreev-text-size-level:empty { display: none; }
.zreev-text-size-status { position: fixed; bottom: 1rem; left: 1rem; right: 1rem; width: fit-content; max-width: calc(100% - 2rem); z-index: 1000; padding: .75rem 1rem; background: #fff; border: 1px solid #E5EAF2; border-radius: .75rem; font-size: .875rem; }

/* Intrinsic sizes must not make grid/flex children widen the page. */
.pd-shell, .specialist-desktop-shell, .manager-shell { max-width: 100%; }
.pd-shell, .specialist-desktop-shell, .manager-shell { grid-template-columns: 15.5rem minmax(0, 1fr); }
.pd-main, .manager-workspace, .manager-main, .specialist-desktop-workspace, .specialist-desktop-content { min-width: 0; overflow: visible; }
.pd-shell { grid-template-rows: auto minmax(0, 1fr); min-height: 100vh; }
.pd-topbar, .specialist-desktop-topbar, .manager-topbar { height: auto; flex-wrap: wrap; gap: .75rem; padding-block: .75rem; }
.pd-top-actions, .specialist-desktop-account, .manager-context, .clinic-actions, .specialist-clinic-actions, .manager-header-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: .5rem; min-width: 0; }
.pd-book, .specialist-desktop-calendar-link, .manager-header-add-visit { width: auto; min-width: 0; padding-block: .5rem; }
.pd-facility-name, .pd-notification-copy, .specialist-notifications-preview strong, .specialist-notifications-preview small { white-space: normal; overflow: visible; text-overflow: clip; }
/* Names, descriptions and contact details must remain readable in populated lists. */
.pd-facility-contact > strong, .pd-facility-contact > span,
.desktop-patient-contact strong, .desktop-patient-stats strong,
.specialist-dashboard-patient, .specialist-dashboard-service, .specialist-dashboard-place,
.specialist-dashboard-visit-main strong, .specialist-dashboard-visit-main span,
.specialist-calendar-notification-list strong, .specialist-calendar-notification-list small,
.specialist-calendar-range-value > span,
.specialist-calendar-visit-main strong, .specialist-calendar-visit-main span,
.specialist-patient-series-progress, .specialist-patient-documentation-main p,
.specialist-patient-qualification strong,
.specialist-patient-appointment-date strong, .specialist-patient-appointment-date span,
.specialist-patient-appointment-main strong, .specialist-patient-appointment-main span,
.specialist-profile-referral-link code,
.specialist-visits-date strong, .specialist-visits-date span,
.specialist-visits-patient, .specialist-visits-service, .specialist-visits-place,
.specialist-visits-unavailable {
  min-width: 0; white-space: normal; overflow: visible;
  text-overflow: clip; overflow-wrap: anywhere;
}
.specialist-calendar-notification-list article > div { flex-wrap: wrap; }
.specialist-calendar-range-value { height: auto; min-height: 2.5rem; padding-block: .5rem; }
.specialist-dashboard-next-details, .specialist-series-next-link,
.desktop-invitation-cancel, .manager-specialist-back-link,
.manager-calendar-availability-actions .manager-calendar-schedules-link,
.manager-configuration .manager-catalog .manager-service-back-link,
.specialist-visit-topline > .specialist-back-link, .specialist-visit-no-show {
  white-space: normal; overflow-wrap: anywhere;
}
.pd-global-primary-grid, .pd-global-lower-grid, .pd-empty-primary-grid, .pd-empty-lower-grid { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); height: auto; }
.pd-global-details { position: static; display: block; width: auto; margin-left: auto; }
.pd-global-nearest, .pd-global-plan, .pd-global-upcoming, .pd-global-facilities { height: auto; overflow: visible; }
.manager-sidebar { height: auto; min-height: 100vh; }
.manager-heading-help-trigger { width: 1.125rem; min-height: 1.125rem; }
.manager-heading-with-help { position: relative; }
.manager-heading-help { position: static; }
.manager-heading-help-tooltip { left: 0; right: auto; width: min(17.5rem, 100%); max-width: 100%; }
.specialist-calendar-header-count, .specialist-month-count { width: 2rem; min-height: 2rem; }

/* Tables alone may scroll horizontally. Pagination remains outside. */
.zreev-table-scroll, .desktop-table, .desktop-calendar-patient-table, .manager-dashboard-table-scroll, .desktop-notification-rules, .desktop-notification-history, .specialist-patients-table-wrap, .specialist-patient-treatment-series, .specialist-visits-list, .specialist-dashboard-day-plan {
  min-width: 0; max-width: 100%; overflow-x: auto;
}
.zreev-table-scroll > table { width: 100%; min-width: 40rem; }
.desktop-table > :is(.desktop-table-head, .desktop-table-row), .specialist-visits-list > *, .specialist-dashboard-table-head, .specialist-dashboard-visit { min-width: 48rem; }

/* Mobile preview frames also grow with their contents. */
.phone-frame, .specialist-frame, .manager-frame { max-width: 100%; max-height: none; overflow: visible; }
.phone-screen, .specialist-screen, .manager-screen { max-height: none; }

@media (max-width: 64rem) {
  .pd-shell, .specialist-desktop-shell, .manager-shell { grid-template-columns: minmax(0, 1fr); }
  .pd-sidebar { grid-row: auto; }
  .pd-topbar, .pd-main { grid-column: 1; }
  .manager-sidebar { position: static; height: auto; }
  .pd-main, .specialist-desktop-content, .manager-main { padding-inline: 1rem; }
  .pd-global-primary-grid, .pd-global-lower-grid, .pd-empty-primary-grid, .pd-empty-lower-grid, .specialist-dashboard-columns, .manager-calendar-workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .pd-topbar, .specialist-desktop-topbar, .manager-topbar { padding-inline: 1rem; }
  .pd-steps, .pd-empty-journey, .pd-therapy-counts { grid-template-columns: minmax(0, 1fr); }
  .pd-notification-row, .pd-global-notification-row, .pd-empty-welcome, .specialist-notifications-preview article { grid-template-columns: 1.5rem minmax(0, 1fr) 1.75rem; }
  .pd-notification-copy, .pd-global-notification-row > span, .pd-empty-welcome > span, .specialist-notifications-preview small { grid-column: 2; }
}
