/* Любимое аниме — профиль. Цвета из темы сайта (--bg, --tt, --tt-accent, --bdc). */
.profile-fav-anime {
	margin: 0 0 24px;
	width: 100%;
}

.profile-fav-anime button,
.profile-fav-anime-modal button {
	appearance: none;
	-webkit-appearance: none;
	font-family: inherit;
	box-shadow: none;
}

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

.profile-fav-anime__head-left {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 8px 12px;
	min-width: 0;
}

.profile-fav-anime__title.frtit {
	margin: 0;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--tt);
}

.profile-fav-anime__heart {
	color: var(--tt-accent);
	font-size: 0.95em;
	line-height: 1;
}

.profile-fav-anime__count {
	font-size: 13px;
	color: var(--tt-2);
	font-weight: 600;
}

.profile-fav-anime__save {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	padding: 0 16px;
	border: none;
	border-radius: 10px;
	background: var(--bg1s);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s, opacity 0.15s;
}

.profile-fav-anime__save:hover:not(:disabled) {
	background: var(--bg-btn-hover);
	color: #fff;
}

.profile-fav-anime__save:disabled {
	opacity: 0.4;
	cursor: default;
}

.profile-fav-anime__save.is-saving {
	opacity: 0.7;
	pointer-events: none;
}

.profile-fav-anime__actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 12px;
}

.profile-fav-anime__hint {
	margin: 0 0 14px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--tt-2);
	max-width: 720px;
}

