/* Conversor de Letras Bonitas — v1.1.0
 *
 * Nota: este widget vive dentro de temas que casi siempre traen sus propios
 * estilos para button, input y ul. Por eso las propiedades críticas (color y
 * fondo de los elementos interactivos) van con !important: sin eso, un tema
 * que pinta los botones con texto blanco deja los estilos invisibles.
 */

.fbc {
	--fbc-bg: #ffffff;
	--fbc-panel: #f6f6f9;
	--fbc-soft: #fbfbfd;
	--fbc-line: #e4e4ec;
	--fbc-text: #17171c;
	--fbc-muted: #6a6a76;
	--fbc-accent: #5b4bdb;
	--fbc-accent-soft: #efedfd;
	--fbc-ok: #157a45;
	--fbc-ok-soft: #e7f7ee;
	--fbc-radius: 14px;

	display: block;
	color: var(--fbc-text, #17171c);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
	max-width: 100%;
	margin: 0 0 2rem;
	-webkit-text-size-adjust: 100%;
}

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

/* ---------- Reset defensivo contra el tema ---------- */

.fbc button {
	display: inline-flex;
	align-items: center;
	margin: 0;
	font: inherit;
	font-size: inherit;
	line-height: 1.4;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	box-shadow: none;
	border: 0;
	border-radius: 0;
	background: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: none;
}

.fbc button:hover,
.fbc button:focus,
.fbc button:active {
	box-shadow: none;
	text-shadow: none;
	text-decoration: none;
	transform: none;
}

.fbc button::after,
.fbc button::before {
	content: none;
}

.fbc input,
.fbc textarea {
	font: inherit;
	font-size: inherit;
	line-height: 1.45;
	margin: 0;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.fbc ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.fbc ul li::before,
.fbc ul li::marker {
	content: none;
}

/* ---------- Panel de entrada ---------- */

.fbc__panel {
	background: var(--fbc-panel, #f6f6f9);
	border: 1px solid var(--fbc-line, #e4e4ec);
	border-radius: var(--fbc-radius, 14px);
	padding: 16px;
}

.fbc__title {
	margin: 0 0 4px;
	font-size: 1.06rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--fbc-text, #17171c);
}

.fbc__subtitle {
	margin: 0 0 14px;
	font-size: 0.9rem;
	color: var(--fbc-muted, #6a6a76);
}

.fbc__label {
	display: block;
	margin-bottom: 6px;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fbc-muted, #6a6a76);
}

.fbc__inputwrap {
	position: relative;
}

.fbc__input {
	display: block;
	width: 100%;
	min-height: 62px;
	padding: 13px 88px 13px 14px;
	font-size: 1.06rem;
	color: var(--fbc-text, #17171c) !important;
	background: var(--fbc-bg, #ffffff) !important;
	border: 1px solid var(--fbc-line, #e4e4ec);
	border-radius: 11px;
	resize: vertical;
}

.fbc__input:focus {
	outline: 2px solid var(--fbc-accent, #5b4bdb);
	outline-offset: 1px;
	border-color: var(--fbc-accent, #5b4bdb);
}

.fbc__clear {
	position: absolute;
	top: 9px;
	right: 9px;
	justify-content: center;
	padding: 8px 13px;
	min-height: 36px;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--fbc-muted, #6a6a76) !important;
	background: var(--fbc-panel, #f6f6f9) !important;
	border: 1px solid var(--fbc-line, #e4e4ec);
	border-radius: 9px;
}

.fbc__clear:hover {
	color: var(--fbc-text, #17171c) !important;
	border-color: var(--fbc-muted, #6a6a76);
}

.fbc__help {
	margin: 9px 0 0;
	font-size: 0.82rem;
	color: var(--fbc-muted, #6a6a76);
}

.fbc__notice {
	margin: 12px 0 0;
	padding: 11px 13px;
	font-size: 0.86rem;
	line-height: 1.45;
	color: #5c4405;
	background: #fff8e4;
	border: 1px solid #efdca6;
	border-radius: 11px;
}

.fbc__notice strong {
	color: #5c4405;
}

/* ---------- Buscador y favoritos ---------- */

.fbc__tools {
	display: flex;
	gap: 8px;
	margin-top: 14px;
}

.fbc__search {
	flex: 1 1 auto;
	min-width: 0;
}

.fbc__searchinput {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 10px 13px;
	font-size: 0.94rem;
	color: var(--fbc-text, #17171c) !important;
	background: var(--fbc-bg, #ffffff) !important;
	border: 1px solid var(--fbc-line, #e4e4ec);
	border-radius: 11px;
}

.fbc__searchinput:focus {
	outline: 2px solid var(--fbc-accent, #5b4bdb);
	outline-offset: 1px;
}

.fbc__fav {
	flex: 0 0 auto;
	justify-content: center;
	gap: 5px;
	min-height: 44px;
	padding: 10px 15px;
	font-size: 0.88rem;
	font-weight: 600;
	white-space: nowrap;
	color: var(--fbc-muted, #6a6a76) !important;
	background: var(--fbc-bg, #ffffff) !important;
	border: 1px solid var(--fbc-line, #e4e4ec);
	border-radius: 11px;
}

.fbc__fav[aria-pressed="true"] {
	color: var(--fbc-accent, #5b4bdb) !important;
	background: var(--fbc-accent-soft, #efedfd) !important;
	border-color: var(--fbc-accent, #5b4bdb);
}

/* ---------- Categorías ---------- */

.fbc__cats {
	display: flex;
	gap: 6px;
	margin-top: 12px;
	padding-bottom: 4px;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.fbc__cats::-webkit-scrollbar {
	display: none;
}

.fbc__cat {
	flex: 0 0 auto;
	justify-content: center;
	min-height: 40px;
	padding: 9px 15px;
	font-size: 0.87rem;
	font-weight: 500;
	white-space: nowrap;
	color: var(--fbc-muted, #6a6a76) !important;
	background: var(--fbc-bg, #ffffff) !important;
	border: 1px solid var(--fbc-line, #e4e4ec);
	border-radius: 999px;
}

.fbc__cat:hover {
	color: var(--fbc-text, #17171c) !important;
	border-color: var(--fbc-muted, #6a6a76);
}

.fbc__cat.is-active {
	color: #ffffff !important;
	background: var(--fbc-accent, #5b4bdb) !important;
	border-color: var(--fbc-accent, #5b4bdb);
	font-weight: 700;
}

.fbc__count {
	margin: 12px 0 0;
	font-size: 0.8rem;
	color: var(--fbc-muted, #6a6a76);
}

/* ---------- Lista de estilos ---------- */

.fbc__list {
	display: grid;
	gap: 8px;
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
}

.fbc__item {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas:
		"meta star"
		"result result";
	gap: 7px 8px;
	padding: 12px;
	background: var(--fbc-bg, #ffffff);
	border: 1px solid var(--fbc-line, #e4e4ec);
	border-radius: var(--fbc-radius, 14px);
	/* Saca del cálculo de layout las tarjetas fuera de pantalla. */
	content-visibility: auto;
	contain-intrinsic-size: auto 112px;
}

.fbc__item.is-hidden,
.fbc__item.is-filtered {
	display: none;
}

/*
 * Los hijos de un grid llevan min-width: auto por defecto, así que se niegan
 * a encogerse por debajo de su contenido y el texto se sale de la tarjeta.
 * En móvil, con estilos largos, se notaba mucho.
 */
.fbc__item > * {
	min-width: 0;
	max-width: 100%;
}

.fbc__meta {
	grid-area: meta;
	display: flex;
	align-items: center;
	gap: 7px;
	flex-wrap: wrap;
	min-width: 0;
}

.fbc__name {
	font-size: 0.71rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fbc-muted, #6a6a76);
}

.fbc__badge {
	padding: 2px 7px;
	font-size: 0.63rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	white-space: nowrap;
	border-radius: 999px;
}

.fbc__badge--media {
	color: #7d5100;
	background: #fff3dd;
}

.fbc__badge--baja {
	color: #8f2429;
	background: #fdeaea;
}

/* --- El resultado: lo más visible de la tarjeta --- */

.fbc__result {
	grid-area: result;
	min-width: 0;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	min-height: 54px;
	padding: 12px 13px;
	text-align: left;
	color: var(--fbc-text, #17171c) !important;
	background: var(--fbc-soft, #fbfbfd) !important;
	border: 1px solid var(--fbc-line, #e4e4ec);
	border-radius: 11px;
	transition: border-color 0.12s, background-color 0.12s;
}

.fbc__result:hover,
.fbc__result:focus-visible {
	color: var(--fbc-text, #17171c) !important;
	background: var(--fbc-accent-soft, #efedfd) !important;
	border-color: var(--fbc-accent, #5b4bdb);
	outline: none;
}

.fbc__out {
	flex: 1 1 auto;
	min-width: 0;
	font-size: 1.18rem;
	/*
	 * Las marcas combinantes (tachado, subrayado, virgulilla) se dibujan
	 * fuera de la caja de la letra. Con una interlínea corta se montaban
	 * sobre la línea de arriba y sobre la de abajo.
	 */
	line-height: 1.9;
	padding: 2px 0;
	color: var(--fbc-text, #17171c);
	word-break: break-word;
	overflow-wrap: anywhere;
	/* Fuentes que cubren Mathematical Alphanumeric Symbols en cada sistema. */
	font-family: "Segoe UI Symbol", "Apple Symbols", "Cambria Math",
		"Noto Sans Symbols 2", "Noto Sans Math", "DejaVu Sans", sans-serif;
}

.fbc__copyicon {
	flex: 0 0 auto;
	padding: 5px 10px;
	font-family: inherit;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fbc-accent, #5b4bdb);
	background: var(--fbc-accent-soft, #efedfd);
	border-radius: 999px;
}

/* En escritorio la etiqueta aparece al pasar por encima; en móvil, siempre. */
@media (hover: hover) and (pointer: fine) {
	.fbc__copyicon {
		opacity: 0;
		transition: opacity 0.12s;
	}

	.fbc__result:hover .fbc__copyicon,
	.fbc__result:focus-visible .fbc__copyicon {
		opacity: 1;
	}
}

.fbc__item.is-copied .fbc__result {
	background: var(--fbc-ok-soft, #e7f7ee) !important;
	border-color: var(--fbc-ok, #157a45);
}

.fbc__item.is-copied .fbc__copyicon {
	opacity: 1;
	color: #ffffff;
	background: var(--fbc-ok, #157a45);
}

.fbc__star {
	grid-area: star;
	justify-content: center;
	min-width: 36px;
	min-height: 36px;
	padding: 0 5px;
	font-size: 1.08rem;
	line-height: 1;
	color: #c8c8d4 !important;
	background: none !important;
	border-radius: 8px;
}

.fbc__star:hover,
.fbc__star[aria-pressed="true"] {
	color: #f0a500 !important;
}

/* ---------- Pie ---------- */

.fbc__more {
	justify-content: center;
	width: 100%;
	min-height: 50px;
	margin-top: 12px;
	padding: 13px;
	font-size: 0.94rem;
	font-weight: 700;
	color: var(--fbc-accent, #5b4bdb) !important;
	background: var(--fbc-accent-soft, #efedfd) !important;
	border: 1px solid var(--fbc-accent, #5b4bdb);
	border-radius: 11px;
}

.fbc__empty {
	margin: 16px 0 0;
	padding: 18px;
	text-align: center;
	font-size: 0.9rem;
	color: var(--fbc-muted, #6a6a76);
	background: var(--fbc-panel, #f6f6f9);
	border-radius: var(--fbc-radius, 14px);
}

.fbc__toast {
	position: fixed;
	left: 50%;
	bottom: 26px;
	z-index: 99999;
	padding: 11px 20px;
	font-size: 0.9rem;
	font-weight: 600;
	color: #ffffff;
	background: #17171c;
	border-radius: 999px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
	opacity: 0;
	pointer-events: none;
	transform: translateX(-50%) translateY(8px);
	transition: opacity 0.18s, transform 0.18s;
}

.fbc__toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ---------- Escritorio ---------- */

@media (min-width: 640px) {
	.fbc__panel {
		padding: 20px;
	}

	.fbc__item {
		grid-template-columns: 200px 1fr auto;
		grid-template-areas: "meta result star";
		align-items: center;
		gap: 12px;
		contain-intrinsic-size: auto 80px;
	}

	.fbc__meta {
		flex-direction: column;
		align-items: flex-start;
		gap: 3px;
	}

	.fbc__out {
		font-size: 1.22rem;
	}
}

@media (min-width: 1000px) {
	.fbc__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.fbc__item {
		grid-template-columns: 1fr auto;
		grid-template-areas:
			"meta star"
			"result result";
	}

	.fbc__meta {
		flex-direction: row;
		align-items: center;
		gap: 7px;
	}
}

/* ---------- Preferencias del sistema ---------- */

@media (prefers-reduced-motion: reduce) {
	.fbc__toast,
	.fbc__copyicon,
	.fbc__result {
		transition: none;
	}
}

/* ---------- Compatibilidad en el dispositivo del visitante ---------- */

.fbc__safe {
	font-weight: 500;
}

.fbc__safe[aria-pressed="true"] {
	color: var(--fbc-ok, #157a45) !important;
	background: var(--fbc-ok-soft, #e7f7ee) !important;
	border-color: var(--fbc-ok, #157a45);
	font-weight: 600;
}

.fbc__safenote {
	margin: 10px 0 0;
	padding: 9px 12px;
	font-size: 0.82rem;
	line-height: 1.45;
	color: #7d5100;
	background: #fff8e4;
	border: 1px solid #efdca6;
	border-radius: 10px;
}

/*
 * Un estilo que este aparato no sabe dibujar. Se marca en gris, no en rojo:
 * no es un fallo del estilo ni de la herramienta, es que falta una fuente en
 * el sistema, y en otro móvil el mismo estilo se ve perfecto.
 */
.fbc__item.is-broken .fbc__out {
	opacity: 0.5;
}

.fbc__item.is-broken .fbc__name::after {
	content: " · no se ve aquí";
	font-weight: 600;
	color: var(--fbc-muted, #6a6a76);
	letter-spacing: 0.02em;
}

/* ---------- Panel de símbolos ---------- */

.fbc__syms {
	margin-top: 12px;
}

.fbc__symtabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	min-height: 34px;
}

.fbc__symtab {
	flex: 0 0 auto;
	justify-content: center;
	min-height: 32px;
	padding: 6px 12px;
	font-size: 0.78rem;
	font-weight: 600;
	white-space: nowrap;
	color: var(--fbc-muted, #6a6a76) !important;
	background: transparent !important;
	border: 1px solid transparent;
	border-radius: 999px;
}

.fbc__symtab[hidden],
.fbc__sym[hidden] {
	display: none;
}

.fbc__symtab.is-active {
	color: var(--fbc-accent, #5b4bdb) !important;
	background: var(--fbc-accent-soft, #efedfd) !important;
}

/*
 * Se envuelve en varias líneas en vez de desplazarse en horizontal. El
 * desplazamiento lateral fallaba en Android antiguo: la fila se quedaba sin
 * altura y el panel entero desaparecía aunque el HTML estuviera ahí.
 */
.fbc__symrow {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-top: 6px;
	min-height: 44px;
}

.fbc__symrow.is-hidden,
.fbc__symrow[hidden] {
	display: none;
}

.fbc__sym {
	flex: 0 0 auto;
	justify-content: center;
	min-width: 42px;
	min-height: 42px;
	padding: 0 8px;
	font-size: 1.05rem;
	line-height: 1;
	color: var(--fbc-text, #17171c) !important;
	background: var(--fbc-bg, #ffffff) !important;
	border: 1px solid var(--fbc-line, #e4e4ec);
	border-radius: 10px;
}

.fbc__sym:hover {
	background: var(--fbc-accent-soft, #efedfd) !important;
	border-color: var(--fbc-accent, #5b4bdb);
}

.fbc__sym:active {
	transform: scale(0.94);
}

/* ---------- Vista previa ---------- */

.fbc__preview {
	margin-top: 14px;
	padding: 14px;
	background: var(--fbc-panel, #f6f6f9);
	border: 1px solid var(--fbc-line, #e4e4ec);
	border-radius: var(--fbc-radius, 14px);
}

.fbc__pvhead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 12px;
}

.fbc__pvname {
	font-size: 0.74rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fbc-accent, #5b4bdb);
}

.fbc__pvclose {
	justify-content: center;
	min-height: 30px;
	padding: 5px 11px;
	font-size: 0.76rem;
	font-weight: 600;
	color: var(--fbc-muted, #6a6a76) !important;
	background: var(--fbc-bg, #ffffff) !important;
	border: 1px solid var(--fbc-line, #e4e4ec);
	border-radius: 8px;
}

.fbc__pvgrid {
	display: grid;
	gap: 9px;
}

.fbc__pvcard {
	padding: 11px 12px;
	background: var(--fbc-bg, #ffffff);
	border: 1px solid var(--fbc-line, #e4e4ec);
	border-radius: 11px;
}

.fbc__pvlabel {
	display: block;
	margin-bottom: 7px;
	font-size: 0.66rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fbc-muted, #6a6a76);
}

.fbc__pvbio {
	display: flex;
	align-items: center;
	gap: 10px;
}

.fbc__pvavatar {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: linear-gradient(135deg, #f9ce34, #ee2a7b 55%, #6228d7);
}

.fbc__pvtext,
.fbc__pvbubble,
.fbc__pvnick {
	font-size: 1.02rem;
	line-height: 1.85;
	color: var(--fbc-text, #17171c);
	word-break: break-word;
	overflow-wrap: anywhere;
	font-family: "Segoe UI Symbol", "Apple Symbols", "Cambria Math",
		"Noto Sans Symbols 2", "Noto Sans Math", "DejaVu Sans", sans-serif;
}

.fbc__pvchat {
	display: flex;
}

.fbc__pvbubble {
	max-width: 100%;
	padding: 8px 12px;
	background: #dcf8c6;
	border-radius: 12px 12px 12px 3px;
}

.fbc__pvnick {
	padding: 7px 11px;
	background: #1f2430;
	border-radius: 8px;
	color: #eaeaf2;
}

.fbc__pvlimits {
	display: grid;
	gap: 5px;
	margin: 12px 0 0;
	padding: 0;
	list-style: none;
}

.fbc__pvlimit {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 7px 11px;
	font-size: 0.8rem;
	color: var(--fbc-muted, #6a6a76);
	background: var(--fbc-bg, #ffffff);
	border: 1px solid var(--fbc-line, #e4e4ec);
	border-radius: 8px;
}

.fbc__pvlimit strong {
	font-variant-numeric: tabular-nums;
	color: var(--fbc-ok, #157a45);
}

.fbc__pvlimit.is-over {
	background: #fdeaea;
	border-color: #f0c0c2;
}

.fbc__pvlimit.is-over strong {
	color: #8f2429;
}

.fbc__pvnote {
	margin: 10px 0 0;
	font-size: 0.78rem;
	line-height: 1.45;
	color: var(--fbc-muted, #6a6a76);
}

/* ---------- Copiados hace poco ---------- */

.fbc__recent {
	margin-top: 14px;
}

.fbc__recenthead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 7px;
}

.fbc__recentlabel {
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--fbc-muted, #6a6a76);
}

.fbc__recentclear {
	justify-content: center;
	min-height: 28px;
	padding: 4px 9px;
	font-size: 0.74rem;
	color: var(--fbc-muted, #6a6a76) !important;
	background: transparent !important;
	border-radius: 7px;
}

.fbc__recentrow {
	display: flex;
	gap: 7px;
	padding-bottom: 4px;
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.fbc__recentrow::-webkit-scrollbar {
	display: none;
}

.fbc__chip {
	flex: 0 0 auto;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	max-width: 220px;
	min-height: 48px;
	padding: 7px 12px;
	text-align: left;
	background: var(--fbc-bg, #ffffff) !important;
	border: 1px solid var(--fbc-line, #e4e4ec);
	border-radius: 10px;
}

.fbc__chip:hover {
	border-color: var(--fbc-accent, #5b4bdb);
}

.fbc__chiplabel {
	font-size: 0.62rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--fbc-muted, #6a6a76);
}

.fbc__chiptext {
	max-width: 196px;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 0.94rem;
	color: var(--fbc-text, #17171c);
}

/* El nombre del estilo abre la vista previa. */
.fbc__meta {
	text-align: left;
	border-radius: 7px;
}

.fbc__meta:hover .fbc__name {
	color: var(--fbc-accent, #5b4bdb);
	text-decoration: underline;
}

@media (min-width: 640px) {
	.fbc__pvgrid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.fbc__pvlimits {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Etiqueta de familia en cada tarjeta. */
.fbc__tag {
	padding: 2px 7px;
	font-size: 0.62rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	white-space: nowrap;
	color: var(--fbc-muted, #6a6a76);
	background: var(--fbc-panel, #f6f6f9);
	border-radius: 999px;
}
