/* Шкала «Просмотрено серий» — цвет var(--tt-accent,) */
.usp-episodes-scale {
    margin-bottom: 24px;
}
.usp-episodes-scale__head {
    margin-bottom: 10px;
}
.usp-episodes-scale__title {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}
.usp-episodes-scale__track-wrap {
    width: 100%;
    position: relative;
}
.usp-episodes-scale__track {
    position: relative;
    height: 12px;
    background: var(--bdc, rgba(0,0,0,0.08));
    border-radius: 6px;
    overflow: visible;
    box-sizing: border-box;
}
.usp-episodes-scale__fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    border-radius: 6px;
    background: var(--tt-accent,);
    transition: width 0.3s ease;
    box-sizing: border-box;
}
.usp-episodes-scale__dot {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    margin-top: -7px;
    left: 0;
    border: 2px solid var(--tt-accent,);
    background: #fff;
    border-radius: 50%;
    z-index: 2;
    transition: background 0.2s, border-color 0.2s;
    box-sizing: border-box;
}
/* 0–600 полшага, 600–1800, 1800–5400, 5400–16200, 16200–50000 по шагу, после 50000 полшага → точки на 10%, 30%, 50%, 70%, 90% */
.usp-episodes-scale__dot--1 { left: 10%; }
.usp-episodes-scale__dot--2 { left: 30%; }
.usp-episodes-scale__dot--3 { left: 50%; }
.usp-episodes-scale__dot--4 { left: 70%; }
.usp-episodes-scale__dot--5 { left: 90%; }
.usp-episodes-scale__dot.is-reached {
    background: var(--tt-accent,);
    border-color: #ffffff;
}
.usp-episodes-scale__labels {
    position: relative;
    margin-top: 8px;
    height: 18px;
    width: 100%;
}
.usp-episodes-scale__label {
    position: absolute;
    font-size: 12px;
    color: var(--tt-2, #666);
    white-space: nowrap;
    left: 0;
}
.usp-episodes-scale__label--1 { left: 10%; transform: translateX(-50%); text-align: center; }
.usp-episodes-scale__label--2 { left: 30%; transform: translateX(-50%); text-align: center; }
.usp-episodes-scale__label--3 { left: 50%; transform: translateX(-50%); text-align: center; }
.usp-episodes-scale__label--4 { left: 70%; transform: translateX(-50%); text-align: center; }
.usp-episodes-scale__label--5 { left: 90%; transform: translateX(-50%); text-align: center; }

/* На чужом профиле: скрыть иконки «Редактировать» и «Выбрать аватар», блоки заявок и кнопки [del] */
.profile-view-other .usp__ico--ava,
.profile-view-other .usp__ico--edit {
    display: none !important;
}
.profile-view-other .zayavki {
    display: none !important;
}
.profile-view-other .friends_list_actions--icon {
    display: none !important;
}

/* Строка: заголовок слева, «Подробнее» справа */
.friends-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.frtit {
    text-align: left;
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}
.form { margin-top: -40px; }

/* Друзья и заявки: карточки в одну линию, прокрутка только колёсиком мыши, без полос прокрутки */
.friends-cards-line {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.friends-cards-line.owl-carousel .owl-stage-outer { overflow: hidden; }
.friends-cards-line.owl-carousel .owl-item { min-width: 0; }
.friends-cards-line.owl-carousel.owl-grab,
.friends-cards-line.owl-carousel .owl-stage-outer { cursor: default; }
.friends-cards-line::-webkit-scrollbar {
    display: none;
}
.friends-cards-line .friends_list,
.friends-cards-line .friend_incoming {
    flex: 0 0 auto;
    margin-right: 16px;
}
.friends-cards-line .friends_list:last-child,
.friends-cards-line .friend_incoming:last-child {
    margin-right: 0;
}

/* Блок «Смотрю» на профиле: 6 последних аниме в 2 колонки, на всю ширину */
.profile-mylists-section {
    margin-bottom: 24px;
    width: 100%;
}
.profile-mylists-section .friends-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
/* Сетка 2 колонки, стили карточек — родные из custom-user.tpl */
.profile-mylists-list--grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    width: 100%;
}
@media (max-width: 1199px) {
    .profile-mylists-list--grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 949px) {
    .profile-mylists-list--grid {
        grid-template-columns: 1fr;
    }
}
.profile-mylists-list--grid .ftop-item {
    min-width: 0;
    width: 100%;
}
.profile-mylist-item {
    flex: 0 0 auto;
    min-width: 100px;
    max-width: 140px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bdc, rgba(0,0,0,0.06));
}
.profile-mylist-item:hover {
    color: var(--tt-accent, #3394e6);
}
.profile-mylist-item__img {
    width: 100%;
    aspect-ratio: 200/280;
    background: var(--bdc, rgba(0,0,0,0.08));
}
.profile-mylist-item__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profile-mylist-item__title {
    padding: 8px 6px;
    font-size: 12px;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Страница «Все списки» пользователя /user/LOGIN/mylists */
.profile-mylists-page {
    width: 100%;
    padding: 0 0 24px;
}
.profile-mylists-page__back {
    margin-bottom: 16px;
}
.profile-mylists-page__back a {
    color: var(--tt-accent, #3394e6);
    text-decoration: none;
}
.profile-mylists-page__back a:hover {
    text-decoration: underline;
}
.profile-mylists-page__title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px;
}
.profile-mylists-page__tabs {
    margin: 0 0 20px;
}
.profile-mylists-page__grid.spiski {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
@media (max-width: 1199px) {
    .profile-mylists-page__grid.spiski {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 949px) {
    .profile-mylists-page__grid.spiski {
        grid-template-columns: 1fr;
    }
}
/* Только на странице списков: убрать width: 48% у .ftop-item */
.profile-mylists-page__grid .ftop-item {
    width: 100%;
}
.profile-mylists-page__empty {
    margin: 0;
    color: var(--tt-2, #666);
}
.profile-mylists-page__pagination {
    margin-top: 24px;
}
.profile-mylists-page__pagination .mylists-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.profile-mylist-card .linek__img {
    aspect-ratio: 200/280;
}
.profile-mylist-card .linek__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Настройки друзей: строка на всю ширину, чекбокс справа */
.form__row--checkbox-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
    margin-bottom: 12px;
}
.form__row--checkbox-right:last-child {
    margin-bottom: 0;
}
.form__row--checkbox-right .form__label-inline {
    flex: 1;
    margin: 0;
    min-width: 0;
    cursor: pointer;
}
.form__row--checkbox-right .form__content--end {
    flex-shrink: 0;
}

/* Переключатели (toggle) вместо чекбоксов */
.form-toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}
.form-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    position: absolute;
}
.form-toggle__slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bdc, rgba(0,0,0,0.2));
    border-radius: 24px;
    transition: background 0.25s, box-shadow 0.25s;
}
.form-toggle__slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.form-toggle input:checked + .form-toggle__slider {
    background: var(--tt-accent, #4a90d9);
}
.form-toggle input:checked + .form-toggle__slider::before {
    transform: translateX(20px);
}
.form-toggle input:focus-visible + .form-toggle__slider {
    box-shadow: 0 0 0 2px var(--tt-accent, #4a90d9);
}

/* Гостевая книга (стена) на профиле */
.usp__wall {
    margin-top: 24px;
    width: 100%;
}
.profile-wall {
    margin: 0;
}
.profile-wall__title {
    margin: 0 0 16px;
    font-size: 18px;
    font-weight: 600;
}
.profile-wall-form {
    margin-bottom: 20px;
}
.profile-wall-list {
    margin-top: 16px;
}
.profile-wall-list .comment-item {
    min-height: 120px;
    margin-bottom: 16px;
}
}
.profile-wall-list .comment-item:last-child {
    margin-bottom: 0;
}
.profile-wall-pagination {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.profile-wall-pagination a,
.profile-wall-page-current {
    padding: 4px 10px;
    border-radius: 6px;
}
.profile-wall-pagination a {
    color: var(--tt-accent, #3394e6);
    text-decoration: none;
}
.profile-wall-pagination a:hover {
    text-decoration: underline;
}
.profile-wall-page-current {
    font-weight: 600;
    background: var(--bdc, rgba(0,0,0,0.08));
}

/* Модальное окно «Ответить» в гостевой книге */
.profile-wall-reply-overlay {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    box-sizing: border-box;
}
.profile-wall-reply-modal {
    background: #fff;
    border-radius: 10px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}
.profile-wall-reply-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: #333;
    color: #fff;
}
.profile-wall-reply-modal__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}
.profile-wall-reply-modal__close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.8;
}
.profile-wall-reply-modal__close:hover {
    opacity: 1;
}
.profile-wall-reply-modal__body {
    padding: 20px;
    overflow-y: auto;
}
.profile-wall-reply-descr {
    margin: 0 0 14px;
    font-size: 14px;
    color: var(--tt-2, #666);
}
.profile-wall-reply-actions .profile-wall-reply-cancel {
    margin-left: 8px;
}

/* Страница «Все друзья и заявки» /user/LOGIN/friends — на всю ширину, без карусели */
.friends-page-all {
    width: 100%;
    max-width: 100%;
    padding: 0 0 24px;
}
.friends-page-all__back {
    margin-bottom: 20px;
}
.friends-page-all__back a {
    color: var(--tt-accent, #3394e6);
    text-decoration: none;
}
.friends-page-all__back a:hover {
    text-decoration: underline;
}
.friends-page-all__section {
    margin-bottom: 28px;
}
.friends-page-all__section:last-child {
    margin-bottom: 0;
}
.friends-page-all__title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 12px;
    text-align: left;
}
.friends-page-all__grid.request_friends_block,
.friends-page-all__grid.incoming-friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    align-items: start;
}
@media screen and (min-width: 560px) {
    .friends-page-all__grid.request_friends_block,
    .friends-page-all__grid.incoming-friends-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}
