.tmfp {
	--tmfp-green: #173f35;
	--tmfp-green-soft: #e9efec;
	--tmfp-brown: #914915;
	--tmfp-olive: #78805d;
	--tmfp-beige: #F3EEE8;
	--tmfp-line: #dedbd4;
	--tmfp-text: #1f2724;
	--tmfp-muted: #6b716e;
	--tmfp-white: #ffffff;
	--tmfp-preview-size: clamp(2.6rem, 5vw, 3.8rem);

	color: var(--tmfp-text);
	font-family: Inter, Arial, sans-serif;
	font-size: 16px;
	width: 100%;
}

.tmfp--size-small {
	--tmfp-preview-size: clamp(1.8rem, 3.5vw, 2.5rem);
}

.tmfp--size-medium {
	--tmfp-preview-size: clamp(2.6rem, 5vw, 3.8rem);
}

.tmfp--size-large {
	--tmfp-preview-size: clamp(3.5rem, 7vw, 5.4rem);
}

.tmfp *,
.tmfp *::before,
.tmfp *::after {
	box-sizing: border-box;
}

.tmfp__controls {
	background: var(--tmfp-beige);
	border: 0;
	border-radius: 14px;
	display: grid;
	gap: 22px 28px;
	grid-template-areas:
		"field field"
		"category size";
	grid-template-columns: minmax(0, 1fr) auto;
	padding: clamp(18px, 3vw, 28px);
}

.tmfp__field {
	grid-area: field;
	max-width: 760px;
}

.tmfp__label,
.tmfp__size-label,
.tmfp__category-label {
	color: var(--tmfp-green);
	font-size: 16px;
	font-weight: 700;
}

.tmfp__label {
	display: block;
	margin: 0 0 8px;
}

.tmfp .tmfp__input[type="text"] {
	appearance: none;
	background: #ffffff;
	border: 1px solid #D9D9D6;
	border-radius: 8px;
	box-shadow: none;
	color: var(--tmfp-text);
	font: inherit;
	font-size: 1rem;
	line-height: 1.4;
	min-height: 50px;
	padding: 12px 14px;
	transition: border-color 160ms ease, box-shadow 160ms ease;
	width: 100%;
}

.tmfp .tmfp__input[type="text"]:focus {
	background: #ffffff;
	border-color: var(--tmfp-green);
	box-shadow: 0 0 0 3px rgba(23, 63, 53, 0.10);
	outline: none;
}

.tmfp__privacy {
	color: var(--tmfp-muted);
	font-size: 14px;
	line-height: 1.45;
	margin: 7px 0 0;
}

.tmfp__size-control {
	align-items: center;
	align-self: start;
	display: flex;
	gap: 12px;
	grid-area: size;
	margin: 0;
	min-width: max-content;
}

.tmfp__size-label,
.tmfp__category-label {
	display: block;
	flex: 0 0 auto;
	margin: 0;
}

.tmfp__sizes {
	align-items: center;
	background: rgba(255, 255, 255, 0.56);
	border: 1px solid #d6d1c8;
	border-radius: 8px;
	display: inline-flex;
	overflow: hidden;
}

.tmfp__size {
	appearance: none;
	background: transparent;
	border: 0;
	border-right: 1px solid #d6d1c8;
	color: var(--tmfp-muted);
	cursor: pointer;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	height: 34px;
	line-height: 1;
	min-width: 40px;
	padding: 0 10px;
}

.tmfp__size:last-child {
	border-right: 0;
}

.tmfp__size:hover {
	background: var(--tmfp-white);
	color: var(--tmfp-green);
}

.tmfp__size.is-active {
	background: var(--tmfp-green);
	color: var(--tmfp-white);
}

.tmfp__category-control {
	align-items: flex-start;
	display: grid;
	gap: 8px 12px;
	grid-area: category;
	grid-template-columns: auto minmax(0, 1fr);
	margin: 0;
	min-width: 0;
}

.tmfp__category-label {
	align-self: center;
	padding-top: 0;
}

.tmfp__categories {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	min-width: 0;
}

