/* ======================================================================
   profile.css (полный, корректный)
   - Починил селекторы .container_pr_form_left (чтобы не били по textarea/select глобально)
   - Убрал дубли/конфликты по messages и profile_mode_button.off (оставил одну “финальную” версию)
   - Кнопки pre_profile: новый класс .pp-action + обратная совместимость со старым .go_to_profile
   - Мобилка/планшет/десктоп — всё сохраняем
   ====================================================================== */
/* Скрываем поле "Город" на формах профиля (продукты + спрос) */
.city_field{
    display: none !important;
}

.container_pr {
    display: flex;
    margin: 20px 10px;
    width: calc(100% - 20px);
    font-size: 16px;
    text-align: center;
    box-sizing: border-box;
}

.container_pr input {
    font-size: 16px;
}


.container_pr input[type="text"],
.container_pr input[type="email"],
.container_pr input[type="tel"],
.container_pr input[type="number"],
.container_pr input[type="url"] {
    border-radius: 5px;
    padding: 3px;
    border: 1px solid #cfd7df;
    width: 50%;
}


.container_pr form {
    width: 100%;
    padding-bottom: 10px;
    box-shadow: 0 4px 5px -5px grey;
    box-sizing: border-box;
}

.container_pr form .form_inner {
    display: flex;
    width: 100%;
    box-sizing: border-box;
}

.form_line{
    display: flex;
}

/* Собираем "лейбл + поле" в нормальный ряд */
.label_input{
    width: 40%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.label_input.big{
    width: 60%;
}

/* лейблы не должны разъезжаться */
.label_input label{
    margin: 0;
    white-space: nowrap;
}

/* Поле занимает всё оставшееся место в своей .label_input */
.container_pr_form_right .label_input input,
.container_pr_form_right .label_input select{
    flex: 1;
    min-width: 0;
    width: 100%;            /* перебивает .container_pr input[type=...] */
    box-sizing: border-box;
}

/* file input можно оставить чуть шире, но без ломания ряда */
.label_input.file input{
    flex: 1;
    min-width: 0;
    width: 100%;
}

.label_input.big.file{
    width: 60%;
}

.container_pr_form_left{
    width: 50%;
    margin-top: 55px;
    padding-left: 10px;
}

/* ВАЖНО: раньше textarea, select применялись глобально по сайту */
.container_pr_form_left input,
.container_pr_form_left textarea,
.container_pr_form_left select{
    font-size: 16px;
}

.container_pr_form_right{
    width: 50%;
    display: flex;
    flex-direction: column;
    text-align: left;
    padding-left: 10px;
}

/* Убираем проценты — они и ломали десктоп */
.container_pr_form_right input{
    margin-bottom: 15px;
}


.container_pr_form_right select{
    font-size: 16px;
}



.small_label {
    width: 50px;
    display: inline-block;
}

.big_label {
    width: 90px;
    display: inline-block;
}

.window {
    margin-bottom: 20px;
}

.window_2 {
    margin-bottom: 20px;
}

.window_3 {
    border-radius: 5px;
    resize: none;
    width: 70%;
    height: 150px;
}

.window_4 {
    border-radius: 5px;
    padding: 3px;
    width: 250px;
}

/* Блок кнопок под товаром в профиле (деcктоп) */
.profile_product_buttons{
    margin: 10px 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    text-align: center;
}

.profile_product_buttons form,
.profile_product_buttons a{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    text-decoration: none;
}

/* Кнопки управления объявлением – компактные «пилюли» */
.delete_product,
.change_product_button,
.up_product_button {
    cursor: pointer;
    box-sizing: border-box;
    width: 150px;
    min-height: 46px;
    padding: 6px 14px;
    font-size: 14px;
    line-height: 1.2;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.15);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    transition: 0.15s transform ease, 0.15s box-shadow ease, 0.15s background-color ease;
    color: #fff;
    text-align: center;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: top;
    text-decoration: none;
}

.up_product_button{
    white-space: normal;
    word-break: break-word;
}