.profile-fav-anime__row {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 12px;
	overflow-x: auto;
	overflow-y: hidden;
	padding-bottom: 2px;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.profile-fav-anime__row::-webkit-scrollbar {
	display: none;
}

.profile-fav-anime__slot {
	position: relative;
	flex: 0 0 112px;
	width: 112px;
	max-width: 112px;
	aspect-ratio: 2 / 3;
	height: auto !important;
	min-height: 0 !important;
	border-radius: 10px;
	overflow: hidden;
	box-sizing: border-box;
}

.profile-fav-anime__slot--filled {
	background: var(--ui-bg-darker, var(--bg-2));
	border: 1px solid var(--bdc);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.profile-fav-anime__slot--filled.is-dragging {
	opacity: 0.55;
}

.profile-fav-anime__slot--filled.is-drop-target {
	outline: 2px solid var(--tt-accent);
	outline-offset: 2px;
}

.profile-fav-anime__slot--empty {
	display: flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 12px 8px !important;
	border: 1px dashed var(--ui-bdc, var(--bdc)) !important;
	background: var(--ui-bg-darker, var(--fltx)) !important;
	color: var(--tt-2) !important;
	cursor: pointer;
	white-space: normal !important;
	line-height: 1.2;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.profile-fav-anime__slot--empty:hover {
	border-color: var(--tt-accent) !important;
	background: var(--ui-bg-darkest, var(--hov)) !important;
	color: var(--tt-accent) !important;
}

.profile-fav-anime__add-icon {
	font-size: 26px;
	line-height: 1;
	font-weight: 300;
}

.profile-fav-anime__add-label {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.profile-fav-anime__rank {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 3;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.03em;
	color: #fff;
	background: rgba(0, 0, 0, 0.55);
	padding: 3px 6px;
	border-radius: 6px;
	pointer-events: none;
}

.profile-fav-anime__controls {
	position: absolute;
	top: 6px;
	right: 6px;
	left: 6px;
	z-index: 4;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.15s;
}

.profile-fav-anime__slot--filled.is-editable:hover .profile-fav-anime__controls,
.profile-fav-anime__slot--filled.is-editable:focus-within .profile-fav-anime__controls {
	opacity: 1;
}

.profile-fav-anime__drag,
.profile-fav-anime__remove {
	pointer-events: auto;
	width: 26px !important;
	height: 26px !important;
	min-height: 0 !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 999px !important;
	background: rgba(17, 17, 22, 0.72) !important;
	color: #fff !important;
	cursor: grab;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
	transition: background 0.15s;
}

.profile-fav-anime__drag span {
	width: 12px;
	height: 12px;
	background: radial-gradient(circle, #fff 1.5px, transparent 1.6px) 0 0 / 6px 6px;
	opacity: 0.9;
}

.profile-fav-anime__remove {
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
}

.profile-fav-anime__drag:hover,
.profile-fav-anime__remove:hover {
	background: var(--bg1s) !important;
	color: #fff !important;
}

.profile-fav-anime__link {
	display: block;
	position: relative;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.profile-fav-anime__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center top;
}

.profile-fav-anime__overlay {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 28px 8px 10px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.4) 55%, transparent 100%);
	pointer-events: none;
}

.profile-fav-anime__card-title {
	font-size: 11px;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	word-break: break-word;
}

.profile-fav-anime__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 4px;
	font-size: 11px;
	color: #f5d76e;
	font-weight: 700;
}

.profile-fav-anime__year {
	color: rgba(255, 255, 255, 0.8);
	font-weight: 600;
}

/* Modal */
.profile-fav-anime-modal {
	position: fixed;
	inset: 0;
	z-index: 10100;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.profile-fav-anime-modal.is-open {
	display: flex;
}

.profile-fav-anime-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.profile-fav-anime-modal__box {
	position: relative;
	width: min(520px, 96vw);
	max-height: min(80vh, 640px);
	display: flex;
	flex-direction: column;
	background: var(--ui-bg, var(--bg));
	border: 1px solid var(--bdc);
	border-radius: 14px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
	padding: 20px 18px 16px;
	color: var(--tt);
}

.profile-fav-anime-modal__close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 34px !important;
	height: 34px !important;
	min-height: 0 !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 8px !important;
	background: transparent !important;
	color: var(--tt-2) !important;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.profile-fav-anime-modal__close:hover {
	background: var(--hov, var(--ui-bg-darker)) !important;
	color: var(--tt) !important;
}

.profile-fav-anime-modal__title {
	margin: 0 36px 6px 0;
	font-size: 1.15rem;
	font-weight: 800;
	color: var(--tt);
}

.profile-fav-anime-modal__sub {
	margin: 0 0 14px;
	font-size: 13px;
	color: var(--tt-2);
}

.profile-fav-anime-modal__search-wrap {
	position: relative;
	margin-bottom: 12px;
	flex: 0 0 auto;
}

.profile-fav-anime-modal__search-ico {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	border: 2px solid var(--tt-accent);
	border-radius: 999px;
	pointer-events: none;
	opacity: 0.75;
}

.profile-fav-anime-modal__search-ico::after {
	content: '';
	position: absolute;
	width: 7px;
	height: 2px;
	background: var(--tt-accent);
	right: -4px;
	bottom: -1px;
	transform: rotate(45deg);
	border-radius: 1px;
}

.profile-fav-anime-modal__search {
	width: 100%;
	box-sizing: border-box;
	height: 42px !important;
	line-height: 42px !important;
	border: 1px solid var(--bdc) !important;
	border-radius: 10px !important;
	background: var(--fltx) !important;
	color: var(--tt) !important;
	padding: 0 14px 0 38px !important;
	font-size: 14px;
	outline: none;
}

.profile-fav-anime-modal__search:focus {
	border-color: var(--tt-accent) !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tt-accent) 18%, transparent);
}

.profile-fav-anime-modal__results {
	flex: 1 1 auto;
	overflow: auto;
	min-height: 140px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-right: 2px;
}

.profile-fav-anime-modal__empty {
	margin: 12px 4px;
	font-size: 13px;
	color: var(--tt-2);
}

.profile-fav-anime-result {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
	width: 100%;
	min-height: 80px;
	height: auto;
	margin: 0;
	padding: 8px;
	border: 1px solid var(--bdc);
	border-radius: 12px;
	background: var(--ui-bg-darker, var(--fltx));
	color: var(--tt);
	cursor: pointer;
	text-align: left;
	white-space: normal;
	line-height: 1.3;
	box-sizing: border-box;
	overflow: hidden;
	transition: border-color 0.15s, background 0.15s;
}

.profile-fav-anime-result:hover {
	border-color: var(--tt-accent);
	background: var(--ui-bg-darkest, var(--hov));
	color: var(--tt);
}

.profile-fav-anime-result__thumb {
	flex: 0 0 46px;
	width: 46px;
	height: 64px;
	border-radius: 8px;
	overflow: hidden;
	background: var(--bdc);
	align-self: center;
}

.profile-fav-anime-result__poster {
	display: block;
	width: 46px;
	height: 64px;
	max-width: 46px;
	max-height: 64px;
	object-fit: cover;
	object-position: center top;
}

.profile-fav-anime-result__body {
	min-width: 0;
	flex: 1 1 auto;
	text-align: left;
}

.profile-fav-anime-result__title {
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--tt);
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	white-space: normal;
}

.profile-fav-anime-result__meta {
	margin-top: 4px;
	font-size: 12px;
	color: var(--accent-gold, #c9af1c);
	font-weight: 700;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.profile-fav-anime-result__meta .profile-fav-anime__year {
	color: var(--tt-2);
	font-weight: 600;
}

@media (max-width: 767px) {
	.profile-fav-anime__slot {
		flex-basis: 100px;
		width: 100px;
		max-width: 100px;
	}

	.profile-fav-anime__controls {
		opacity: 1;
	}
}