.tmfp__category {
	appearance: none;
	background: var(--tmfp-white);
	border: 1px solid #cfcac1;
	border-radius: 999px;
	color: var(--tmfp-green);
	cursor: pointer;
	flex: 0 0 auto;
	font: inherit;
	font-size: 16px;
	font-weight: 650;
	line-height: 1;
	padding: 10px 15px;
	transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.tmfp__category:hover {
	border-color: var(--tmfp-green);
}

.tmfp__category.is-active {
	background: var(--tmfp-green);
	border-color: var(--tmfp-green);
	color: var(--tmfp-white);
}

.tmfp__category-description {
	color: var(--tmfp-muted);
	font-size: 14px;
	grid-column: 2;
	line-height: 1.5;
	margin: 0;
	max-width: 760px;
}

.tmfp__category-description:empty {
	display: none;
}

.tmfp__font-list {
	border-top: 1px solid var(--tmfp-line);
	margin-top: 24px;
}

.tmfp__font {
	border-bottom: 1px solid var(--tmfp-line);
	padding: 22px 4px;
}

.tmfp__font[hidden] {
	display: none;
}

.tmfp__font-main {
	align-items: center;
	display: grid;
	gap: 8px;
	grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
}

.tmfp__font-name {
	color: var(--tmfp-muted);
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.02em;
	line-height: 1.3;
	margin: 0;
}

.tmfp__preview {
	color: var(--tmfp-green);
	font-size: var(--tmfp-preview-size);
	line-height: 1.25;
	margin: 0;
	min-width: 0;
	overflow-wrap: anywhere;
	transition: font-size 150ms ease;
}

.tmfp__font.is-loading .tmfp__preview {
	opacity: 0.45;
}

.tmfp__advice {
	color: var(--tmfp-olive);
	font-size: 14px;
	line-height: 1.45;
	margin: 10px 0 0 180px;
	padding-left: 8px;
}


.tmfp__font-actions {
	display: flex;
	justify-content: flex-end;
	margin: 12px 0 0 180px;
	padding-left: 8px;
}

.tmfp__download {
	appearance: none;
	background: #914915;
	border: 1px solid #914915;
	border-radius: 8px;
	color: #ffffff;
	cursor: pointer;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	min-height: 40px;
	padding: 10px 16px;
	transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

.tmfp__download:hover {
	background: #ffffff;
	border-color: #191F18;
	color: #191F18;
}

.tmfp__download:focus-visible {
	outline: 2px solid var(--tmfp-green);
	outline-offset: 2px;
}

.tmfp__download:disabled {
	cursor: wait;
	opacity: 0.55;
}

.tmfp__status {
	color: #9a3e32;
	font-size: 14px;
	line-height: 1.4;
	margin: 6px 0 0 180px;
	min-height: 0;
}

.tmfp__status:empty {
	display: none;
}

.tmfp-empty {
	background: var(--tmfp-beige, #F3EEE8);
	border: 1px solid var(--tmfp-line, #dedbd4);
	border-radius: 12px;
	color: var(--tmfp-text, #1f2724);
	padding: 18px 20px;
}

@media (max-width: 900px) {
	.tmfp__controls {
		display: block;
	}

	.tmfp__size-control {
		justify-content: space-between;
		margin-top: 18px;
	}

	.tmfp__category-control {
		display: block;
		margin-top: 24px;
		overflow: hidden;
	}

	.tmfp__category-label {
		margin-bottom: 8px;
		padding-top: 0;
	}

	.tmfp__categories {
		flex-wrap: nowrap;
		margin-left: -2px;
		overflow-x: auto;
		padding: 0 2px 8px;
		scrollbar-width: thin;
		-webkit-overflow-scrolling: touch;
	}

	.tmfp__category-description {
		margin-top: 2px;
	}
}

@media (max-width: 700px) {
	.tmfp--size-small {
		--tmfp-preview-size: clamp(1.7rem, 7vw, 2.2rem);
	}

	.tmfp--size-medium {
		--tmfp-preview-size: clamp(2.2rem, 9vw, 3rem);
	}

	.tmfp--size-large {
		--tmfp-preview-size: clamp(3rem, 12vw, 4rem);
	}

	.tmfp__font {
		padding: 20px 0;
	}

	.tmfp__font-main {
		display: block;
	}

	.tmfp__font-name {
		margin-bottom: 8px;
	}

	.tmfp__advice,
	
.tmfp__font-actions {
	display: flex;
	justify-content: flex-end;
	margin: 12px 0 0 180px;
	padding-left: 8px;
}

.tmfp__download {
	appearance: none;
	background: transparent;
	border: 1px solid var(--tmfp-brown);
	border-radius: 8px;
	color: var(--tmfp-brown);
	cursor: pointer;
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1;
	min-height: 34px;
	padding: 8px 12px;
	transition: background-color 150ms ease, color 150ms ease, opacity 150ms ease;
}

.tmfp__download:hover {
	background: var(--tmfp-brown);
	color: var(--tmfp-white);
}

.tmfp__download:focus-visible {
	outline: 2px solid var(--tmfp-green);
	outline-offset: 2px;
}

.tmfp__download:disabled {
	cursor: wait;
	opacity: 0.55;
}

.tmfp__status {
		margin-left: 0;
		padding-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tmfp__input,
	.tmfp__category,
	.tmfp__download,
	.tmfp__preview {
		transition: none;
	}
}