/* Цвета кнопок */
.delete_product { background-color: #D5284A; }
.change_product_button { background-color: #4b5563; }
.up_product_button { background-color: #1c9675; }

/* Hover-эффекты */
.delete_product:hover,
.change_product_button:hover,
.up_product_button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

/* Аккуратный клик */
.delete_product:active,
.change_product_button:active,
.up_product_button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.product_table.profile {
    width: 90%;
    grid-template-columns: repeat(1, 100%);
}

.product_card.profile {
    cursor: default;
    box-shadow: 0 4px 5px -5px grey;
    padding-bottom: 5px;
    margin-bottom: 10px;
}

/* --- ЛК /profile: ограничиваем описание объявления до 1–2 строк --- */
.product_card.profile .product_text_box.profile .product{
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;   /* максимум 2 строки */
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    line-height: 1.25em;
    max-height: calc(1.25em * 2);
    font-weight: 400 !important;
}

/* Мобилка: максимум 1 строка */
@media (max-width: 480px){
    .product_card.profile .product_text_box.profile .product{
        -webkit-line-clamp: 1;
        line-clamp: 1;
        max-height: 1.25em;
        overflow: hidden;
    }
}

.logout_up {
    display: flex;
    justify-content: center;
    margin-top: 70px;
    margin-bottom: 20px;
}

.logout_up button {
    margin-left: 10px;
    margin-right: 10px;
    border-radius: 8px;
    border: solid 1px black;
    cursor: pointer;
    padding: 10px 20px;
    font-size: 16px;
    color: white;
    transition: 0.3s;
}

.logout_up button:hover {
    transform: scale(1.025);
}

.change_pass { background-color: #E56E2B; }
.logout_button { background-color: #D5284A; }

.go_product {
    padding: 10px 20px;
    font-size: 16px;
    border-radius: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
    border: solid 1px black;
    background-color: #1c9675;
    color: white;
    cursor: pointer;
    transition: 0.3s;
}

.go_product:hover {
    transform: scale(1.05);
}

.photo_profile_flex {
    display: flex;
}

.profile_mode_button {
    background-color: #e2e6ea;
    color: black !important;
}

.product_pictures_box.change {
    margin-bottom: 20px;
}

.product_pictures_box.change img {
    background-color: #e2e6ea;
    cursor: pointer;
}

.pre_profile_title {
    text-align: center;
    color: #333333;
}

/* =========================
   PRE_PROFILE: ACTION BUTTONS
   ========================= */

/* Новый стиль кнопок */
.pre_profile_top_elem .pp-action{
    width: 300px;
    max-width: 100%;
    margin: 12px auto;
    padding: 12px 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px solid rgba(0,0,0,0.10);
    background: #ffffff;
    color: #1b1f23;

    box-shadow: 0 10px 22px rgba(0,0,0,0.06);
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.pre_profile_top_elem .pp-action__text{
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

/* Варианты */
.pre_profile_top_elem .pp-action--primary{
    background: linear-gradient(135deg, #1c9675, #2f80ed);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: 0 12px 26px rgba(28,150,117,0.22);
}

.pre_profile_top_elem .pp-action--secondary{
    background: #ffffff;
    color: #1b1f23;
}

/* Hover/Active */
.pre_profile_top_elem .pp-action:hover{
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.10);
}

.pre_profile_top_elem .pp-action:active{
    transform: translateY(0);
    box-shadow: 0 10px 22px rgba(0,0,0,0.08);
}

/* =========================
   PRE_PROFILE: Settings button (graphite)
   ========================= */

.pre_profile_top_elem .pp-action--settings {
    background: #4b5563;          /* графит */
    color: #ffffff;
    border: 1px solid rgba(0,0,0,0.15);
    box-shadow: 0 10px 22px rgba(0,0,0,0.18);
}

.pre_profile_top_elem .pp-action--settings:hover {
    background: #374151;          /* темнее на hover */
    color: #ffffff;
}

.pre_profile_top_elem .pp-action--settings:focus-visible {
    box-shadow:
      0 0 0 3px rgba(75,85,99,0.35),
      0 14px 30px rgba(0,0,0,0.20);
}


/* Доступность: фокус с клавиатуры */
.pre_profile_top_elem .pp-action:focus-visible{
    outline: none;
    box-shadow: 0 0 0 3px rgba(47,128,237,0.25), 0 14px 30px rgba(0,0,0,0.10);
}

/* Flare */
.pre_profile_top_elem .pp-action .flare{
    position: absolute;
    top: 0;
    height: 100%;
    width: 60px;
    transform: skewX(-25deg);
    left: -160%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.0), rgba(255, 255, 255, 0.35));
    animation: pp_action_flare 3.2s infinite linear;
    pointer-events: none;
}

@keyframes pp_action_flare{
    0% { left: -160%; }
    100% { left: 160%; }
}

/* Обратная совместимость: если где-то ещё остался старый класс */
.go_to_profile {
    text-align: center;
    width: 340px;
    max-width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0,0,0,0.10);
    margin-left: auto;
    margin-right: auto;
    transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    border-radius: 16px;
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    background: #ffffff;
    color: #1b1f23;
    box-shadow: 0 10px 22px rgba(0,0,0,0.06);
}

.go_to_profile_a {
    color: inherit;
    text-decoration: none;
    font-weight: 700;
}

.go_to_profile .flare {
    position: absolute;
    top: 0;
    height: 100%;
    width: 60px;
    transform: skewX(-25deg);
    left: -160%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.0), rgba(255, 255, 255, 0.35));
    animation: pp_action_flare 3.2s infinite linear;
    pointer-events: none;
}

.go_to_profile.settings {
    margin-top: 10px;
}

.go_to_profile:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.10);
}

