.cpu-tl-tooltip-trigger,
.cpu-tl-auto-link,
.cpu-tl-tooltip-link {
	text-decoration-line: underline !important;
	text-decoration-color: currentColor !important;
	text-underline-offset: 0.16em;
	text-decoration-thickness: auto;
	outline-offset: 2px;
}

.cpu-tl-tooltip-trigger {
	text-decoration-style: dotted !important;
	cursor: help;
}

.cpu-tl-auto-link {
	text-decoration-style: solid !important;
	font-weight: inherit !important;
}

.cpu-tl-tooltip-link {
	text-decoration-style: double !important;
	font-weight: inherit !important;
}

/* Colours: Tooltips & Links > Settings > How tooltips look. */
.cpu-tl-tooltip-box,
.cpu-tl-style-light {
	--cpu-tl-bg: #fff;
	--cpu-tl-fg: #222;
	--cpu-tl-border: #d3d3d3;
	--cpu-tl-link: inherit;
}

.cpu-tl-style-dark {
	--cpu-tl-bg: #222;
	--cpu-tl-fg: #fff;
	--cpu-tl-border: #222;
	--cpu-tl-link: #fff;
}

.cpu-tl-style-yellow {
	--cpu-tl-bg: #fff9c4;
	--cpu-tl-fg: #3a3000;
	--cpu-tl-border: #e6d36b;
	--cpu-tl-link: #3a3000;
}

.cpu-tl-style-green {
	--cpu-tl-bg: #e8f5e9;
	--cpu-tl-fg: #12361a;
	--cpu-tl-border: #8bc391;
	--cpu-tl-link: #12361a;
}

/* The theme's own colours where it declares them (block and modern themes). */
.cpu-tl-style-theme {
	--cpu-tl-bg: var(--wp--preset--color--base, var(--wp--preset--color--background, #fff));
	--cpu-tl-fg: var(--wp--preset--color--contrast, var(--wp--preset--color--foreground, #222));
	--cpu-tl-border: currentColor;
	--cpu-tl-link: inherit;
}

.cpu-tl-tooltip-box {
	position: fixed;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	max-width: min(32rem, calc(100vw - 2rem));
	max-height: min(24rem, calc(100vh - 2rem));
	overflow: hidden;
	box-sizing: border-box;
	border: 1px solid var(--cpu-tl-border);
	border-radius: 4px;
	background: var(--cpu-tl-bg);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
	color: var(--cpu-tl-fg);
	font: inherit;
	font-size: 0.95em;
	line-height: 1.45;
}

.cpu-tl-tooltip-body {
	min-height: 0;
	overflow: auto;
	box-sizing: border-box;
	padding: 0.65rem 0.8rem;
}

.cpu-tl-tooltip-footer {
	flex: 0 0 auto;
	box-sizing: border-box;
	padding: 0.55rem 0.8rem;
	border-top: 1px solid var(--cpu-tl-border);
	font-weight: 600;
}

.cpu-tl-tooltip-footer-link {
	color: var(--cpu-tl-link) !important;
	text-decoration: underline !important;
	text-decoration-style: solid !important;
	text-underline-offset: 0.14em;
	font-weight: inherit !important;
}

.cpu-tl-tooltip-box[hidden] {
	display: none !important;
}

.cpu-tl-tooltip-body > :first-child {
	margin-top: 0;
}

.cpu-tl-tooltip-body > :last-child {
	margin-bottom: 0;
}

/* Phones: a wider box, with room to tap the footer link. */
@media (max-width: 600px) {
	.cpu-tl-tooltip-box {
		max-width: calc(100vw - 1rem);
	}

	.cpu-tl-tooltip-footer {
		padding: 0.75rem 0.8rem;
	}
}

@media (forced-colors: active) {
	.cpu-tl-tooltip-box {
		border: 1px solid CanvasText;
		background: Canvas;
		color: CanvasText;
	}
}
