.mf-panel {
	position: relative;
	border: var(--mf-border);
	background: var(--mf-color-surface);
	padding: var(--mf-space-3);

	/* Sits on the border rather than outside it, so no host has to leave room for it. */
	&::before {
		content: "";
		position: absolute;
		top: calc(var(--mf-border-width) * -1);
		left: calc(var(--mf-border-width) * -1);
		width: 10px;
		height: 10px;
		border-top: 2px solid var(--mf-color-accent);
		border-left: 2px solid var(--mf-color-accent);
		pointer-events: none;
	}

	/* All four corners already marked: the default one would only thicken this one. */
	&.mf-brackets::before {
		display: none;
	}
}

/* One line while the title and the chip both fit, two when they stop. The chip is
   held right by its own margin: space-between would not survive the wrap.

   No rule under it: a line there reads as closing what came before rather than opening
   the body. Sections are told apart by the line BETWEEN them instead. */
.mf-panel-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--mf-space-3);
	min-width: 0;
	margin-bottom: var(--mf-space-3);
}

/* The loudest chrome on a surface: small and amber over muted labels. Casing is a
   visual effect — titles are authored in sentence case. */
.mf-panel-title {
	color: var(--mf-color-accent);
	font-size: var(--mf-font-size-tiny);
	font-weight: var(--mf-font-weight-strong);
	letter-spacing: var(--mf-track-heading);
	text-transform: uppercase;

	/* The comment marker is decoration, so a title stays plain words in the code. */
	&::before {
		content: "// ";
		color: var(--mf-color-accent-dim);
	}
}

.mf-panel-chip {
	flex: 0 1 auto;
	min-width: 0;
	max-width: 100%;
	margin-inline-start: auto;

	&:empty {
		display: none;
	}
}

.mf-panel-body {
	color: var(--mf-color-text);
}