/* =========================
   Refer-card (финальная версия)
   ========================= */

.refer-card {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 18px;
    background: #FFFFFF;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.refer-card__image {
    flex: 0 0 96px;
    max-width: 96px;
}

.refer-card__image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 14px;
}

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

.refer-card__title {
    font-size: 16px;
    font-weight: 600;
    color: #1b1f23;
}

.refer-card__title span {
    color: #1c9675;
}

.refer-card__subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: #717375;
}

.refer-card__actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.refer-card__link {
    flex: 1 1 auto;
    max-width: 100%;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid #d4dde1;
    background: #f7f9fa;
    color: #38434f;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.refer-card__btn {
    flex: 0 0 auto;
    padding: 9px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #2f80ed, #1c9675);
    box-shadow: 0 5px 12px rgba(47, 128, 237, 0.45);
    transition: box-shadow 0.1s ease, transform 0.1s ease, background-color 0.1s ease;
}

.refer-card__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(47, 128, 237, 0.55);
}

.refer-card__btn:active {
    transform: translateY(0);
    box-shadow: 0 3px 8px rgba(47, 128, 237, 0.45);
}

.refer-card__btn.is-copied {
    background: #1c9675;
    box-shadow: 0 5px 12px rgba(28, 150, 117, 0.45);
}

/* Общие блоки */
.shadowbox {
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}

/* =========================
   Messages (финальная версия “пузырей”)
   ========================= */

.message_block {
  width: 100%;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  padding: 20px;
  max-width: 1400px;
  margin: 30px auto 60px;
}

.message_icon {
    width: 40px;
}

.message_top_block {
  display: flex;
  font-size: 20px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.message_top_block div {
    margin-right: 100px;
}

.message_top_block img {
  width: 42px;
  height: 42px;
  opacity: 0.85;
}

.message_inner {
  padding-top: 20px;
  padding-bottom: 20px;
  padding-left: 20px;
  width: calc(100% - 20px);
  border-spacing: 10px;
  color: #333333;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message_inner th {
    text-align: left;
}

.card_message_line {
  background: #d9f9dc;
  border-radius: 999px;
  padding: 8px 14px;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 120px 110px 110px;
  align-items: center;
  font-size: 14px;
  transition: 0.25s;
  box-shadow: 0 3px 6px rgba(0,0,0,0.05);
  margin: 10px 0;
}

.card_message_line:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.12);
}

.card_message_line.unread {
  background: #c8f6ca;
  box-shadow: 0 0 0 2px #b8e6bb inset;
}

.unread-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #d0342c;
  margin-right: 6px;
  vertical-align: middle;
}

.msg-status span.unread-dot[aria-hidden="true"] {
  display: none;
}

.card_message_line a {
  text-decoration: none;
  color: #000;
  font-weight: 500;
}

.card_message_line a:hover {
  text-decoration: underline;
}

.table_header {
  display: none;
}

.msg-row{ cursor:pointer; position:relative; }

/* =========================
   PRE_PROFILE: сообщения — 1 строка + троеточие (DESKTOP/TABLET)
   ========================= */