.friends-page-all .friends-page-msg {
    margin: 0;
    color: var(--tt-2, #666);
}

/* Пагинация друзей на странице /user/.../friends */
.friends-page-all__pagination {
    margin-top: 20px;
}
.friends-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.friends-pagination li {
    margin: 0;
    padding: 0;
}
.friends-pagination a,
.friends-pagination__current {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.friends-pagination a {
    background: var(--bdc, rgba(0,0,0,0.08));
    color: var(--tt, #333);
}
.friends-pagination a:hover {
    background: var(--tt-accent, #3394e6);
    color: #fff;
}
.friends-pagination__current {
    background: var(--tt-accent, #3394e6);
    color: #fff;
    font-weight: 600;
}
.friends-pagination__info {
    padding: 0 8px;
    color: var(--tt-2, #666);
    font-size: 0.9rem;
}

.zayavki {
   display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 24px;
}
.zayavki .za1 {
    gap: 16px;
}
.zayavki .za1 > .friends-section-head {
    margin-bottom: 10px;
}
.zayavki .za1 > .friends-section-head:first-child {
    margin-top: 4px;
}
/* Ссылка «Подробнее» — справа в одной строке с заголовком */
.friends-more-wrap {
    margin: 0;
    padding: 0;
}
.friends-more-link {
    font-size: 0.95rem;
    color: var(--tt-accent, #3394e6);
    text-decoration: none;
}
.friends-more-link:hover {
    text-decoration: underline;
}

/* Сетка входящих заявок */
.incoming-friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    align-items: start;
}

/* Сетка карточек: друзья и исходящие заявки */
.request_friends_block {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    align-items: start;
}
.request_friends_block.friends-cards-line {
    display: flex;
    grid-template-columns: none;
}
@media screen and (min-width: 560px) {
    .request_friends_block:not(.friends-cards-line) {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}
.incoming-friends-grid.friends-cards-line {
    display: flex;
    grid-template-columns: none;
}

/* Карточка одного друга / исходящая заявка: аватар 55×55 слева, справа крестик, снизу логин */
.friends_list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 12px 10px;
    background: var(--fltx, #f5f5f5);
    border-radius: 12px;
    margin: 0;
    min-width: 0;
}
.friends_list .friends_data {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}
.friends_list .friends_image {
    flex-shrink: 0;
}
.friends_list .friends_data_text {
    display: block;
    padding: 6px 0 0;
    text-align: left;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.friends_list .friends_data_text-name {
    font-weight: 600;
}
.friends_list .friends_data_text a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--tt-accent, #c00);
    font-weight: 600;
}
.friends_list .friends_data_text a:hover {
    text-decoration: underline;
}
.friends_list .fgimg {
    border-radius: 10px;
    overflow: hidden;
    width: 55px;
    height: 55px;
    flex-shrink: 0;
}
.fgimg img,
.friends_image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.friends_list_actions {
    margin: 0;
    flex-shrink: 0;
}
.friends_list_actions .friend_btn,
.friends_list_actions a {
    display: inline-block;
}
/* Крестик «Удалить из друзей» — красный, при наведении тёмно-красный */
.friends_list_actions--icon a,
.friends_list_actions--icon .friend_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 30%;
    background: #c00;
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.friends_list_actions--icon a:hover,
.friends_list_actions--icon .friend_btn:hover {
    background: #8b0000;
    color: #fff;
    text-decoration: none;
}
.friends_list_actions--icon .fal {
    font-size: 12px;
}

/* Входящие заявки: карточка — аватар 55×55 слева, справа иконки Принять/Отклонить, снизу логин */
.incoming-friends-grid .friend_incoming {
    float: none;
    margin: 0;
    max-width: none;
    padding: 12px 10px;
    text-align: left;
    background-color: var(--fltx, #f5f5f5);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}
.incoming-friends-grid .friend_incoming_row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
}
.incoming-friends-grid .friend_incoming .friends_image {
    display: block;
    flex-shrink: 0;
}
.incoming-friends-grid .friend_incoming .fgimg {
    border-radius: 10px;
    overflow: hidden;
    width: 55px;
    height: 55px;
}
.incoming-friends-grid .friend_incoming .friends_image img,
.incoming-friends-grid .friend_incoming .fgimg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.incoming-friends-grid .friend_incoming_name {
    padding: 6px 0 0;
    width: 100%;
    min-width: 0;
}
.friend_incoming_text {
    font-size: 0.95rem;
    padding: 10px 0 12px;
    line-height: 1.35;
    word-break: break-word;
}
.friend_incoming_buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}
.friend_incoming_buttons .friend_btn,
.friend_incoming_buttons a {
    display: inline-block;
}
/* Иконки Принять (галочка) и Отклонить (крестик) справа от аватарки */
.friend_incoming_buttons--icons {
    flex-shrink: 0;
    gap: 6px;
    margin: 0;
}
.friend_incoming_buttons--icons a,
.friend_incoming_buttons--icons .friend_btn {
display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: 30%;
    font-size: 0;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.friend_incoming_buttons--icons .fal {
    font-size: 12px;
}
/* Принять — зелёная кнопка */
.friend_incoming_buttons--icons a.friend_apply,
.friend_incoming_buttons--icons .friend_apply {
    background: #22c55e;
    color: #fff;
}
.friend_incoming_buttons--icons a.friend_apply:hover,
.friend_incoming_buttons--icons .friend_apply:hover {
    background: #16a34a;
    color: #fff;
}
/* Отклонить — серая/красная кнопка */
.friend_incoming_buttons--icons a.friend_un,
.friend_incoming_buttons--icons .friend_un {
    background: #cc0000;
   
}
.friend_incoming_buttons--icons a.friend_un:hover,
.friend_incoming_buttons--icons .friend_un:hover {
    background: #c00;
    color: #fff;
}
/* Колонка: галочка сверху, крестик сразу под ней */
.friend_incoming_buttons_col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.friend_incoming_buttons--abort,
.incoming-friends-grid .friend_incoming_buttons--abort,
.friends_list .friend_incoming_buttons--abort {
    margin: 0;
    padding: 0;
    justify-content: center;
}
.friend_incoming_buttons--accept {
    margin: 0;
}
/* Входящие в блоке .friends_list (incoming_friends_page) */
.friends_list .friend_incoming_buttons_col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.friends_list .friend_incoming_buttons--icons {
    margin: 0;
}

.friend_btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 8px;
    color: #fff !important;
    background: #3394e6;
    transition: background 0.2s, opacity 0.2s;
    margin: 0;
    font-size: 0.9rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
}
.friend_btn:hover {
    background: #2670b8;
    text-decoration: none;
    opacity: 0.95;
}
.friend_un,
.friend_reset {
    background: #cd4a16;
}
.friend_un:hover,
.friend_reset:hover {
    background: #a83c12;
}
.friend_add {
    background: #333;
}
/* Не показывать «Дружат X дня» — только кнопки */
.friends_data_date {
    display: none !important;
}

/* Имя во входящих заявках (только логин, без текста «хочет добавить в друзья») */
.friend_incoming_name {
    display: block;
    padding: 8px 4px 4px;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.friend_incoming_name a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--tt-accent, #c00);
}
.friend_incoming_name a:hover {
    text-decoration: underline;
}

@media screen and (max-width: 760px) {
    .form { margin-top: -20px; }
    .request_friends_block {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 14px;
    }
    .incoming-friends-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .incoming-friends-grid .friend_incoming {
        padding: 14px 12px;
    }
}