/* Shared by the grid and dashboard. Keep modal layers above focused panels,
   then keep their floating controls above the modal. SweetAlert stays highest. */
:root {
	--tt-modal-layer: 100000;
	--tt-secondary-modal-layer: 100005;
	--tt-popup-control-layer: 100010;
}
body .modal { z-index: var(--tt-modal-layer) !important; }
body #modal-event.modal { z-index: var(--tt-secondary-modal-layer) !important; }
body .modal-backdrop { z-index: calc(var(--tt-modal-layer) - 10) !important; }
/* Keep the calendar visible below the side panels while its planner is open. */
body #quick-view-modal.quick-view-behind-planner {
	z-index: 104 !important;
	display: block !important;
	opacity: 1 !important;
}

/* Inline dialogs retain their parent, delegated handlers and form state.
   Raise the containing panel so its stacking context cannot trap the dialog. */
body :is(#side-overlay, #peoplePanel, #planListsPanel):has(.modal.in, .modal.modalShow) {
	z-index: var(--tt-modal-layer) !important;
}
body .popover,
body .datepicker-dropdown,
body .tt-time-popup,
body > .select2-container--open,
body [data-tippy-root],
body .colorpicker.dropdown-menu,
body .mfp-wrap { z-index: var(--tt-popup-control-layer) !important; }
body .mfp-bg { z-index: calc(var(--tt-popup-control-layer) - 1) !important; }
body .swal2-container { z-index: 1000005 !important; }

button.tt-profile-photo-link { border: 0; font: inherit; color: inherit; cursor: zoom-in; }
button.tt-profile-photo-link:not(.img-thumb) { padding: 0; background: transparent; }
.bigprofilepic > button.tt-profile-photo-link { display: block; width: 100%; height: 100%; }
body .swal2-popup.tt-profile-photo-popup { width: min(960px, calc(100vw - 32px)); padding: 32px 16px 16px; }
body .tt-profile-photo-popup .swal2-image {
	justify-self: center;
	min-width: 0;
	max-width: 100%;
	max-height: calc(100vh - 120px);
	max-height: calc(100dvh - 120px);
	object-fit: contain;
	margin: 0;
}
