/* Sticky "How can I help?" card — bottom-left, theme tokens. */

.mks-help {
	position: fixed;
	z-index: 90;
	left: clamp(12px, 1.6vw, 24px);
	bottom: calc(clamp(12px, 1.6vw, 24px) + env(safe-area-inset-bottom, 0px));
	font-family: var(--ff-s, "Fraunces", Georgia, serif);
	color: var(--ink, #181410);
}

.mks-help[hidden],
.mks-help [hidden] {
	display: none !important;
}

/* Mobile tool guides have a TOC button at the same corner: sit above it. */
.mks-help.has-toc-fab {
	bottom: calc(78px + env(safe-area-inset-bottom, 0px));
}

.mks-help__launcher {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 46px;
	padding: 0 18px 0 15px;
	border: 0;
	border-radius: 999px;
	background: var(--orange, #e84e0a);
	color: #fff;
	font-family: var(--ff-m, "Instrument Mono", monospace);
	font-size: 12px;
	letter-spacing: 0.04em;
	box-shadow: 0 10px 30px rgba(24, 20, 16, 0.28);
	cursor: pointer;
	transition: transform 0.2s var(--ease, ease), background 0.2s ease;
}

.mks-help__launcher:hover {
	transform: translateY(-2px);
	background: var(--orange-hot, #ff5c10);
}

.mks-help__launcher:focus-visible {
	outline: 2px solid var(--ink, #181410);
	outline-offset: 3px;
}

.mks-help__launcher svg {
	flex: none;
}

.mks-help.is-open .mks-help__launcher {
	display: none;
}

.mks-help__panel {
	width: min(300px, calc(100vw - 24px));
	padding: 18px 18px 16px;
	background: var(--white, #fdfaf4);
	border: 1px solid rgba(24, 20, 16, 0.14);
	border-top: 3px solid var(--orange, #e84e0a);
	box-shadow: 0 18px 48px rgba(24, 20, 16, 0.22);
	animation: mks-help-in 0.28s var(--ease, ease) both;
}

@keyframes mks-help-in {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.mks-help__panel { animation: none; }
	.mks-help__launcher { transition: none; }
}

.mks-help__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.mks-help__title {
	margin: 0;
	font-family: var(--ff-d, "Bebas Neue", sans-serif);
	font-size: 24px;
	line-height: 1;
	letter-spacing: 0.01em;
}

.mks-help__min {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin: -4px -6px 0 0;
	border: 0;
	background: transparent;
	color: var(--ink-muted, #625850);
	cursor: pointer;
}

.mks-help__min:hover {
	color: var(--ink, #181410);
}

.mks-help__sub {
	margin: 0 0 14px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--ink-mid, #3a3028);
}

.mks-help__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	min-height: 44px;
	margin-top: 8px;
	padding: 0 14px;
	border: 1px solid var(--ink, #181410);
	font-family: var(--ff-m, "Instrument Mono", monospace);
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}

.mks-help__btn--wa {
	background: #1f7a45;
	border-color: #1f7a45;
	color: #fff;
}

.mks-help__btn--wa:hover {
	background: #18623a;
	color: #fff;
}

.mks-help__btn--form {
	background: transparent;
	color: var(--ink, #181410);
}

.mks-help__btn--form:hover {
	background: var(--ink, #181410);
	color: var(--cream, #f4efe6);
}

.mks-help__label {
	display: block;
	margin-bottom: 10px;
	font-family: var(--ff-m, "Instrument Mono", monospace);
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--ink-muted, #625850);
}

.mks-help__label input,
.mks-help__label textarea {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin-top: 5px;
	padding: 9px 10px;
	border: 1px solid rgba(24, 20, 16, 0.25);
	border-radius: 0;
	background: #fff;
	color: var(--ink, #181410);
	font-family: var(--ff-s, "Fraunces", Georgia, serif);
	font-size: 15px;
	letter-spacing: 0;
	text-transform: none;
}

.mks-help__label textarea {
	resize: vertical;
	min-height: 70px;
}

.mks-help__label input:focus,
.mks-help__label textarea:focus {
	outline: 2px solid var(--orange, #e84e0a);
	outline-offset: 0;
	border-color: transparent;
}

.mks-help__label .is-invalid,
.mks-help__label input.is-invalid,
.mks-help__label textarea.is-invalid {
	border-color: var(--orange, #e84e0a);
}

.mks-help__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.mks-help__status {
	min-height: 0;
	margin: 0 0 8px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--orange-on-cream, #9a3808);
}

.mks-help__status:empty {
	display: none;
}

.mks-help__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.mks-help__link {
	padding: 6px 0;
	border: 0;
	background: none;
	color: var(--ink-muted, #625850);
	font-family: var(--ff-m, "Instrument Mono", monospace);
	font-size: 12px;
	text-decoration: underline;
	cursor: pointer;
}

.mks-help__submit {
	min-height: 42px;
	padding: 0 20px;
	border: 0;
	background: var(--orange, #e84e0a);
	color: #fff;
	font-family: var(--ff-m, "Instrument Mono", monospace);
	font-size: 12px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}

.mks-help__submit:hover {
	background: var(--orange-hot, #ff5c10);
}

.mks-help__submit[disabled] {
	opacity: 0.6;
	cursor: wait;
}

.mks-help__note {
	margin: 10px 0 0;
	font-size: 12px;
	line-height: 1.4;
	color: var(--ink-muted, #625850);
}

.mks-help__ok {
	margin: 4px 0 0;
	font-size: 15px;
	line-height: 1.5;
}

/* Phones: the launcher is a compact round button so it never covers reading space. */
@media (max-width: 640px) {
	.mks-help__launcher {
		width: 50px;
		height: 50px;
		padding: 0;
		justify-content: center;
	}

	.mks-help__launcher svg {
		width: 22px;
		height: 22px;
	}

	.mks-help__launcher-text {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}
}

@media print {
	.mks-help { display: none !important; }
}
