/**
 * MF Suite — Paragraph Feedback, the reader's panel (divb-hq#51).
 *
 * Round 1's variant 06 of `design/absatz-feedback-entwuerfe.html`, with round 4's lighter
 * reading line, the eye's tint (E1) and the margin note (P1). Values are the blog's own:
 * ink #111, grey #636363, hairline #e5e5e5, 4px radius; system fonts only.
 *
 * The dock sits inside the post content for the tab order, where the constrained layout gives
 * every child margins and a max-width with !important; the doubled class wins that back.
 */

.mf-pf-line,
.mf-pf-dock.mf-pf-dock,
.mf-pf-hair {
	position: fixed;
	z-index: 60;
	margin: 0 !important;
	max-width: none !important;
}

/* The reading line: dashed, light, the label at its right end (D11). */
.mf-pf-line {
	height: 0;
	border-top: 1px dashed #d6d9e0;
	pointer-events: none;
}

.mf-pf-line__label {
	position: absolute;
	right: 0;
	top: -18px;
	font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	color: #767676;
}

/* The block the panel speaks about. */
.mf-pf-hair {
	width: 2px;
	background: #111;
	pointer-events: none;
}

.mf-pf-dock.mf-pf-dock {
	width: 250px;
	font: 400 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: #111;
}

.mf-pf-line[hidden],
.mf-pf-dock[hidden],
.mf-pf-hair[hidden],
.mf-pf-note[hidden],
.mf-pf-dock__panel[hidden],
.mf-pf-note__comments[hidden] {
	display: none;
}

.mf-pf-dock__buttons {
	display: inline-flex;
	flex-direction: column;
	gap: 2px;
	padding: 3px;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	box-shadow: 0 2px 10px rgba(17, 17, 17, 0.08);
}

.mf-pf-dock__button {
	position: relative;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 3px;
	background: transparent;
	color: #636363;
	cursor: pointer;
}

.mf-pf-dock__button:hover {
	background: #f3f3f3;
	color: #111;
}

.mf-pf-dock__button svg {
	display: block;
	width: 18px;
	height: 18px;
}

.mf-pf-dock__button[data-action="up"][aria-pressed="true"],
.mf-pf-dock__button[data-action="down"][aria-pressed="true"] {
	background: #1d4f99;
	color: #fff;
}

/* The deeper brand orange: white on #e35205 is 3.84:1, on #c24504 5.06:1. */
.mf-pf-dock__button[data-action="mark"][aria-pressed="true"] {
	background: #c24504;
	color: #fff;
}

.mf-pf-dock__button[data-action="eye"][aria-pressed="true"] {
	background: #111;
	color: #fff;
}

.mf-pf-dock__button[aria-expanded="true"] {
	background: #ececec;
	color: #111;
}

/* The reader's own comment in this tab: a dot, nothing else (D13). */
.mf-pf-dock__button--dot::after {
	content: "";
	position: absolute;
	top: 5px;
	right: 4px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #1d4f99;
}

.mf-pf-dock__sep {
	display: block;
	height: 1px;
	margin: 3px 4px;
	background: #e5e5e5;
}

.mf-pf-dock__panel {
	margin-top: 8px;
	padding: 10px;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba(17, 17, 17, 0.1);
}

.mf-pf-dock__label {
	display: grid;
	gap: 6px;
	font-weight: 600;
}

.mf-pf-dock__label textarea {
	min-height: 70px;
	padding: 6px 8px;
	border: 1px solid #c9c9c9;
	border-radius: 3px;
	font: 400 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: #111;
	resize: vertical;
}

.mf-pf-dock__hint,
.mf-pf-dock__status {
	margin: 8px 0 0;
	font-size: 12px;
	color: #636363;
}

.mf-pf-dock__status:empty {
	display: none;
}

.mf-pf-dock__send {
	margin-top: 8px;
	padding: 6px 12px;
	border: 0;
	border-radius: 3px;
	background: #111;
	color: #fff;
	font-weight: 600;
	cursor: pointer;
}

.mf-pf-dock__send:disabled {
	background: #9a9a9a;
	cursor: not-allowed;
}

/* The reader's own highlight, remembered on this device (D14). */
.mf-pf-own {
	position: relative;
}

.mf-pf-own::after {
	content: "";
	position: absolute;
	left: -14px;
	top: 3px;
	bottom: 3px;
	width: 3px;
	border-radius: 2px;
	background: #e35205;
}

/* The eye: every block one can react to (E1). A code box keeps its own ground. */
.mf-pf-eye .mf-pf-unit {
	border-radius: 2px;
	background: #f1f4f9;
	box-shadow: 0 0 0 8px #f1f4f9;
}

.mf-pf-eye .mf-pf-unit.enlighter-default {
	background: revert;
	box-shadow: 0 0 0 8px #f1f4f9, 0 0 0 9px #e5e5e5;
}

/* The public margin notes (D12), in document coordinates. */
.mf-pf-notes {
	position: absolute;
	top: 0;
	left: 0;
	width: 0;
	height: 0;
}

/*
 * Above the reading line and on the page's own ground: when the line passes a note, the note
 * stays legible instead of being crossed out by it.
 */
.mf-pf-note {
	position: absolute;
	z-index: 61;
	display: grid;
	gap: 2px;
	padding: 2px 4px;
	margin-left: -4px;
	border-radius: 3px;
	background: var(--wp--preset--color--base, #fff);
	font: 400 12px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: #636363;
}

.mf-pf-note__open {
	justify-self: start;
	padding: 0;
	border: 0;
	background: none;
	color: #1d4f99;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.mf-pf-note__comments {
	box-sizing: border-box;
	max-width: 250px;
	margin-top: 6px;
	padding: 12px;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba(17, 17, 17, 0.1);
}

.mf-pf-note__heading {
	margin: 0 0 8px;
	font-weight: 600;
}

.mf-pf-note__comment {
	margin: 0 0 10px;
	font-size: 13.5px;
	line-height: 1.5;
	color: #111;
}

.mf-pf-note__who {
	display: block;
	margin-bottom: 2px;
	font-size: 11.5px;
	color: #636363;
}

.mf-pf-dock__button:focus-visible,
.mf-pf-dock__send:focus-visible,
.mf-pf-note__open:focus-visible,
.mf-pf-dock__label textarea:focus-visible {
	outline: 2px solid #1d4f99;
	outline-offset: 2px;
}

@media print {

	.mf-pf-line,
	.mf-pf-dock,
	.mf-pf-hair,
	.mf-pf-notes {
		display: none !important;
	}
}