/* критично для grid: иначе текст не "обрезается" */
.card_message_line > * { min-width: 0; }

/* колонка "Текст" — строго 1 строка */
.message_inner .td_text_pre_profile{
  min-width: 0;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* внутри обычно ссылка — common.css ставит white-space: normal !important, поэтому тут тоже !important */
.message_inner .td_text_pre_profile a{
  display: block;
  min-width: 0;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}


/* ЛК: название товара – одна строка, остальное с троеточием */
.product_card.profile .product_text_box a{
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Активная кнопка "Избранное" — нежно-розовая */
.logout_up a[href*="mode=like"] .profile_mode_button:not(.off){
  background: #ffeef4;
  border-color: #ffd6e4;
  color: #c2185b;
}

/* Остальные кнопки (финальная версия, без дубля) */
.profile_mode_button.off{
  background:#fff;
  border-color:#cfd4da;
  color:#444;
}

/* =========================
   Разное
   ========================= */

.pre_profile_top_block {
    display: flex;
}

.preprof-actions{
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 20px;
    margin: 28px 0 20px;
}

.pre_profile_top_elem {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    text-align: center;
    width: auto;
    flex: 1 1 320px;
    min-width: 0;
}

.pre_profile_top_elem.donate {
    margin-bottom: 0;
}


.preprof-actions .pre_profile_top_elem.cashback .refer-card{
    width: 100%;
    max-width: 100%;
    min-height: 210px;
    margin-top: 0;
    box-sizing: border-box;
}

.pre_profile_top_elem.cashback,
.preprof-actions .preprof-actions-col,
.preprof-actions .pre_profile_top_elem.preprof-donate{
    flex: 1 1 320px;
    max-width: 450px;
}

.preprof-box{
    width: 100%;
    min-height: 210px;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 10px 26px rgba(0,0,0,0.06);
    padding: 18px;
    box-sizing: border-box;
}

.preprof-box--actions{
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.preprof-box--donate{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.preprof-donate__title{
    margin: 0 0 4px;
    font-size: 24px;
    line-height: 1.35;
    font-weight: 500;
    color: #333333;
}

.preprof-box--donate iframe{
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.pre_profile_top_elem .pp-action{
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.pre_profile_top_elem.cashback .cashback_title,
.pre_profile_top_elem.cashback .cashback_text {
    margin-left: auto;
    margin-right: auto;
}

.photo-container-1 {
    max-width: 250px;
    width: 100%;
    margin: 20px auto;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 16px 20px rgba(0, 0, 0, 0.2);
}
.photo-container-1 img {
    width: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 16px 20px rgba(0, 0, 0, 0.2);
}
.photo-container-1 .photo-0 {
    position: relative;
    z-index: -2;
}
.photo-container-1 .photo-1 {
    position: absolute;
    top: -100%;
    animation: fromtop 10s linear 5s infinite;
}
.photo-container-1 .photo-2 {
    position: absolute;
    top: -100%;
    animation: fromtop 10s linear infinite;
}


@keyframes fromtop {
    0% { top: -100%; }
    4% { top: 0; }
    5% { top: -20px; }
    6% { top: 0; }
    49.99999% { top: 0; z-index: 1; }
    50% { top: 0; z-index: -1; }
    100% { z-index: -1; top: 0; }
}

.cashback_title {
    width: auto;
    font-size: 20px;
    position: static;
    background-color: transparent;
    overflow: visible;
}

.cashback_title:after {
    content: none;
}

.profile_screen_container {
    width: calc(100vw - 16px);
    overflow: hidden;
}

.profile_screen_inner {
    width: calc((100vw - 16px) * 2);
    display: flex;
}

.profile_screen {
    width: calc(100vw - 16px);
    transition: 1s;
}

.profile_switch {
    background-color: #1c9675;
    margin-left: auto;
    margin-right: auto;
    width: 250px;
    justify-content: center;
    border-radius: 8px;
    padding: 10px 5px;
    margin-top: 20px;
    color: white;
    cursor: pointer;
    display: flex;
    transition: 0.3s;
}

.profile_switch:hover {
    transform: scale(1.025);
}

.profile_switch img {
    height: 20px;
    width: 20px;
}

.profile_screen.first {
    transform: translateX(calc((100vw - 16px) * -1));
}

.profile_screen.first.active {
    transform: translateX(0);
}

.profile_screen.second {
    transform: translateX(0);
}

.profile_screen.second.active {
    transform: translateX(calc((100vw - 8px) * -1));
}

@keyframes cashback_title_animation {
    from { background-position: 0 0; }
    to { background-position: 100% 0; }
}

.cashback_text {
    font-size: 10px;
    color: #717375;
}

.refer_text {
    margin-top: 10px;
    font-size: 16px;
    color: #333333;
}


.cashback_title.block {
    margin: 0;
    font-size: inherit;
}

.preprof-donate > div {
    margin: 0;
}

/* =========================
   Ограничение текста сообщений до 1 строки
   ========================= */

@media (min-width: 992px) {
    .message_text_card {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        display: block !important;
        height: 20px !important;
        line-height: 20px !important;
    }
}

@media (max-width: 768px) {
    .message_block .message_text_card {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        height: 18px !important;
        line-height: 18px !important;
        display: block !important;
    }
}

/* =========================
   Адаптив (планшет/мобилка)
   ========================= */

@media screen and (max-width: 991px) {

    /* PRE_PROFILE */
    .pre_profile_top_block {
        flex-direction: column;
    }

    .pre_profile_top_elem {
        width: 100%;
    }

    .pre_profile_top_elem.cashback {
        width: calc(100% - 40px);
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    .pre_profile_top_elem.cashback .cashback_title,
    .pre_profile_top_elem.cashback .cashback_text {
        margin-left: auto;
        margin-right: auto;
        text-align: center;
    }

    /* refer-card */
    .refer-card {
        flex-direction: column;
        align-items: stretch;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
        max-width: 360px;
    }

    .refer-card__image {
        align-self: center;
        max-width: 160px;
        margin-left: auto;
        margin-right: auto;
    }

    .refer-card__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .refer-card__btn {
        width: 100%;
        text-align: center;
    }

    /* FORMS */
    .container_pr form .form_inner {
        flex-direction: column;
    }
    
    .container_pr{
    padding-left: 6px;
    padding-right: 6px;
    box-sizing: border-box;
    }

    .container_pr input[type="text"],
    .container_pr input[type="email"],
    .container_pr input[type="tel"],
    .container_pr input[type="number"],
    .container_pr input[type="url"] {
        width: calc(100% - 8px);
    }


    .container_pr_form_left {
        width: 100%;
        margin-top: 0;
    }

    .container_pr_form_right {
        width: 100%;
        margin-top: 10px;
        margin-left: 0;
    }

    .window_2 { margin-bottom: 0; }

    .window_3 {
        width: calc(100% - 42px);
    }

    .window_4 {
        width: calc(100% - 8px);
        margin-top: 10px;
    }

    .container_pr_form_right input {
        width: calc(100% - 8px);
    }

    .product_text_box.profile {
        width: 100%;
        margin-top: 10px;
    }

    /* Кнопки под объявлением */
    .profile_product_buttons{
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .profile_product_buttons form,
    .profile_product_buttons a{
        width: 100%;
        max-width: 260px;
    }

    .form_line {
        flex-direction: column;
    }

    .label_input {
        width: calc(100% - 8px);
        flex-direction: column;
    }

    .container_pr_form_right select {
        width: calc(102% - 8px);
        margin-bottom: 15px;
    }

    .label_input.big,
    .label_input.big.file,
    .label_input.file input,
    .container_pr_form_right input.city {
        width: calc(100% - 8px);
    }

    .product_pictures_box.change {
        width: 50%;
    }

    .product_pictures_box.change img {
        border-radius: 5px;
    }

    .form_line.not_column {
        flex-direction: row;
    }

    .photo_line {
        position: absolute;
        left: -9999px;
    }

    /* =========================
       Мобильные таблицы ТОЛЬКО форм профиля
       ========================= */

    .container_pr table { border: 0; }

    .container_pr table tr{
        margin-bottom: 5px;
        display: block;
        border-bottom: 2px solid #ddd;
    }

    .container_pr table td{
        display: block;
        font-size: 12px;
        border-bottom: 1px dotted #ccc;
    }

    .container_pr table td:last-child{
        border-bottom: 0;
    }

    .container_pr table td:before{
        content: attr(data-label);
        float: left;
        text-transform: uppercase;
        font-weight: bold;
    }

    /* =========================
       Сообщения (НЕ таблица)
       ========================= */

    .message_inner {
        padding: 10px 5px;
        width: calc(100% - 10px);
    }

    .table_header { display: none; }

    .card_message_line {
        margin-top: 12px;
    }

    .card_message_line .right {
        text-align: right;
        width: 100%;
    }

    .message_text_card {
        height: 14px;
    }

    /* ВАЖНО: flex УБРАН — он ломал ellipsis */
    /* .td_text_pre_profile { display:flex; } — УДАЛЕНО */

    .card_message_line div {
        margin-right: 0;
    }

    .change_profile_settings div {
        flex-direction: column;
    }

    .pre_profile_top_elem.donate {
        text-align: center;
    }

    /* Кнопки pre_profile */
    .pre_profile_top_elem .pp-action{
        width: 100%;
        max-width: 300px;
        margin: 12px 0;
    }
}


/* === Mobile: прижать карточки под "Создать продукт" === */
@media (max-width: 768px){
  .product_table.profile{
    width: 100% !important;
    padding-left: 2px;
    padding-right: 2px;
    box-sizing: border-box;
  }

  .product_table.profile > *{
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* --- Мобильная адаптация пузырчатых сообщений --- */
@media (max-width: 720px) {

  .message_block {
    padding: 16px 10px;
    margin: 20px auto 40px;
    border-radius: 16px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
  }

  .message_top_block {
    margin-bottom: 12px;
  }

  .message_top_block img {
    width: 36px;
    height: 36px;
  }

  .message_inner {
    gap: 8px;
  }

  .card_message_line {
    grid-template-columns: 1fr;
    row-gap: 4px;
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 14px;
  }

  /* КРИТИЧНО: одна строка + троеточие */
  .card_message_line > * {
    min-width: 0;
  }

  .card_message_line div,
  .message_date_card,
  .message_text_card,
  .message_is_reading_card,
  .message_reply_card {
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .message_date_card {
    font-size: 12px;
    opacity: 0.85;
  }

  .message_text_card {
    margin: 2px 0 4px;
  }

  .message_is_reading_card,
  .message_reply_card {
    font-size: 12px;
  }
}



/* =========================
   Settings / inputs
   ========================= */

.change_profile_settings button {
    width: 342px;
    margin-left: auto;
    margin-right: auto;
    display: block;
    margin-bottom: 15px;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    background-color: #e2e6ea;
    border: solid 1px black;
    transition: 0.3s;
}

.change_profile_settings button:hover {
    transform: scale(1.025);
}

.change_profile_settings div {
    display: flex;
    justify-content: center;
}

.change_profile_settings div div {
    display: flex;
    flex-direction: column;
    padding: 20px;
    padding-top: 0;
}

.change_profile_settings label {
    padding-top: 5px;
    cursor: pointer;
    padding-bottom: 5px;
}

.fiz_face {
    cursor: auto !important;
}

.change_profile_settings input {
    font-size: 16px;
    border: solid 3px #e2e6ea;
    border-radius: 5px;
    appearance: none;
}

.change_profile_settings input::-webkit-outer-spin-button { appearance: none; }
.change_profile_settings input::-webkit-inner-spin-button { appearance: none; }

.is_legal_line {
    flex-direction: row !important;
    padding: 0 !important;
    justify-content: left !important;
}

.change_profile_settings input[type='checkbox'] {
    width: 15px;
    height: 15px;
    margin-left: 15px;
    appearance: auto;
}

/* ===============================
   TRUSTMARK — FIX ALIGNMENT
   =============================== */

/* Контейнер бейджа */
.trustmark-line {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
    margin: 6px 0;
}

/* Сам кружок */
.trustmark-line .trust-dot {
    margin: 0 !important;
}

/* ===== ЛК: центрируем cashback ===== */
.preprof-actions .pre_profile_top_elem.cashback{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.preprof-actions .pre_profile_top_elem.cashback .cashback_title,
.preprof-actions .pre_profile_top_elem.cashback .cashback_text{
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.preprof-actions .pre_profile_top_elem.cashback .refer-card{
  margin-left: auto;
  margin-right: auto;
}

.preprof-actions .pre_profile_top_elem.cashback .refer-card__image{
  margin-left: auto;
  margin-right: auto;
}

/* ===== REFER CARD: STACK (фикс) ===== */
.refer-card__actions.refer-card__actions--stack{
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
}

.refer-card__actions.refer-card__actions--stack .refer-card__link,
.refer-card__actions.refer-card__actions--stack .refer-card__btn{
    width: 100%;
    flex: none;
    box-sizing: border-box;
}
/* ===== ЛК: донат — центрирование (десктоп + мобилка) ===== */
.preprof-actions .pre_profile_top_elem.preprof-donate {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.preprof-actions .pre_profile_top_elem.preprof-donate > .preprof-box{
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.preprof-actions .pre_profile_top_elem.preprof-donate iframe {
  display: block;
  max-width: 100%;
}



/* ===== Мобилка: три блока в колонку ===== */
@media (max-width: 768px) {
  .preprof-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .preprof-actions .pre_profile_top_elem,
  .preprof-actions .pre_profile_top_elem.cashback,
  .preprof-actions .preprof-actions-col,
  .preprof-actions .pre_profile_top_elem.preprof-donate{
    width: 100%;
    max-width: 100%;
    flex: 1 1 auto;
  }

  .preprof-box,
  .preprof-actions .pre_profile_top_elem.cashback .refer-card{
    min-height: auto;
  }

  .profile_screen_container{
    padding-left: 6px;
    padding-right: 6px;
    box-sizing: border-box;
  }


  /* таблица карточек — без вылезаний за край */
  .product_table.profile{
    width: 100% !important;
    padding: 4px 0 0 0 !important;          /* паддинги теперь на контейнере выше */
    box-sizing: border-box;
  }

  /* карточка — гарантированно скругляется и "режет" внутренности по радиусу */
  .product_card.profile{
    border-radius: 12px;
    overflow: hidden;
    box-sizing: border-box;
  }
  
  .container_pr_form_left input,
  .container_pr_form_left select,
  .container_pr_form_left textarea,
  .container_pr_form_right input,
  .container_pr_form_right select,
  .container_pr_form_right textarea{
    width: calc(100% - 8px) !important;
    box-sizing: border-box;
    padding: 10px 12px;
    min-height: 42px;
    line-height: 20px;
    border: 1px solid #cfd7df;
    border-radius: 10px;
    background: #fff;
    outline: none;
  }

  /* select чуть иначе рендерится — выровняем высоту */
  .container_pr_form_left select,
  .container_pr_form_right select{
    min-height: 42px;
  }

  /* textarea — чтобы не была “плоской” и слишком маленькой */
  .container_pr_form_left textarea,
  .container_pr_form_right textarea{
    min-height: 110px;
    resize: vertical;
  }

  /* приятный фокус */
  .container_pr_form_left input:focus,
  .container_pr_form_left select:focus,
  .container_pr_form_left textarea:focus,
  .container_pr_form_right input:focus,
  .container_pr_form_right select:focus,
  .container_pr_form_right textarea:focus{
    border-color: rgba(47,128,237,0.65);
    box-shadow: 0 0 0 3px rgba(47,128,237,0.15);
  }
}

@media screen and (max-width: 768px) {

    /* Левая и правая колонки формы — симметрия */
    .container_pr_form_left,
    .container_pr_form_right {
        width: 100%;
        margin-left: 0;
        padding-left: 6px;
        padding-right: 6px;
        box-sizing: border-box;
    }

    /* Инпуты и селекты — одинаковая геометрия */
    .container_pr_form_right input,
    .container_pr_form_right select,
    .container_pr_form_left input,
    .container_pr_form_left select,
    .container_pr_form_left textarea {
        width: 100%;
        border-radius: 6px;
    }

    /* Фото-блоки — убираем уезд вправо */
    .product_pictures_box,
    .product_pictures_box.change {
        margin-left: auto;
        margin-right: auto;
    }
    
    .profile_screen.first {
    transform: translateX(calc((100vw - 8px) * -1));
    }
}

/* =========================
   DESKTOP FIX: ровные инпуты в правой колонке (не трогаем мобилку)
   ========================= */
@media (min-width: 992px){

  /* лейбл+поле в ряд, аккуратная сетка */
  .container_pr_form_right .form_line{
    gap: 14px;
    align-items: center;
  }

  /* вместо width:40/60 даём флексовую геометрию */
  .container_pr_form_right .label_input{
    width: auto;         /* перебиваем width:40% */
    flex: 1 1 0;
  }

  .container_pr_form_right .label_input.big{
    width: auto;         /* перебиваем width:60% */
    flex: 1.35 1 0;
  }

  /* КЛЮЧЕВОЕ: отменяем width:auto, возвращаем нормальную ширину полей */
  .container_pr_form_right input,
  .container_pr_form_right select,
  .container_pr_form_right .label_input input,
  .container_pr_form_right .label_input select{
    width: 100% !important;
    box-sizing: border-box;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid #cfd7df;
    border-radius: 8px;
  }

  /* чтобы select визуально был как input */
  .container_pr_form_right select{
    padding: 6px 10px;
  }

  /* фиксированные ширины лейблов оставляем, но выравниваем */
  .container_pr_form_right .small_label,
  .container_pr_form_right .big_label{
    flex: 0 0 auto;
  }
}

/* =========================
   DESKTOP: убираем лишние вертикальные отступы от input'ов,
   делаем межстрочный отступ через .form_line,
   и приводим левую колонку к виду правой
   ========================= */
@media (min-width: 992px){

  /* 1) Нормальный вертикальный ритм строк */
  .container_pr_form_right .form_line{
    margin-bottom: 14px;
    align-items: center;
  }

  /* 2) УБИРАЕМ тот самый лишний отступ, который "роняет" регион вниз */
  .container_pr_form_right input,
  .container_pr_form_right select{
    margin-bottom: 0 !important;
  }

  /* 3) Лейблы делаем читаемыми (они у тебя сейчас очень бледные) */
  .container_pr_form_right label{
    color: #1b1f23;
    font-weight: 600;
  }

  /* 4) РЕГИОН: если строка одна (город скрыт) — пусть занимает нормальную ширину */
  .container_pr_form_right .label_input.big{
    flex: 1 1 0;
  }

  /* 5) Левая колонка — как правая (красивые инпуты + одинаковая геометрия) */
  .container_pr_form_left{
    margin-top: 55px; /* оставляем как было */
    text-align: left; /* чтобы не "плавало" */
  }

  /* Заголовок */
  .container_pr_form_left .window input[type="text"]{
    width: 100% !important;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid #cfd7df;
    border-radius: 8px;
    box-sizing: border-box;
  }

  /* Описание */
  .container_pr_form_left .window_3{
    width: 100% !important;      /* было 70% */
    padding: 12px 12px;          /* было 20px — слишком жирно для десктопа */
    border: 1px solid #cfd7df;
    border-radius: 8px;
    box-sizing: border-box;
  }

  /* Два селекта (категория/подкатегория) в одну линию красиво */
  .container_pr_form_left > div:last-child{
    display: flex;
    gap: 12px;
  }

  .container_pr_form_left .window_4{
    width: 100% !important;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid #cfd7df;
    border-radius: 8px;
    box-sizing: border-box;
    background: #fff;
  }
}

/* =========================
   DESKTOP: лейблы справа не должны сжимать поля
   ========================= */
@media (min-width: 992px){

  /* убираем старые width:50/90 именно в правой колонке */
  .container_pr_form_right .small_label,
  .container_pr_form_right .big_label{
    width: auto !important;
    display: block;
    flex: 0 0 72px;        /* ширина колонки лейблов (подгони: 64/72/80) */
    color: #1b1f23;        /* чтобы не были бледными */
    font-weight: 600;
    line-height: 1.2;
  }

  /* чтобы поля занимали всё остальное */
  .container_pr_form_right .label_input{
    gap: 10px;
  }

  .container_pr_form_right .label_input input,
  .container_pr_form_right .label_input select{
    flex: 1 1 auto;
    min-width: 0;
  }
  
  form[action*="add_request"] .form_inner{
    padding-left: 10px;
    box-sizing: border-box;
  }

}

/* ===== MOBILE: центр кнопок в карточке ===== */
@media (max-width: 768px){

  .preprof-box--actions{
    align-items: center;   /* ключевое */
  }

  .preprof-box--actions .pp-action{
    width: 100%;
    max-width: 260px;      /* вот это даёт центр */
    margin: 0 auto;
  }

}