/* Shared dialog move/resize affordances for native <dialog> windows. */
.dialog-window-resizable {
	margin: auto;
	/* Clamp the default (un-dragged) centering box to the safe display area so the
	   title bar/close button never lands under a notch, Dynamic Island, or
	   home-indicator strip on iOS devices. See shared/lib/css/style.css for the
	   --safe-area-inset-* custom properties, and dialog-window-controls.js for the
	   matching clamps applied while dragging/resizing. */
	left: var(--safe-area-inset-left, 0px);
	right: var(--safe-area-inset-right, 0px);
	top: var(--safe-area-inset-top, 0px);
	bottom: var(--safe-area-inset-bottom, 0px);
	max-width: calc(100vw - var(--safe-area-inset-left, 0px) - var(--safe-area-inset-right, 0px));
	max-height: calc(100dvh - var(--safe-area-inset-top, 0px) - var(--safe-area-inset-bottom, 0px));
}

/* Opt-in via DialogWindowControls.init({ fillViewportQuery }). Overrides inline
   default/restored geometry so the dialog spans the safe display area. */
.dialog-window-resizable.dialog-window-filled {
	inset: var(--safe-area-inset-top, 0px) auto auto var(--safe-area-inset-left, 0px) !important;
	width: calc(100vw - var(--safe-area-inset-left, 0px) - var(--safe-area-inset-right, 0px)) !important;
	height: calc(100dvh - var(--safe-area-inset-top, 0px) - var(--safe-area-inset-bottom, 0px)) !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	transform: none !important;
	border-radius: 0;
}

.dialog-window-filled .dialog-drag-handle {
	cursor: default !important;
}

.dialog-window-filled :is(.dialog-resize-handle-x, .dialog-resize-handle-y, .dialog-resize-handle-both) {
	display: none;
}

.dialog-resize-handle-x {
	position: absolute;
	right: 0;
	top: 0;
	width: 14px;
	height: calc(100% - 26px);
	cursor: ew-resize;
	background: transparent;
	border: 0;
	opacity: 1;
}

.dialog-resize-handle-x::before {
	content: '';
	position: absolute;
	right: 0;
	top: 50%;
	width: 3px;
	height: 64px;
	transform: translateY(-50%);
	border-radius: 999px;
	/*background: rgba(148, 163, 184, 0.45);*/
}

.dialog-resize-handle-y {
	position: absolute;
	left: 0;
	bottom: 0;
	width: calc(100% - 26px);
	height: 14px;
	cursor: ns-resize;
	background: transparent;
	border: 0;
	opacity: 1;
}

.dialog-resize-handle-y::before {
	content: '';
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 64px;
	height: 3px;
	transform: translateX(-50%);
	border-radius: 999px;
	/*background: rgba(148, 163, 184, 0.45);*/
}

.dialog-resize-handle-both {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 24px;
	height: 24px;
	cursor: nwse-resize;
	background: transparent;
	border: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

.dialog-resize-handle-both::before {
	content: '';
	width: 14px;
	height: 14px;
	/*border-right: 2px solid rgba(100, 116, 139, 0.55);
	border-bottom: 2px solid rgba(100, 116, 139, 0.55);*/
	border-radius: 0 0 10px 0;
	transform: translate(2px, 2px);
}

.dialog-resize-handle-both::after {
	content: '';
	position: absolute;
	width: 8px;
	height: 8px;
	right: 3px;
	bottom: 3px;
	/*border-right: 2px solid rgba(148, 163, 184, 0.45);
	border-bottom: 2px solid rgba(148, 163, 184, 0.45);*/
	border-radius: 0 0 6px 0;
}
