/* Shared mobile input rules; loaded after every module stylesheet. */
@media (max-width: 1024px), (pointer: coarse) {
	/* Includes new/edit notes, account, mail and document rich editors. Keep zoom available. */
	body.rcg-private-page :is(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]):not([type="reset"]), textarea, select, [contenteditable="true"], [contenteditable="plaintext-only"]) {
		box-sizing: border-box;
		min-width: 0;
		max-width: 100%;
		font-size: max(16px, 1em) !important;
		scroll-margin-block: 24px;
	}
	body.rcg-private-page :is(.rcg-field, .rcg2-note-field, .rcg2-profile-field, fieldset) {
		min-width: 0;
	}
	body.rcg-private-page :is(textarea, [contenteditable="true"], [contenteditable="plaintext-only"]) {
		overflow-wrap: anywhere;
	}
	body.rcg-private-page :is(.rcg2-app dialog, dialog) {
		box-sizing: border-box;
		max-width: calc(100vw - 24px);
		max-height: calc(100vh - 24px);
		max-height: calc(var(--rcg-visible-height, 100dvh) - 24px);
		overflow-y: auto;
	}
	/* A tall minimum otherwise wins over the maximum when little height remains. */
	body.rcg-private-page .rcg-messaging__panel { min-height: 0; }
	.rcg-keyboard-open body.rcg-private-page dialog[open] {
		position: fixed;
		top: calc(var(--rcg-visible-top, 0px) + 8px);
		bottom: auto;
		margin-block: 0;
		max-height: calc(var(--rcg-visible-height, 100dvh) - 16px);
	}
	.rcg-keyboard-open .rcg2-app .rcg2-profile-panel {
		position: fixed;
		top: calc(var(--rcg-visible-top, 0px) + 8px);
		bottom: auto;
		max-height: calc(var(--rcg-visible-height, 100dvh) - 16px);
		overflow-y: auto;
	}
	.rcg-keyboard-open body.rcg-private-page :is(.rcg-messaging__windows, .rcg-messaging__panel) {
		top: auto;
		bottom: calc(var(--rcg-keyboard-bottom, 0px) + 8px);
		max-height: calc(var(--rcg-visible-height, 100dvh) - 16px);
	}
	.rcg-keyboard-open body.rcg-private-page .rcg-messaging__chat:not(.is-minimized) {
		height: calc(var(--rcg-visible-height, 100dvh) - 16px);
		min-height: 0;
		max-height: 680px;
		overflow-y: auto;
	}
	.rcg-keyboard-open body.rcg-private-page .rcg-messaging__composer textarea {
		max-height: min(112px, max(42px, calc(var(--rcg-visible-height, 100dvh) - 160px)));
	}
	.rcg-keyboard-open body.rcg-private-page .rcg-messaging__dialog-overlay {
		top: var(--rcg-visible-top, 0px);
		bottom: auto;
		height: var(--rcg-visible-height, 100dvh);
	}
	.rcg-keyboard-open body.rcg-private-page .rcg-messaging__dialog {
		max-height: calc(var(--rcg-visible-height, 100dvh) - 16px);
		overflow-y: auto;
	}
	.rcg-keyboard-open :is(.rcg2-mobile-nav, .rcg-messaging__launcher, .rcg-messaging__online-rail) {
		visibility: hidden;
		pointer-events: none;
	}
}

/* Vie locale already becomes stacked cards at this breakpoint. The generic
   table minimum must not force those cards to remain 640px wide. */
@media (max-width: 782px) {
	body.rcg-private-page .rcg2-app .rcg-poi-table {
		min-width: 0;
	}
}
