:root {
    --bg-gradient-start: #68B7FF;
    --bg-gradient-end: #7A8DFF;
    --text-color: #ffffff;
    --primary-blue: #28418B;
    --secondary-blue: #426BE6;
    --button-blue: #3A84FF;
    --input-bg: #2d30fc;
    --hover-blue: #989aff;
    --input-border: #e0e0e0;
    --input-placeholder: #001F54;
    --gradient-chat: linear-gradient(180deg, #F2F5FF 0%, #E9EFFF 100%);
    --gradient-blur: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    --disabled-blue: rgba(173, 199, 255, 0.6);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-chat: #D8DEFF;
    --transparent: transparent;
    --telegram-header-height: 50px; /* Высота шапки Telegram */

    /* New Design */
    --white: #ffffff;

    --blue-50: #edf1ff;
    --blue-100: #c7d5fe;
    --blue-200: #abc0fe;
    --blue-300: #85a3fe;
    --blue-400: #6d91fd;
    --blue-500: #4976fd;
    --blue-600: #426be6;
    --blue-700: #3454b4;
    --blue-800: #28418b;
    --blue-900: #1f326a;
    
    --grey-50: #f3f4f7;
    --grey-100: #d9dce5;
    --grey-200: #c6cbd8;
    --grey-300: #acb3c6;
    --grey-400: #9ca4bb;
    --grey-500: #838daa;
    --grey-600: #77809b;
    --grey-700: #5d6479;
    --grey-800: #484e5e;
    --grey-900: #373b47;
    --grey-950: #282A33;

    --marine-50: #e8f9fa;
    --marine-100: #b6edf1;
    --marine-200: #93e4ea;
    --marine-300: #62d7e0;
    --marine-400: #43d0da;
    --marine-500: #14c4d1;
    --marine-600: #12b2be;
    --marine-700: #0e8b94;
    --marine-800: #0b6c73;
    --marine-900: #085258;

    --tag-bg-active: #77809b;
    --tag-bg-inactive: #C6CBD8;
    --tag-text-active: #ffffff;
    --tag-text-inactive: #ffffff;

    /* Contact Card Variables from Figma */
    --Sizes-Contacts-Contact-card-width: 70px;
    --Sizes-Contacts-Contact-card-height: 100px;
    --Sizes-Contacts-Contact-card-padding: 0;
    --Sizes-Contacts-Contact-card-gap: 1px;
    --Sizes-Avatar-Outline-Size-av-outline-size-md: 64px;
    --Sizes-Avatar-Outline-Radius-av-outline-rd-md: 16px;
    --Sizes-Avatar-Stroke-av-stroke-md: 3px;
    --Sizes-Contacts-Contact-name-height: 30px;
    --Sizes-Contacts-Contact-name-width: 70px;
    --Spacing-sp-md: 6px;
    --Spacing-sp-0: 0;
    --MainGradient-angled: #EFA7E1;
    --offline-avatar-gradient: linear-gradient(135deg, #E2E2E2 0%, #DDDDDD 25%, #94DAC6 50%, #63A0D9 100%);

    /* Tab-bar переменные из Figma */
    --Sizes-Tab-bar-Tab-bar-padding-top: 8px;
    --Sizes-Tab-bar-Tab-bar-padding-hor: 20px;
    --Sizes-Tab-bar-Tab-bar-padding-bottom: 12px;
    --Sizes-Tab-bar-Tab-bar-rd: 16px;
    --Color-Tab-bar-Tab-bar-bg: #000;
    --Sizes-Tab-bar-Search-button-rd: 12px;
    --Color-Tab-bar-Search-button-bg-active: #FFF;
    --Sizes-Tab-bar-Search-credits-rd: 8px;
    --Color-Tab-bar-Search-credits-bg: #ACB3C6; /* Оставляем для других элементов */
    --Color-Tab-bar-Search-icon-active: #000;

    /* Static app height for Telegram/iOS viewport quirks */
    --app-height: 100svh;

    /* New Design End */
}

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;700&display=swap');

/* New Design */

body, html {
    margin: 0;
    padding: 0;
    height: var(--app-height);
    width: 100vw;
    overflow: hidden;
}

/* Универсальный отступ для всех основных контейнеров экранов */
.greeting-bg, 
.chat-list-bg,
.chat-bg,
.luni-chat-bg,
.thoughts-main,
.thoughts-container,
.thought-detail-container,
.create-thought-container,
#register_container,
.profile-bg,
.splash-bg,
.avatar-bg,
.settings-bg,
.friend-profile-bg
{
    padding-top: var(--telegram-header-height) !important;
}

/* Улучшения для мобильных устройств */
@media screen and (max-width: 768px) {
    /* Предотвращаем зум при фокусе на input */
    input:not(.onboarding-input), textarea, select:not(.custom-select) {
        font-size: 16px;
    }
    
    /* Адаптивность для кнопки ожидающих друзей */
    .pending-friends-btn {
        width: 46px;
        height: 46px;
    }
    
    .pending-friends-icon {
        width: 46px;
        height: 46px;
    }
    
    /* Улучшаем поведение клавиатуры */
    .chat-my-input-container {
        position: relative;
        z-index: 1000;
    }
    
    /* Плавная анимация при появлении клавиатуры */
    .chat-content {
        transition: transform 0.3s ease;
    }
}
 
/* Avatar cursor styles */
.chat-header-avatar img {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.chat-header-avatar img:hover {
    opacity: 0.8;
}

/* Context Menu Styles */
.context-menu {
    position: fixed;
    z-index: 1000;
    background: var(--grey-800);
    border-radius: 16px;
    padding: 8px 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid var(--grey-700);
    width: 273px;
    min-height: 144px;
    opacity: 0.95;
}

.user-context-menu-item,
.chat-context-menu-item,
.thoughts-context-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 22px;
    position: relative;
    color: var(--white);
}

.user-context-menu-item:not(:last-child)::after,
.chat-context-menu-item:not(:last-child)::after,
.thoughts-context-menu-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--grey-700);
}

.user-context-menu-item:hover,
.chat-context-menu-item:hover,
.thoughts-context-menu-item:hover {
    background-color: var(--grey-700);
}

.user-context-menu-item:first-child,
.chat-context-menu-item:first-child,
.thoughts-context-menu-item:first-child {
    border-radius: 12px 12px 0 0;
}

.user-context-menu-item:last-child,
.chat-context-menu-item:last-child,
.thoughts-context-menu-item:last-child {
    border-radius: 0 0 12px 12px;
}

.user-context-menu-item:only-child,
.chat-context-menu-item:only-child,
.thoughts-context-menu-item:only-child {
    border-radius: 12px;
}

.user-context-menu-item[data-action="block"],
.user-context-menu-item[data-action="report"] {
    color: #DB7082;
}

.context-menu-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.greeting-text-block {
    position: fixed;
    z-index: 3;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 500px;
    min-height: 120px;
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 700;
    font-size: 32px;
    line-height: 40px;
    text-align: center;
    color: var(--grey-950);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    pointer-events: none;
    padding: 0 20px;
    box-sizing: border-box;
}

.greeting-text {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 0;
    font-size: 2.2rem;
    line-height: 1.1;
    color: var(--grey-950);
    word-break: break-word;
}

.chat-list-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    height: var(--app-height);
}

#chat_list_container { height: var(--app-height); }

.chat-list-header-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 24px 24px 0 24px;
    background: transparent;
    box-shadow: none;
    min-height: 72px;
    position: relative;
    z-index: 3;
    flex-shrink: 0;
}

.chat-list-header-text {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 40px;
    line-height: 1.1;
    color: var(--grey-950);
    margin-right: auto;
    margin-left: 0;
    text-align: left;
    width: auto;
    height: auto;
    z-index: 4;
}

/* Help button in chat list header */
.help-button {
    margin-left: 8px;
    margin-right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 999px; /* circular */
    border: 0;
    background: #838DAA; /* light chip */
    color: #F1F3F8; /* icon color from spec */
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 18px; /* visual 24px icon ≈ 18-20 text */
    line-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.help-button:active { background: #E9ECF3; }

/* Optional dark style if needed by design */
/* removed: .help-button--dark (unused) */

.chat-list-user-info {
    display: flex;
    min-width: 146px;
    height: 52px;
    padding: 8px 0px 8px 8px;
    align-items: center;
    gap: 8px;
    border-radius: var(--Sizes-User-card-user-card-radius, 16px);
    background: var(--Color-User-card-username-bg, #FFF);
    margin-left: 24px;
    box-sizing: border-box;
}

#chatAvatar {
    width: 20px !important;
    height: 20px !important;
    border-radius: 6px; /* Пропорционально меньше */
    object-fit: cover;
    background: var(--offline-avatar-gradient); /* Используем тот же градиент */
    border: none;
}

.chat-list-user-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 1;
    overflow: hidden;
    color: var(--Color-User-card-username-online, #373B47);
    text-align: right;
    leading-trim: both;
    text-edge: cap;
    text-overflow: ellipsis;
    margin: 0;
    background: none;
    flex: 1;

    /* User */
    font-family: var(--Text-font-family, Manrope);
    font-size: var(--Text-Font-size-user-card-fonsize, 16px);
    font-style: normal;
    font-weight: 600;
    line-height: var(--Text-Line-height-chatlist-username-lineheight, 16px); /* 100% */
    letter-spacing: var(--Text-Letter-spacing-letter-spacing-sm, -0.25px);
}

.settings-arrow {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    margin-right: 8px;
    cursor: pointer;
}
.settings-arrow svg {
    width: 24px;
    height: 24px;
}

.chat-list-friends-block {
    width: 100%;
    background-color: var(--white);
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Onboarding overlay */
#onboarding-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: var(--app-height);
    z-index: 2000;
    display: none;
}

#onboarding-overlay.show { display: block; }

.onboarding-mask {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

/* Label style (white text like in Figma) */
.onboarding-label {
    position: absolute;
    max-width: 300px;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Manrope", system-ui, sans-serif;
    font-weight: 600;
    font-size: 16px;
    line-height: 21px;
    letter-spacing: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.35);
    user-select: none;
    pointer-events: none;
}

.onboarding-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.onboarding-svg path {
    stroke: #fff;
    stroke-width: 2.5;
    fill: none;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}

.onboarding-svg circle {
    fill: #fff;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}

/* Optional Figma-exported PNG overlay */
.onboarding-img {
    position: absolute;
    top: 0; left: 0;
    width: 390px; /* design width */
    height: 844px; /* design height */
    transform-origin: top left;
    pointer-events: none;
}

/* removed: legacy callout arrow helpers (unused) */
.chats-list {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-auto-rows: min-content !important;
    gap: 0 !important;
    overflow-y: auto;
    padding: 4px 16px !important;
    box-sizing: border-box;
    flex: 1;
}

.chat-list-tab {
    border: none;
    outline: none;
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 700;
    height: 30px;
    padding: 0 16px;
    background: var(--tag-bg-inactive);
    color: var(--tag-text-inactive);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin-right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-list-tab.active {
    background: var(--tag-bg-active);
    color: var(--tag-text-active);
}

#tabAll {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
}
#tabOnline {
    width: 76px;
    min-width: 76px;
    max-width: 76px;
}

.grey-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px; /* Минимальное расстояние между аватаром и именем */
    padding: 8px;
    width: 80px; /* Фиксированная ширина для flex-контейнера */
    height: 80px;
    background: var(--grey-600);
    border-radius: 12px;
    color: var(--white);
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    transition: transform 0.2s ease;
    flex-shrink: 0;
    text-align: center;
    border: none;
    outline: none;
    border-width: 0px;
    box-shadow: none;
    border-color: var(--white);
    margin: 0 !important; /* Убираем margin у кнопок */
}

.grey-button:hover {
    transform: scale(1.05);
}

#luni_chat_last_messages {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: var(--white);
    border-radius: 16px;
    margin: 0 auto;
    padding: 12px 24px 48px 24px;
    width: 100%;
    max-width: 366px;
    height: 82px;
    box-sizing: border-box;
    position: relative;
    bottom: 10px; /* Поднимаем выше, чтобы выходил из середины бара */
    z-index: 3; /* Поверх градиента */
}

.luni-chat-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    width: 100%;
    gap: 8px;
}
.luni-chat-info-header > * {
    margin-right: 10px;
}

.luni-name-text {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 800;
    font-size: 18px;
    line-height: 22px;
    letter-spacing: -0.5px;
    color: var(--grey-950);
    flex-shrink: 0;
}

.luni-chat-info-header-img {
    width: 12px;
    height: 12px;
    margin-left: -8px; /* Сдвигаем картинку влево */
    margin-top: -2px; /* Поднимаем картинку ближе к надписи "Луни" */
}

/* Стили для контейнера Luni согласно дизайну Figma */
#luni_chat_container {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    height: 164px;
    box-sizing: border-box;
    padding: 0 12px 12px 12px;
    cursor: pointer;
    z-index: 0;
}

#luni_chat_container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, #EFA7E1 0%, #A9F0E8 25%, #9CBEFD 50%, #F6EAC0 75%, #D1F39E 100%);
    opacity: 0.3;
    filter: blur(15px);
    z-index: -1;
    border-radius: 16px;
    pointer-events: none;
}

.chats-list::after {
    display: none;
}

.greeting-bg,
.chat-list-bg,
.chat-bg,
.luni-chat-bg,
.thoughts-main {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    width: 100%;
    background: var(--grey-50);
}

.greeting-circle-blur, 
.chat-list-circle-blur,
.chat-bg-circle-blur,
.thoughts-circle-blur
{
    position: absolute;
    z-index: 0;
    width: 500px;
    height: 500px;
    left: calc(50% - 500px/2);
    top: 41px;
    
    /* Gradient-main-hor */
    background: linear-gradient(90deg, #EFA7E1 0%, #A9F0E8 25%, #9CBEFD 50%, #F6EAC0 75%, #D1F39E 100%);
    filter: blur(50px);
    /* Animation properties */
    animation: floatAnimation 10s ease-in-out infinite;

}

@keyframes floatAnimation {
  0% {
    transform: translateY(-50svh);
  }
  50% {
    transform: translateY(10svh);
  }
  100% {
    transform: translateY(-50vh);
  }
}

.chat-header-container, 
.chat-list-header-container,
.luni-chat-header-container 
{
    display: flex;
    position: relative;
    justify-content: center;
    align-items: center;
    padding-top: var(--telegram-header-height);
    padding-left: 30px;
    padding-right: 20px;
    padding-bottom: 0px;
    z-index: 3;
}

.back-arrow {
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 12px;
    height: 24px;
    cursor: pointer;
}

.chat-header-text, 
.luni-chat-header-text 
{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Manrope', sans-serif;
    font-style: normal;
    font-weight: 800;
    font-size: 16px;
    line-height: 22px;
    text-align: center;
    color: var(--grey-800);
}

.chat-header-avatar {
    margin-left: auto;
}

.chat-content {
    display: flex;
    flex-direction: column;
}

.chat-my-input-container {
    position: relative;
    z-index: 3;
    display: grid;
    place-items: center;
    align-items: center;
    background: var(--grey-600);
    min-height: 100px;
    border-radius: 24px;
    padding: 16px;
    margin-left: 12px;
    margin-right: 12px;
}

.chat-my-input-textarea {
    position: relative;
    z-index: 4;
    flex: 1;
    background: transparent;
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    color: white;
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 600;
    font-size: 24px;
    line-height: 24px;
    align-items: center;
    text-align: center;
    /* Улучшения для мобильных устройств */
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    /* Предотвращаем зум на iOS */
    font-size: 24px;
    &::placeholder {
        color: var(--grey-400);
        font-family: 'Manrope', sans-serif; 
        font-size: 24px;
    }
}

.chat-his-messages {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--grey-50);
    min-height: 100px;
    border-radius: 24px;
    gap: 16px;
    padding: 16px;
    margin-left: 12px;
    margin-right: 12px;
    margin-bottom: 12px;
    margin-top: 0px;
}

.luni-chat-his-messages {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--white);
    min-height: 100px;
    border-radius: 24px;
    gap: 16px;
    padding: 16px;
    margin-left: 12px;
    margin-right: 12px;
    margin-bottom: 12px;
}

.chat-his-message, .luni-chat-his-message {
    background: transparent;
    border: none;
    outline: none;
    color: var(--grey-800);
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 600;
    font-size: 24px;
    line-height: 24px;
    align-items: center;
    text-align: center;
}

.chat-i-talk {
    position: relative;
    z-index: 5;
    top: -2px;
}

.chat-he-talk {
    position: relative;
    z-index: 7;
    bottom: -2px;
}

.luni-chat-he-talk {
    position: relative;
    z-index: 10;
    bottom: 6px;
    text-align: left;
    margin-left: 10px;
}

/* Специальные стили для ушек в чате с Луни - центрируем их */
#luni_dialog_container .luni-chat-he-talk {
    text-align: center;
    margin-left: 0;
    bottom: -23px; /* Опускаем ушки ниже */
}

/* Фиксированные размеры досок в диалоге с Луни */
#luni_dialog_container .luni-chat-his-messages {
    height: 120px; /* Фиксированная высота */
    min-height: 120px;
    max-height: 120px;
    margin: 22px 12px 6px 12px; /* 22px сверху, 6px снизу, 12px по бокам */
    overflow-y: auto; /* Скролл если текст не помещается */
}

#luni_dialog_container .chat-my-input-container {
    height: 120px; /* Фиксированная высота, такая же как у доски сообщений */
    min-height: 120px;
    max-height: 120px;
    margin: 0 12px 22px 12px; /* 22px снизу от клавиатуры, 12px по бокам, 0 сверху (6px уже есть у верхней доски) */
}

/* Прижимаем иконку "I Talk" к полю ввода в диалоге с Луни */
#luni_dialog_container .chat-i-talk {
    position: relative;
    top: -23px; /* Поднимаем на 22px, чтобы компенсировать margin-bottom поля ввода */
    margin-bottom: -20px; /* Убираем влияние на последующие элементы */
}

.luni-chat-he-talk-img {
    transition: all 0.3s ease-in-out;
    margin: 0 15.675px; /* Точное расстояние между ушками: 31.35px / 2 = 15.675px */
    vertical-align: middle;
    width: 19.326px;
    height: 23px;
    flex-shrink: 0;
    animation: earPulse 6s infinite;
}

@keyframes earPulse {
    0%, 80% {
        width: 19.326px;
    }
    20% {
        width: 24.58px;
    }
}

.right-image {
    float: right;
    margin-right: 40px;
}

/* Avatar */
.avatar-bg,
.settings-bg
{
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-height: 0; /* allow inner flex children to shrink and scroll */
    height: 100%;
    width: 100%;
    background: var(--grey-50);
    overflow: hidden; /* contain inner scroll */

}

.avatar-bg-circle-blur,
.settings-bg-circle-blur
{
    position: absolute;
    width: 601px;
    height: 88px;
    left: -115px;
    top: 122px;

    background: linear-gradient(90deg, rgba(239, 167, 225, 0.4) 0%, rgba(169, 240, 232, 0.4) 25%, rgba(156, 190, 253, 0.4) 50%, rgba(246, 234, 192, 0.4) 75%, rgba(209, 243, 158, 0.4) 100%);
    filter: blur(25px);
    /* Animation properties */
    animation: floatAnimation 15s ease-in-out infinite;
    z-index: 1;
}

.avatar-content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 16px;
    /* Force a concrete scrollable height inside the fixed container */
    height: calc(var(--app-height) - var(--telegram-header-height));
    box-sizing: border-box;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.avatar-content,
.settings-content
{
    z-index: 3;
}

.avatar-images-block {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    justify-items: center;
    align-items: center;
    margin: 24px 0 0 0;
    padding: 0 16px 0 16px;
    z-index: 4;
}

.avatar-image {
    width: 70px;
    height: 70px;
    padding: 1px;
    justify-content: center;
    display: flex;
    cursor: pointer;
    align-items: center;
}

.avatar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.avatar-header-block,
.settings-header-block {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding-top: var(--telegram-header-height);
    padding-left: 16px;
    padding-right: 16px;
    gap: 8px;
    isolation: isolate;
    height: 40px;
    z-index: 5;
    position: relative;
}

.settings-back-arrow,
.settings-back-arrow-placeholder {
    width: 24px;
    height: 24px;
    z-index: 6;
    cursor: pointer;
}

.avatar-header-text,
.settings-header-text {
    height: 23px;
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 800;
    font-size: 32px;
    line-height: 22px;
    letter-spacing: -0.5px;
    color: var(--grey-900);
    z-index: 6;
    text-align: center;
}

.avatar-block {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;
}

.avatar-block,
.settings-block {
    margin-top: 0px;
    background: var(--grey-50);
    border-radius: 24px 24px 0 0;
    z-index: 5;
}

.settings-block {
    flex: 1;
    position: relative;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 60px;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Контейнер экрана настроек: фиксируем и даём внутренний скролл блоку */
#user_settings_container {
    position: fixed;
    inset: 0;
    height: var(--app-height);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.settings-bg { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
}

.avatar-current-block,
.settings-current-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    letter-spacing: -0.5px;
    margin-bottom: 24px;
}

.avatar-current-text {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 400;
    font-size: 24px;
    line-height: 28px;
    /* identical to box height, or 117% */
    display: flex;
    align-items: center;
    letter-spacing: -0.5px;
    color: var(--grey-800);
}

.avatar-selected {
    box-sizing: border-box;
    width: 160px;
    height: 160px;
    border-radius: 36px;
    object-fit: cover;
}

.avatar-selected-block,
.settings-avatar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 16px;
    gap: 16px;
    isolation: isolate;
}

.settings-avatar img {
    width: 160px;
    height: 160px;
    border-radius: 36px;
    object-fit: cover;
}

.avatar-divider-block {
    width: 80%;
    margin: 0 auto;
}

.avatar-hr {
    width: 100%;
    height: 1px;
    background-color: var(--grey-200);
    margin: 0;
}

.avatar-select-new-text {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 500;
    font-size: 16px;
    line-height: 28px;
    display: block;
    letter-spacing: -0.5px;
    color: var(--grey-700);
    text-align: left;
    margin-left: 0;
    padding-left: 0;
    margin-top: 4px;
}
    
.avatar-button-reject-block {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 24px 0 12px 0;
    padding: 0;
}
    
.avatar-button-choose-block {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0 0 24px 0;
    padding: 0;
}

.avatar-button-reject {
    width: 80%;
    background: var(--white);
    color: var(--grey-500);
    border: none;
    border-radius: 16px;
    font-family: 'Manrope', sans-serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
    letter-spacing: -0.5px;
    padding: 14px 0;
    box-shadow: 0 2px 8px rgba(93, 100, 121, 0.07);
    text-align: center;
    cursor: pointer;
    display: block;
    transition: background 0.2s;
}
.avatar-button-reject:active {
    background: #f5f6fa;
}

.avatar-button-choose,
.settings-button-save {
    width: 80%;
    background: #353843;
    color: var(--white);
    border: none;
    border-radius: 16px;
    font-family: 'Manrope', sans-serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 28px;
    letter-spacing: -0.5px;
    padding: 14px 0;
    text-align: center;
    cursor: pointer;
    display: block;
    transition: background 0.2s;
    margin-bottom: 30px;
}
.avatar-button-choose:active,
.settings-button-save:active {
    background: #23242c;
}

.settings-form-container {
    width: 310px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    flex: 1;
}

#settingsAvatarButton {
    cursor: pointer;   
}

/* New Design End */
  
    .splash-bg {
        display: flex;
        flex-direction: column;
        position: relative;
        min-height: var(--app-height);
        height: auto;
        width: 100%;
        background: var(--white);
        overflow: hidden;
        padding-bottom: 60px; /* Space for bottom container */
}

  .circle-blur {
    display: none; /* Убираем размытый круг для белого фона */
}

.splash-content {
    position: relative;
    z-index: 2;
    overflow-y: auto;
    flex: 1;
    padding: 10px 20px;
    color: var(--text-color);
    font-family: 'Nunito', sans-serif;
    height: auto;
    min-height: var(--app-height);
}
  
.splash-content h1 {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
   font-size: 2rem;
    margin: 0;
  }
  
.splash-content p {
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    opacity: 0.8;
  }

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.chat-header h2 {
    color: var(--primary-blue);
    font-size: 2rem;
}

#bottom_container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    
    padding: 0 30px 20px;
    z-index: 1000;
    display: none;
    box-sizing: border-box;
}

#bottom_container.show {
    display: flex !important;
}

.tab-bar-frame {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0px 12px;
    border-radius: 16px;
    background: #000;
    width: 100%;
    height: 65px;
    box-sizing: border-box;
    margin: 10px 0 28px 0;
}

.tab-bar-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: white;
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    cursor: pointer;
    padding: 8px 20px 8px 20px;
    min-width: 60px;
    margin-top: 8px;
    transition: all 0.2s ease;
}

#bottomThoughtsButton .button-content {
    padding-right: 0;
}

#bottomThoughtsButton img {
    max-width: 28px;
    height: auto;
    object-fit: contain;
    transform: scaleX(-1);
}

.search-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-radius: var(--Sizes-Tab-bar-Search-button-rd, 12px);
    width: 76px;
    height: 42px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    gap: 8px;
    z-index: 10;
}

.search-button img {
    width: 26px;
    height: 26px;
    display: block;
    object-fit: contain;
    filter: brightness(0);
}

.search-friend-counter {
    display: flex;
    padding: var(--Spacing-sp-0, 0) var(--Spacing-sp-md, 8px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-radius: var(--Sizes-Tab-bar-Search-credits-rd, 8px);
    background: var(--Color-Tab-bar-Search-credits-bg, #ACB3C6);
    color: #ffffff;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 12px;
    width: 26px;
    height: 22px;
    box-sizing: border-box;
}

.button-content {
    display: flex;
    height: 100%;
    flex-direction: column;
    align-items: center;
    width: 100%;
    justify-content: center;
}

#bottomChatButton .button-content {
    justify-content: flex-start;
}

#bottomThoughtsButton .button-content {
    justify-content: flex-end;
    flex-direction: column;
}

.thoughts-reverse {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.button-content img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1); /* Делаем иконки белыми */
    margin-bottom: 4px;
}

.tab-bar-option.active .button-content img {
    filter: brightness(0) invert(1); /* Белые иконки для активной кнопки */
}

.tab-bar-option:not(.active) .button-content img {
    filter: grayscale(100%) brightness(0.7); /* Серые иконки для неактивной кнопки */
}

.button-content span {
    display: inline-block;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.tab-bar-option:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.tab-bar-option.active {
    opacity: 1;
}

.tab-bar-option.active .button-content span {
    color: #ffffff;
}

.tab-bar-option:not(.active) .button-content span {
    color: var(--grey-700);
}

.tab-bar-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bottom-button:hover {
    color: var(--secondary-blue);
}

.bottom-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Для кнопок по краям */
.left-button {
    margin-right: auto;
}

.right-button {
    margin-left: auto;
}

/* Убираем search-placeholder, так как он больше не нужен */
.search-placeholder {
    display: none;
}

.search-button:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.search-button:active {
    transform: translate(-50%, -50%) scale(0.98);
    box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}

.back-button {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border: none;
    background: none;
    color: var(--primary-blue);
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.back-button:hover {
    color: var(--secondary-blue);
}

.chat-header h3 {
    color: var(--primary-blue);
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    padding: 4px 12px;
}

.chat-header-container h2 {
    margin: 0;
    margin-left: 20px;
    color: var(--primary-blue);
    font-size: 2rem;
    flex: 1;
    text-align: center;
}

.reply {
    margin-top: 20px;
}

#register_container {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
    overflow-x: hidden;
}

.form-container {
    position: absolute;
    width: 310px;
    top: 232px;
    left: 50%;
    transform: translateX(-50%);
}

.form-item {
    width: 100% !important;
    margin-bottom: 20px !important;
    display: flex !important;
    justify-content: center !important;
}

.btn {
    width: 100%;
    height: 100%;
  
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 24px 10px;
    gap: 10px;
  
    font-family: 'Nunito', sans-serif;
    font-size: 24px;
    font-weight: 600;
    border: none;
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
  }
  
  /* ENABLED */
  .btn:enabled {
    background-color: var(--secondary-blue);
    color: white;
  }
  
  /* DISABLED */
  .btn:disabled {
    background-color: var(--disabled-blue); /* light blue */
    color: white;
    cursor: not-allowed;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  }

#chats-old {
    width: 100%;
    height: 100%;
    background-color: white;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

#chatsList-old {
    width: calc(100% - 48px);
    height: 100%;
    background-color: white;
    padding: 16px;
    margin: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    border-radius: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Chat List Container Style */
.chat-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    width: 100%;
    max-width: 100%;
    margin-top: 5px;
}

.chat-message {
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 5px;
    max-width: 80%;
}

.user-luni-message {
    background-color: var(--input-bg);
    color: var(--tg-theme-button-text-color);
    margin-left: auto;
    text-align: right;
}

.luni-message {
    background-color: transparent;
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 600;
    font-size: 16px;
    line-height: 20px;
    color: #5D6479;
    margin: 0;
    text-align: left;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--input-border);
    border-radius: 5px;
    background-color:var(--input-bg);
    color: var(--tg-theme-text-color);
    font-size: 16px;
    margin-bottom: 10px;
}

/* Chat Interface Styles */

#avatar_container,
#chat_container {
    position: fixed;
    inset: 0;
    height: var(--app-height);
    width: 100vw;
    display: flex;
    flex-direction: column;
    z-index: 100;
    background: var(--grey-50);
    overflow: hidden;
}

.chat-header-container .back-button {
    color: var(--button-blue);
    font-size: 28px;
    font-weight: bold;
}

.chat-header-container h2 {
    flex-grow: 1;
    text-align: center;
    color: var(--button-blue);
    font-size: 18px;
    margin: 0;
    padding-right: 30px; /* space for back button */
}

.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
}

.chat-input-area {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: transparent;
    border-top: none;
    flex-shrink: 0;
}

.chat-input-area #message,
.chat-input-area #luni_message {
    flex-grow: 1;
    border: none;
    background-color: var(--input-bg);
    border-radius: 20px;
    padding: 12px 20px;
    font-size: 16px;
    outline: none;
    color: white;
    resize: none; /* disable manual resizing */
    overflow-y: hidden; /* hide scrollbar */
    font-family: 'Nunito', sans-serif;
    line-height: 1.4;
}

.chat-input-area #message::placeholder,
.chat-input-area #luni_message::placeholder {
    color: white;
    opacity: 0.7;
}

.chat-input-area #sendButton,
.chat-input-area #luniSendButton {
    background: transparent;
    border: none;
    padding: 0 0 0 15px;
    cursor: pointer;
}

/* Overwriting existing message styles */
.chat-message {
    padding: 12px 18px;
    border-radius: 25px;
    max-width: 75%;
    margin-bottom: 10px;
    word-wrap: break-word;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    line-height: 1.4;
    background: var(--gradient-chat) !important;
    color: var(--primary-blue) !important;
    border: 1px solid var(--border-chat);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

.user-message {
    background-color: var(--secondary-blue) !important;
    color: white !important;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    text-align: left !important;
}

/* --- Invitations styles --- */
.invite-notification {
    margin-top: 16px;
    color: #28418B;
    font-size: 1rem;
    text-align: center;
    min-height: 24px;
    transition: opacity 0.3s;
}
#acceptedBlock {
    margin-top: 32px;
}
.accepted-list {
    padding-left: 0;
    list-style: none;
}
.accepted-list li {
    margin-bottom: 8px;
    color: #28418B;
    font-family: 'Nunito', sans-serif;
}
.accepted-username {
    color: #888;
    font-size: 0.95em;
}
#inviteButton, #copyLinkButton {
    margin: 8px 4px 0 0;
}
#backButton {
    position: absolute;
    left: 0;
    top: 0;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #28418B;
}
#backButton:hover {
    color: #426BE6;
}

.friend-border {
    display: flex;
    width: 70px; 
    height: var(--Sizes-Contacts-Contact-card-height, 120px);
    max-width: 70px;
    max-height: var(--Sizes-Contacts-Contact-card-height, 120px);
    padding: var(--Sizes-Contacts-Contact-card-padding, 0);
    flex-direction: column;
    align-items: center;
    gap: 0px; 
    position: relative;
    border: none;
    background: transparent;
    cursor: pointer;
    justify-self: center;
    margin: 2px 4px !important;
}


.friend-border-small {
    display: flex;
    width: 44px; 
    height: 44px;
    max-width: 44px;
    max-height: 44px;
    padding: 0px;
    flex-direction: column;
    align-items: center;
    gap: 0px; 
    position: relative;
    border: 1px;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    justify-self: center;
    margin: 2px !important;
}


/* Стили для тусклой иконки оффлайн пользователей */
.friend-offline .chatListElement {
    opacity: 0.5;
    filter: grayscale(50%);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.friend-offline .contact-name {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.friend-inner {
    display: flex;
    width: 64px;
    height: 64px;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border-radius: 16px;
    background: #fff;
    position: relative;
    padding: 4px; /* Расстояние до обводки 4px */
}

.friend-inner-small {
    display: flex;
    width: 36px;
    height: 36px;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border-radius: 4px;
    background: transparent;
    position: relative;
    padding: 4px;
    justify-self: center;
}


.friend-inner-small-before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 4px;
    border-radius: 10px;
    background: linear-gradient(
        45deg,
        rgba(239, 167, 225, 1) 0%,
        rgba(169, 240, 232, 1) 33%,
        rgba(156, 190, 253, 1) 67%,
        rgba(209, 243, 158, 1) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 1;
    pointer-events: none;
}

.friend-inner::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 4px;
    border-radius: 22px;
    background: linear-gradient(
        45deg,
        rgba(239, 167, 225, 1) 0%,
        rgba(169, 240, 232, 1) 33%,
        rgba(156, 190, 253, 1) 67%,
        rgba(209, 243, 158, 1) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 1;
    pointer-events: none;
}

.friend-inner-no-border::before {
    display: none;
}

.chatListElement {
    display: flex;
    width: 56px;
    height: 56px;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border-radius: 14px;
    border: none;
    background: var(--offline-avatar-gradient);
    color: transparent;
    font-weight: bold;
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
    text-align: center;
    overflow: hidden;
    position: relative;
    z-index: 2;

}

.contact-name {
    display: flex;
    height: var(--Sizes-Contacts-Contact-name-height, 30px);
    max-width: var(--Sizes-Contacts-Contact-name-width, 70px);
    max-height: var(--Sizes-Contacts-Contact-name-height, 30px);
    padding: var(--Spacing-sp-0, 0);
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    align-self: stretch;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.2;
    color: var(--grey-800);
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    word-wrap: break-word;
    white-space: normal;
}

/* Для кнопок "Пригласить друзей" и "Команда Луни" убираем отрицательный margin */
.friend-inner-no-border + .contact-name {
    margin-top: 0px;
}

/* Убеждаемся что контейнеры кнопок имеют правильные размеры */
#inviteFriendButton .friend-inner,
#luniTeamButton .friend-inner {
    width: 56px !important;
    height: 56px !important;
    border-radius: 14px !important;
    padding: 0 !important;
}

/* Специальные стили для кнопок "Пригласить друзей" и "Команда Луни" */
#inviteFriendButton,
#luniTeamButton {
    background: #ACB3C6 !important;
    border-radius: 14px !important; /* Такой же как у .chatListElement */
    width: 56px !important;
    height: 56px !important;
}

/* Специальные стили для chatAvatar контейнера */
#chatUserInfo .friend-border {
    width: 36px; /* 28px + 4px padding с каждой стороны */
    height: 36px; /* 28px + 4px padding с каждой стороны */
    max-width: 36px;
    max-height: 36px;
}

#chatUserInfo .friend-inner {
    width: 28px; /* 20px + 4px padding с каждой стороны */
    height: 28px; /* 20px + 4px padding с каждой стороны */
    border-radius: 8px; /* Пропорционально меньше */
    padding: 4px; /* 4px padding */
}

#chatUserInfo .friend-inner::before {
    border-radius: 12px; /* 8px + 4px padding */
    padding: 4px; /* 4px padding */
}

.chat-list-tabs {
    width: 100%;
    max-width: 100%;
    height: 64px;
    background: #fff;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 8px 21px;
    gap: 8px;
    border-radius: 0;
    margin-bottom: 8px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.chat-tabs-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Right side of tabs: help button next to black plus */
.chat-tabs-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pending-friends-btn {
    position: relative;
    width: 53px;
    height: 53px;
    flex-shrink: 0;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    cursor: pointer;
    border: none;
    outline: none;
}

/* Базовые стили для иконки */
.pending-friends-icon {
    width: 53px;
    height: 53px;
    display: block;
}

.pending-friends-icon {
    width: 53px;
    height: 53px;
    display: block;
    
}

.pending-friends-counter {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    background: #000;
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 13px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    z-index: 2;
}

/* Invisible toggle styles */
.invisible-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    color: #28418B;
    margin: 10px 0;
}

.invisible-toggle input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #E6E6EB;
    position: relative;
    margin-right: 12px;
    transition: background-color 0.3s ease;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.invisible-toggle input[type="checkbox"]:checked + .toggle-slider {
    background-color: #43D0DA;
}

.invisible-toggle input[type="checkbox"]:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-label {
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Pending requests watermark */
.pending-requests-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent;
    padding: 8px 16px;
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 300;
    color: var(--grey-600);
    text-align: center;
    z-index: 100;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
}

.pending-requests-watermark span {
    font-weight: 400;
    color: var(--grey-600);
}

/* Camera styles for universal compatibility */
#video {
    width: 320px;
    height: 588px;
    flex-shrink: 0;
    aspect-ratio: 80/147;
    border-radius: 30px;
    border: 4px solid #FFF;
    background: lightgray -115.198px -68.601px / 173.499% 119.83% no-repeat;
    margin: 0;
    /* Mirror effect for front camera */
    -webkit-transform: scaleX(-1);
    transform: scaleX(-1);
    object-fit: cover;
    position: absolute;
    top: 108px;
    left: 35px;
}

/* Mobile camera fixes */
@media screen and (max-width: 768px) {
    #video {
        width: 320px;
        height: 588px;
        flex-shrink: 0;
        aspect-ratio: 80/147;
        border-radius: 30px;
        border: 4px solid #FFF;
        background: lightgray -115.198px -68.601px / 173.499% 119.83% no-repeat;
        object-fit: cover;
        position: absolute;
        top: 108px;
        left: 35px;
    }
    
    .thoughts-header {
        padding: 0px 16px;
    }
    
    .thoughts-header h2 {
        font-size: 18px;
    }
    
    .thoughts-header .add-button {
        font-size: 18px;
        min-width: 70px;
        min-height: 40px;
    }
    
    .thoughts-content {
        padding: 16px;
    }
    
    .text-wrapper-2 {
        font-size: 14px;
    }
    
    .ai-title {
        font-weight: bold;
    }
    
    .p {
        font-size: 12px;
    }

    .thought-detail-view,
    .create-thought-form {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 12px 20px 20px 20px;
    }

    .thought-detail-header,
    .create-thought-header {
        padding: 0px 16px;
    }
}

@media screen and (max-width: 480px) {
    .thoughts-header {
        padding: 0px 12px;
    }
    
    .thoughts-header h2 {
        font-size: 16px;
    }
    
    .thoughts-header .add-button {
        font-size: 16px;
        min-width: 60px;
        min-height: 36px;
    }
    
    .thoughts-content {
        padding: 12px;
    }

    .thought-detail-view,
    .create-thought-form {
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 10px 16px 16px 16px;
    }

    .thought-detail-header,
    .create-thought-header {
        padding: 0px 12px;
    }
}

#photo {
    width: 320px;
    height: 588px;
    border-radius: 30px;
    border: 4px solid #FFFFFF;
    margin: 0;
    object-fit: cover;
    position: absolute;
    top: 108px;
    left: 35px;
}

/* Capture button positioning */
.capture-button {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #FFFFFF;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 24px;
    color: #333;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 auto;
}

#captureButton {
    bottom: 50px; /* Для CheckAgeScreen */
}

#camera-captureButton {
    bottom: 45px; /* От кнопки до низа экрана */
}

.capture-icon {
    width: 48px;
    height: 48px;
    display: block;
    transition: transform 0.2s ease;
}

#captureButton:hover .capture-icon,
#camera-captureButton:hover .capture-icon {
    transform: scale(1.1);
}

#captureButton:active .capture-icon,
#camera-captureButton:active .capture-icon {
    transform: scale(0.95);
}

.thoughts-container {
    background-color: transparent;
    overflow: hidden;
    width: 100%;
    height: var(--app-height);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Стили для .thoughts-circle-blur теперь объединены с другими градиентными кругами выше */
.thoughts-header {
    display: flex;
    width: 100%;
    height: 52px;
    align-items: center;
    justify-content: space-between;
    padding: 0px 20px;
    position: relative;
    z-index: 1000; /* Высокий z-index чтобы header не уползал под телеграмовские элементы */
    box-sizing: border-box;
    background-color: transparent;
    flex-shrink: 0;
    overflow: hidden;
}

.thoughts-header h2 {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 40px;
    line-height: 1.1;
    color: var(--grey-950);
    text-align: left;
    letter-spacing: 0;
    white-space: nowrap;
    margin: 0;
    display: flex;
    align-items: center;
    flex: 1;
}

/* Стили для экранов создания и редактирования мыслей */
#create_thought_container .thoughts-header h2,
#thought_detail_container .thoughts-header h2 {
    font-weight: 500;
    font-size: 20px;
    text-align: center;
    height: 14px;
    width: 84px;
    display: flex;
    align-items: center;
}

.thoughts-header .add-button {
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    color: var(--grey-950);
    font-size: 40px;
    text-align: center;
    letter-spacing: 0;
    line-height: 1.1;
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin: 0;
    min-width: 60px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Стили для кнопок в экранах создания и редактирования мыслей */
#create_thought_container .thoughts-header .add-button,
#thought_detail_container .thoughts-header .add-button {
    font-size: 20px;
    padding: 8px 12px;
    min-width: 80px;
    z-index: 1000; /* Высокий z-index чтобы кнопки не уползали под телеграмовские элементы */
}

/* Стили для стрелки назад в экранах мыслей */
#create_thought_container .thoughts-header .back-arrow,
#thought_detail_container .thoughts-header .back-arrow {
    margin-right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
}

.thoughts-content {
    position: relative;
    width: 100%;
    flex: 1;
    background-color: transparent;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    padding-bottom: 190px; /* Увеличенный отступ для bottom_container */
    box-sizing: border-box;
    z-index: 3;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

/* Скрытие скроллбара для мыслей теперь тоже условно через .no-scrollbars-mobile */

.thoughts-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    box-sizing: border-box;
}

.thought-newest {
    width: 100%;
    padding: 8px;
    background-color: #838daa;
    overflow: hidden;
    box-shadow: 0px 4px 24px 6px #acb3c6e6;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    border-radius: 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.thought-newest:hover {
    transform: translateY(-2px);
    box-shadow: 0px 6px 28px 8px #acb3c6e6;
}

.thought-newest .frame {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    align-self: stretch;
    width: 100%;
    flex: 0 0 auto;
}

.avatar-frame-2 {
    border-radius: 23px;
    display: flex;
    width: 80px;
    height: 80px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    border: none;
}

.avatar-frame-2::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 4px;
    border-radius: 23px;
    background: linear-gradient(
        45deg,
        rgba(239, 167, 225, 1) 0%,
        rgba(169, 240, 232, 1) 33%,
        rgba(156, 190, 253, 1) 67%,
        rgba(209, 243, 158, 1) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: 1;
    pointer-events: none;
}

.avatar-colors-3 {
    background: linear-gradient(180deg, rgba(198, 203, 216, 1) 0%, rgba(131, 141, 170, 1) 100%);
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    aspect-ratio: 1/1;
}

.text-wrapper-6 {
    font-family: "Manrope", Helvetica;
    font-weight: 800;
    color: #ffffff;
    font-size: 15px;
    text-align: center;
    letter-spacing: 0;
    line-height: 16px;
}

.text-wrapper-7 {
    font-family: "Manrope", Helvetica;
    font-weight: 700;
    color: #edf1ff;
    font-size: 14px;
    letter-spacing: -0.5px;
    line-height: 18px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
    padding: 17px 21px 17px 0;
    width: 246px;
    min-height: 36px;
}

.thoughts-month {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 10px;
    position: relative;
    flex: 0 0 auto;
    margin-bottom: 12px;
}

.text-wrapper-3 {
    font-family: "Manrope", Helvetica;
    font-weight: 700;
    color: #ffffff;
    font-size: 20px;
    line-height: 16px;
    letter-spacing: 0;
    white-space: nowrap;
    margin: 0;
}

.thought-item {
    padding: 5px;
    position: relative;
    align-self: stretch;
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    border-radius: 20px;
    cursor: pointer;
    transition: transform 0.2s ease;
    overflow: hidden;
    box-sizing: border-box;
}

.thought-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.thought-item.highlighted {
    border: 2px solid #838daa;
}

.thought-item .frame {
    display: flex;
    align-items: center;
    gap: 1px;
    position: relative;
    align-self: stretch;
    width: 100%;
    flex: 0 0 auto;
}

.avatar-frame {
    display: flex;
    width: 80px;
    height: 80px;
    padding: 4px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    position: relative;
    flex-shrink: 0;
    border-radius: 19px;
    border: none;
}

.avatar-colors {
    position: relative;
    width: 64px;
    height: 64px;
    background-color: #d9dce5;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    aspect-ratio: 1/1;
}

.div-wrapper {
    display: flex;
    width: 64px;
    height: 64px;
    padding-left: 1px;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    aspect-ratio: 1/1;
    position: relative;
}

.text-wrapper {
    font-family: "Manrope", Helvetica;
    font-weight: 600;
    color: #ffffff;
    font-size: 18px;
    text-align: center;
    letter-spacing: 0;
    line-height: 1;
    margin: 0;
    padding: 0;
}

.frame-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: -6px;
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    width: 246px;
}

.div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    position: relative;
    flex: 1;
    min-width: 0;
    width: 100%;
    overflow: hidden;
}

.text-wrapper-2 {
    display: -webkit-box;
    width: 246px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    overflow: hidden;
    color: var(--Grey-grey-600, #77809B);
    font-feature-settings: 'liga' off, 'clig' off;
    text-overflow: ellipsis;
    font-family: Manrope;
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: 18px;
    letter-spacing: -0.5px;
    margin: 0;
}

.p {
    width: 246px;
    height: 34px;
    overflow: hidden;
    color: var(--Grey-grey-600, #77809B);
    font-feature-settings: 'liga' off, 'clig' off;
    text-overflow: ellipsis;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    font-family: Manrope;
    font-size: 13px;
    font-style: normal;
    font-weight: 500;
    line-height: 16px;
    letter-spacing: -0.5px;
    margin: 0;
    word-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

.create-thought-container,
.thought-detail-container {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    min-height: var(--app-height);
    height: auto;
    width: 100%;
    background: transparent;
    overflow-y: auto;
    padding: 0;
    align-items: center;
    justify-content: flex-start;
}

.thought-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 52px;
    padding: 0px 20px;
    background: transparent;
    position: relative;
    z-index: 3;
    box-sizing: border-box;
    font-family: "Manrope", Helvetica;
    font-weight: 500;
    line-height: 1;
    overflow: hidden;
    gap: 0;
}

.thought-detail-header .left-section {
    display: flex;
    align-items: center;
    flex: 1;
}

.back-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: background-color 0.2s;
    color: var(--grey-950);
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.back-button:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.back-button img {
    width: 24px;
    height: 24px;
}

.thought-detail-header h2 {
    font-family: "Manrope", Helvetica;
    font-weight: 500;
    color: var(--grey-950);
    font-size: 20px;
    margin: 0;
    text-align: left;
    margin-left: 8px;
    flex: 1;
    display: flex;
    align-items: center;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    padding: 0;
}

.thought-detail-header .back-arrow {
    padding: 8px;
    color: var(--grey-950);
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.edit-button, .delete-button {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: "Manrope", Helvetica;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.edit-button {
    background: none;
    color: var(--grey-950);
    font-weight: 500;
    font-size: 20px;
    padding: 8px 12px;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
}

.edit-button:hover {
    background-color: #6b7a9a;
}

.delete-button {
    background-color: #ff6b6b;
    color: white;
}

.delete-button:hover {
    background-color: #ff5252;
}

.thought-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 3;
}

.thought-date {
    text-align: center;
    color: #9ca3af;
    font-size: 16px;
    margin-bottom: 24px;
    font-family: "Manrope", Helvetica;
    font-weight: 400;
}

.thought-text-container {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    margin: 0 4px;
}

.thought-title {
    font-family: "Manrope", Helvetica;
    font-weight: 700;
    color: #282a33;
    font-size: 20px;
    line-height: 1.4;
    margin-bottom: 16px;
}

.create-thought-form {
    width: 100%;
    max-width: 600px;
    min-height: 400px;
    height: calc(var(--app-height) - 200px);
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    padding: 14px 24px 24px 24px;
    border: none;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.thought-title-input {
    width: 100%;
    background: none;
    border: none;
    outline: none;
    font-family: "Manrope", Helvetica;
    font-weight: 800;
    font-size: 24px;
    line-height: 32px;
    letter-spacing: -0.5px;
    color: #484E5E;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

.thought-title-input::placeholder {
    color: var(--grey-300);
}

.current-date {
    font-family: "Manrope", Helvetica;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    color: var(--grey-400);
    text-align: center;
    margin: 0;
    padding: 0;
}

.thought-body-input {
    width: 100%;
    background: none;
    border: none;
    outline: none;
    resize: none;
    font-family: "Manrope", Helvetica;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: #374151;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    flex: 1;
    min-height: 300px;
}

.thought-body-input::placeholder {
    color: var(--grey-400);
}

.create-thought-form:empty:before {
    content: attr(placeholder);
    color: #9ca3af;
    font-style: italic;
}

.thought-detail-view {
    width: 100%;
    max-width: none;
    min-height: 400px;
    height: calc(var(--app-height) - 200px);
    margin-top: 0px;
    background: white;
    border-radius: 20px;
    padding: 14px 24px 24px 24px;
    border: none;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.thought-title-display {
    font-family: "Manrope", Helvetica;
    font-weight: 800;
    font-size: 24px;
    line-height: 32px;
    letter-spacing: -0.5px;
    color: #484E5E;
    margin: 0;
    padding: 0;
}

.thought-body-display {
    font-family: "Manrope", Helvetica;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.7;
    color: #374151;
    margin: 0;
    padding: 0;
    flex: 1;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.thought-detail-view[contenteditable="true"] {
    cursor: text;
}

.thought-detail-view[contenteditable="true"]:empty:before {
    content: attr(placeholder);
    color: #9ca3af;
    font-style: italic;
}

.create-thought-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 52px;
    padding: 0px 20px;
    background: transparent;
    position: relative;
    z-index: 3;
    box-sizing: border-box;
    font-family: "Manrope", Helvetica;
    font-weight: 500;
    line-height: 1;
    overflow: hidden;
}

.create-thought-header h2 {
    font-family: "Manrope", Helvetica;
    font-weight: 500;
    color: var(--grey-950);
    font-size: 20px;
    margin: 0;
    text-align: left;
    margin-left: 8px;
    flex: 1;
    display: flex;
    align-items: center;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
}

.create-thought-header .add-button {
    font-family: "Manrope", Helvetica;
    background: none;
    color: var(--grey-950);
    font-weight: 500;
    font-size: 20px;
    padding: 8px 12px;
    border: none;
    cursor: pointer;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
}

.create-thought-header .back-arrow {
    padding: 8px;
    color: var(--grey-950);
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.create-thought-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
    position: relative;
    z-index: 3;
    padding: 20px;
    overflow-y: auto;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-family: "Manrope", Helvetica;
    font-weight: 600;
    color: #282a33;
    font-size: 16px;
    margin-bottom: 8px;
}

.date-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-family: "Manrope", Helvetica;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.date-input:focus {
    border-color: #838daa;
}

/* Сообщения об ошибках и успехе */
.error-message, .success-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-family: "Manrope", Helvetica;
    font-weight: 600;
    font-size: 14px;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.success-message {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

/* Пустое состояние */
.empty-thoughts {
    text-align: center;
    padding: 40px 20px;
    color: #77809b;
    font-family: "Manrope", Helvetica;
    font-size: 16px;
}

/* New Design End */

/* Новый дизайн страницы регистрации */
.onboarding-form {
    display: flex;
    width: 100%;
    max-width: 320px;
    flex-direction: column;
    align-items: flex-start;
    gap: 63px;
    height: auto;
    margin: 0 auto;
}

.onboarding-heading {
    color: var(--grey-950);
    text-align: center;
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: Manrope;
    font-size: 32px;
    font-style: normal;
    font-weight: 700;
    line-height: 40px; /* 125% */
    margin: 0;
    width: 100%;
}

.form-data {
    display: flex;
    width: 100%;
    max-width: 310px;
    flex-direction: column;
    align-items: flex-start;
    gap: 13px;
    height: auto;
    margin: 0 auto;
}

.onboarding-input,
.settings-input {
    display: flex;
    height: 70px;
    padding: 24px;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 310px;
    border-radius: 8px;
    border: 1px solid var(--grey-200);
    background: rgba(255, 255, 255, 0.20);
    font-family: Manrope !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    line-height: 22px !important;
    color: var(--grey-950);
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    text-align: left;
}

.onboarding-input:not(:placeholder-shown),
.settings-input:not(:placeholder-shown) {
    background: rgba(255, 255, 255, 0.95);
    color: var(--Color-Grey-Grey-950, #282A33);
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: Manrope;
    font-size: 24px;
    font-style: normal;
    font-weight: 700;
    line-height: 22px; /* 91.667% */
}

.input-container {
    position: relative;
    width: 100%;
    max-width: 310px;
}

.date-arrow-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 8px;
    background: #C6CBD8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: not-allowed;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease, cursor 0.3s ease;
    pointer-events: none;
}

.floating-label {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-400);
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: Manrope;
    font-size: 24px;
    font-style: normal;
    font-weight: 400;
    line-height: 22px;
    pointer-events: none;
    transition: all 0.3s ease;
    background: transparent;
}

.settings-input:not(:placeholder-shown) + .floating-label {
    top: 12px;
    font-size: 14px;
    line-height: 22px;
    color: var(--grey-400);
}

.onboarding-input::placeholder,
.settings-input::placeholder {
    color: transparent;
}

.onboarding-input:focus,
.settings-input:focus {
    border-radius: 8px;
    border: 2px solid var(--grey-950);
    background: var(--grey-50);
}

.onboarding-input[name="birthday"] {
    padding-right: 72px; /* space for icon */
}

.onboarding-input[name="birthday"]:not(:placeholder-shown),
.onboarding-input[name="birthday"][data-has-value="true"],
.settings-input[name="birthday"]:not(:placeholder-shown),
.settings-input[name="birthday"][data-has-value="true"] {
    background: rgba(255, 255, 255, 0.95);
}

.onboarding-input[name="birthday"].error {
    border: 2px solid #DB7082;
}

.onboarding-input[name="birthday"]:focus ~ .date-arrow-icon,
.settings-input[name="birthday"]:focus ~ .date-arrow-icon {
    opacity: 1;
    visibility: visible;
}

.onboarding-input[name="birthday"]:focus ~ .date-arrow-icon.active,
.settings-input[name="birthday"]:focus ~ .date-arrow-icon.active {
    background: var(--Color-Grey-Grey-950, #282A33);
    cursor: pointer;
    pointer-events: auto;
}

.onboarding-input[name="birthday"]:disabled {
    background: rgba(255, 255, 255, 0.95) !important;
}

.onboarding-input[name="birthday"]:disabled ~ .date-arrow-icon.confirmed,
.settings-input[name="birthday"]:disabled ~ .date-arrow-icon.confirmed {
    opacity: 1 !important;
    visibility: visible !important;
}

.date-arrow-icon.active {
    background: var(--Color-Grey-Grey-950, #282A33);
    cursor: pointer;
    pointer-events: auto;
}

.date-arrow-icon.error {
    background: transparent;
    cursor: not-allowed;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
}

.date-arrow-icon.error svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.date-arrow-icon .arrow-icon {
    display: block;
}

.date-arrow-icon .error-icon {
    display: none;
}

.date-arrow-icon.error .arrow-icon {
    display: none;
}

.date-arrow-icon.error .error-icon {
    display: block;
}

.date-arrow-icon.confirmed {
    background: transparent !important;
    cursor: default !important;
    pointer-events: none !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.date-arrow-icon.confirmed .confirmed-icon {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.custom-select[data-has-value="true"] {
    background: rgba(255, 255, 255, 0.8);
}

select.settings-input {
    display: block;
    padding: 12px 24px;
    height: 56px;
    font-size: 20px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--grey-950);
    background: rgba(255,255,255,0.95);
    border-radius: 8px;
    border: 1px solid var(--grey-200);
    box-sizing: border-box;
    outline: none;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 310px;
}

/* Age Proof Alert Modal */
.age-proof-alert {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 100vh;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Telegram Web App specific */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.age-proof-alert.show {
    opacity: 1;
    visibility: visible;
}

.age-proof-content {
    width: 100%;
    height: 50svh;
    flex-shrink: 0;
    border-radius: 24px 24px 0 0;
    background: var(--Color-Base-White, #FFF);
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 30px calc(env(safe-area-inset-bottom, 16px) + 8px);
    box-sizing: border-box;
    max-width: 390px;
    margin: 0 auto;
    will-change: transform;
}

.age-proof-alert.show .age-proof-content {
    transform: translateY(0);
}

.age-proof-title {
    width: 100%;
    color: var(--Color-Grey-Grey-950, #282A33);
    text-align: center;
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: Manrope;
    font-size: 32px;
    font-style: normal;
    font-weight: 700;
    line-height: 34px; /* макет */
    margin: 0;
}

.age-proof-text-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 48px;
}

.age-proof-description {
    width: 323px;
    color: var(--Color-Grey-Grey-950, #282A33);
    text-align: center;
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: Manrope;
    font-size: 16px;
    font-style: normal;
    font-weight: 500;
    line-height: 20px;
    margin: 0;
}

.age-proof-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 52px;
    margin-bottom: 40px;
}

.age-proof-confirm-btn {
    display: flex;
    width: 100%;
    max-width: 330px;
    height: 66px;
    padding: 16px 10px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-radius: 16px;
    background: var(--Color-Grey-Grey-950, #282A33);
    border: none;
    color: #F7F9FF;
    font-family: Manrope;
    font-size: 24px;
    line-height: 34px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.age-proof-confirm-btn:hover {
    background: var(--Color-Grey-Grey-800, #373B47);
}

.age-proof-cancel-btn {
    display: flex;
    width: 100%;
    max-width: 330px;
    height: 66px;
    padding: 16px 10px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-radius: 16px;
    border: 2px solid #000;
    background: var(--Color-Base-White, #FFF);
    color: var(--Color-Grey-Grey-950, #282A33);
    font-family: Manrope;
    font-size: 24px;
    line-height: 34px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
}

.age-proof-cancel-btn:hover {
    background: var(--Color-Grey-Grey-50, #F8F9FA);
}

/* Focus states */
.age-proof-confirm-btn:focus-visible,
.age-proof-cancel-btn:focus-visible {
    outline: 2px solid #12B2BE;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .age-proof-alert, .age-proof-content, .age-proof-confirm-btn, .age-proof-cancel-btn { transition: none !important; }
    .age-proof-content { transform: none !important; }
}

@media (max-height: 620px) {
    .age-proof-content { height: 58svh; }
    .age-proof-text-content { margin-top: 36px; }
    .age-proof-buttons { margin-top: 40px; }
}

@media (max-height: 540px) {
    .age-proof-content { height: 65svh; }
    .age-proof-title { font-size: 28px; line-height: 32px; }
    .age-proof-confirm-btn, .age-proof-cancel-btn { height: 60px; font-size: 20px; line-height: 30px; }
}

.agreement {
    display: flex;
    width: 100%;
    max-width: 310px;
    height: auto;
    min-height: 40px;
    padding-top: 12px;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

.interface-checkbox {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.interface-checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 40px;
    height: 40px;
    cursor: pointer;
}

.interface-checkbox label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.interface-checkbox input[type="checkbox"]:checked + label::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 21.212px;
    height: 14.142px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='26' height='20' viewBox='0 0 26 20' fill='none'%3e%3cpath d='M2 10.0001L9.07107 17.0711L23.2117 2.92896' stroke='%23282A33' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    z-index: 2;
}

.agreement-text {
    width: 100%;
    max-width: 310px;
    color: var(--grey-400);
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: Manrope;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 20px; 
    margin: 0;
    margin-top: -8px;
    flex: 1;
    transition: color 0.3s ease;
    text-align: left;
    align-self: flex-start;
    text-indent: 0;
    padding-left: 0;
}

.agreement-text p {
    text-indent: 0;
    margin: 0 0 8px 0;
    padding-left: 0;
}

.agreement-text p:first-child {
    text-indent: 0;
    padding-left: 0;
}

.agreement-text p:not(:first-child) {
    text-indent: 1.5em;
    padding-left: 0;
}

/* Стили для текста согласия когда чекбокс отмечен */
.interface-checkbox input[type="checkbox"]:checked ~ .agreement-text {
    color: var(--grey-400);
}

/* Стили для ссылок в тексте согласия */
.agreement-link {
    color: var(--grey-900);
    text-decoration: underline;
    transition: opacity 0.3s ease;
    text-align: left;
    display: inline;
}

.agreement-link:hover {
    opacity: 0.7;
}

.onboarding-button {
    display: flex;
    width: 100%;
    max-width: 300px;
    height: 70px;
    padding: 24px 10px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-radius: 16px;
    background: var(--Color-Grey-Grey-200, #C6CBD8);
    border: none;
    font-family: Manrope;
    font-size: 24px;
    font-style: normal;
    font-weight: 700;
    line-height: 34px;
    color: var(--Blue-blue-25, #F7F9FF);
    text-align: center;
    font-feature-settings: 'liga' off, 'clig' off;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-bottom: 63px;
}

.onboarding-button:enabled {
    background: var(--Color-Grey-Grey-950, #282A33);
    color: white;
    cursor: pointer;
}

.onboarding-button:enabled:hover {
    background: var(--Color-Grey-Grey-950, #282A33);
    transform: translateY(-1px);
}

.onboarding-button:disabled {
    background: var(--grey-200);
    color: white;
    cursor: not-allowed;
}

/* Специальные стили для кнопки "Сохранить изменения" в настройках профиля */
#settingsSaveButton {
    display: flex;
    width: 100%;
    padding: 16px;
    justify-content: center;
    align-items: center;
    border-radius: 12px;
    background: var(--Color-Grey-Grey-900, #373B47);
    border: none;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    color: var(--Color-Base-White, #FFF);
    text-align: center;
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: Manrope;
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 28px;
    letter-spacing: -0.5px;
}

#settingsSaveButton:hover {
    background: var(--Color-Grey-Grey-800, #4A4F5F);
    transform: translateY(-1px);
}

#settingsSaveButton:disabled {
    background: var(--Color-Grey-Grey-700, #5A5F6F);
    color: var(--Color-Grey-Grey-400, #9CA3AF);
    cursor: not-allowed;
    transform: none;
}

/* Стили для кнопки "Удалить аккаунт" */
#settingsDeleteAccountButton {
    display: flex;
    width: 100%;
    height: 44px;
    padding: 16px;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    border-radius: 12px;
    border: 1px solid #EFB0AC;
    background: transparent;
    color: #EFB0AC;
    font-family: Manrope;
    font-size: 16px;
    font-style: normal;
    font-weight: 500;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-top: auto;
    margin-bottom: 16px;
    position: relative;
    z-index: 5;
}

#settingsDeleteAccountButton:hover {
    background: rgba(239, 176, 172, 0.1);
    transform: translateY(-1px);
}

#settingsDeleteAccountButton:active {
    background: rgba(239, 176, 172, 0.2);
    transform: translateY(0);
}



.circle-blur {
    display: none; /* Убираем размытый круг для белого фона */
}

.register-circle-blur {
    position: absolute;
    z-index: 2;
    width: 500px;
    height: 500px;
    left: calc(50% - 500px/2);
    top: 41px;
    
    /* Gradient-main-hor */
    background: linear-gradient(90deg, #EFA7E1 0%, #A9F0E8 25%, #9CBEFD 50%, #F6EAC0 75%, #D1F39E 100%);
    filter: blur(50px);
    /* Animation properties */
    animation: floatAnimation 15s ease-in-out infinite;
}

#register_container {
    position: relative;
    width: 100%;
    min-height: var(--app-height);
    height: var(--app-height);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; 
    overscroll-behavior: contain;
    z-index: 1;
}

.register-main {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    min-height: var(--app-height);
    height: auto;
    width: 100%;
    background: var(--grey-50);
    overflow-x: hidden; 
}

.register-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    /* Let this be the scroll container for the register screen */
    flex: 1 1 auto;
    min-height: 0;
    max-width: 100%;
    overflow-y: auto; /* вертикальный скролл без видимого бара */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    align-items: center;
    justify-content: flex-start;
    padding: 20px;
}
/* Кастомный select */
.custom-select {
    position: relative;
    cursor: pointer;
    display: flex;
    height: 70px;
    padding: 24px;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 310px;
    border-radius: 8px;
    border: 1px solid var(--grey-200);
    background: rgba(255, 255, 255, 0.20);
    font-family: Manrope;
    font-size: 24px;
    font-weight: 700;
    line-height: 22px;
    color: var(--grey-950);
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
    text-align: left;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239CA4BB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 24px center;
    background-size: 16px;
    padding-right: 50px;
}

/* Стили для фокуса на custom-select */
.custom-select:focus {
    border-radius: 8px;
    border: 2px solid var(--grey-950);
    background: var(--grey-50);
}

/* Стили для заполненного custom-select */
.custom-select[data-has-value="true"] {
    background: rgba(255, 255, 255, 0.8) !important;
    color: var(--Color-Grey-Grey-950, #282A33);
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: Manrope;
    font-size: 24px;
    font-style: normal;
    font-weight: 700;
    line-height: 22px;
}

.select-placeholder {
    color: transparent;
    font-weight: 700;
    font-size: 24px;
    font-family: Manrope;
    line-height: 22px;
}

.select-value {
    color: var(--Color-Grey-Grey-950, #282A33);
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: Manrope;
    font-size: 24px;
    font-style: normal;
    font-weight: 700;
    line-height: 22px;
    display: none; /* По умолчанию скрыт */
}

.select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--grey-200);
    border-radius: 8px;
    margin-top: 4px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.select-option {
    padding: 12px 24px;
    font-family: Manrope;
    font-size: 24px;
    font-weight: 400;
    color: var(--grey-950);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.select-option:hover {
    background-color: var(--grey-50);
}

.select-option:first-child {
    border-radius: 8px 8px 0 0;
}

.select-option:last-child {
    border-radius: 0 0 8px 8px;
}

/* Скрытие placeholder при выборе значения */
.custom-select[data-has-value="true"] .select-placeholder {
    display: none;
}

.custom-select[data-has-value="true"] .select-value {
    display: block;
    visibility: visible;
    opacity: 1;
}

/* Специальные стили для кастомного select */
.custom-select[data-has-value="true"] + .floating-label {
    top: 12px;
    font-size: 14px;
    line-height: 22px;
    color: var(--grey-400);
}

/* Стили для floating label когда select в фокусе */
.custom-select:focus + .floating-label {
    top: 12px;
    font-size: 14px;
    line-height: 22px;
    color: var(--grey-400);
}

/* Camera Modal */
.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background: rgba(90, 97, 129, 0.68);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Telegram Web App specific */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.camera-modal.show {
    opacity: 1;
    visibility: visible;
}

.camera-modal-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: var(--telegram-header-height);
}

#camera-video {
    width: 320px;
    height: 588px;
    flex-shrink: 0;
    aspect-ratio: 80/147;
    border-radius: 30px;
    border: 4px solid #FFF;
    background: lightgray -115.198px -68.601px / 173.499% 119.83% no-repeat;
    object-fit: cover;
    -webkit-transform: scaleX(-1);
    transform: scaleX(-1);
    margin-bottom: 23px; /* Расстояние между фото и кнопкой */
}

#camera-photo {
    width: 320px;
    height: 588px;
    flex-shrink: 0;
    aspect-ratio: 80/147;
    border-radius: 30px;
    border: 4px solid #FFF;
    object-fit: cover;
    margin-bottom: 23px; /* Расстояние между фото и кнопкой */
}

#backToAgeProofButton {
    position: absolute;
    top: 120px;
    left: 20px;
    z-index: 9999;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    width: 86px;
    color: var(--Color-Base-White, #FFF);
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: Manrope;
    font-size: 20px;
    font-style: normal;
    font-weight: 500;
    line-height: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* Telegram Web App specific */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.loading-spinner-container {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    aspect-ratio: 1/1;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Under-age full screen modal (backend under age) */
.under-age-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    background: rgba(90, 97, 129, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000; /* above camera modal */
    padding: 32px 16px 64px;
    box-sizing: border-box;
    opacity: 1; /* could animate from 0 */
    transition: opacity .25s ease;
}

.under-age-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 323px;
    width: 100%;
    text-align: center;
}

.under-age-title {
    margin: 0 0 53px;
    color: #FFF;
    font-family: Manrope, sans-serif;
    font-size: 32px;
    font-style: normal;
    font-weight: 700;
    line-height: 32px; /* matching Figma */
}

.under-age-description {
    margin: 0 0 32px;
    color: #FFF;
    font-family: Manrope, sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 20px;
}

.under-age-telegram {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 64px;
}

.telegram-icon {
    width: 32px;
    height: 32px;
    background: url('/static/Icons/telegram.svg') center/contain no-repeat;
}

.telegram-handle {
    font-family: Manrope, sans-serif;
    font-size: 24px;
    font-weight: 800; /* ExtraBold per design */
    line-height: 24px;
    color: #FFF;
}

.under-age-exit-btn {
    display: flex;
    width: 162px;
    padding: 16px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-radius: 16px;
    background: #282A33; /* Grey-950 */
    color: #FFF;
    font-family: Manrope, sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 34px;
    border: none;
    cursor: pointer;
    transition: background-color .2s ease;
}

.under-age-exit-btn:focus-visible {
    outline: 2px solid #F7F9FF;
    outline-offset: 2px;
}

.under-age-exit-btn:hover {
    background: #373b47; /* Grey-900 */
}

.under-age-exit-btn:active {
    background: #1d1f24;
}

@media (max-height: 640px) {
    .under-age-content { transform: scale(.9); }
}

.age-not-confirmed-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    background: rgba(90, 97, 129, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Telegram Web App specific */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.age-not-confirmed-modal.show {
    opacity: 1;
    visibility: visible;
}

.not-confirmed-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px;
    max-width: 323px;
    position: relative;
}


.not-confirmed-title {
    width: 271px;
    color: var(--Color-Base-White, #FFF);
    text-align: center;
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: Manrope;
    font-size: 32px;
    font-style: normal;
    font-weight: 700;
    line-height: 32px;
    margin: 0;
    margin-bottom: 53px;
}

.not-confirmed-description {
    width: 323px;
    color: var(--Color-Base-White, #FFF);
    text-align: center;
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: Manrope;
    font-size: 16px;
    font-style: normal;
    font-weight: 500;
    line-height: 20px;
    margin: 0;
    margin-bottom: 64px;
}

.not-confirmed-buttons {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.not-confirmed-cancel-btn {
    display: flex;
    width: 162px;
    padding: 16px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-radius: 16px;
    border: 2px solid var(--Color-Grey-Grey-950, #282A33);
    background: var(--Color-Base-White, #FFF);
    color: var(--Color-Grey-Grey-950, #282A33);
    font-family: Manrope;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1000;
}

.not-confirmed-cancel-btn:hover {
    background: var(--grey-50);
}

.not-confirmed-retake-btn {
    display: flex;
    width: 162px;
    padding: 16px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    border-radius: 16px;
    background: var(--Color-Grey-Grey-950, #282A33);
    color: var(--Color-Base-White, #FFF);
    font-family: Manrope;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.not-confirmed-retake-btn:hover {
    background: #1f1f1f;
}

@keyframes fadeInBirthday {
    from { opacity:0; transform: translateY(-2px);} 
    to { opacity:1; transform: translateY(0);} 
}

.birthday-error-border-overlay {
    pointer-events: none;
    position: absolute;
    inset: -2px;
    border: 2px solid #db7082;
    border-radius: 10px;
    box-sizing: border-box;
}

.birthday-error-message {
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    width: 100%;
    text-align: left;
    color: #db7082;
    font-size: 16px;
    line-height: 20px;
    font-weight: 500;
    padding: 0 8px;
    animation: fadeInBirthday .18s ease;
    pointer-events: none;
    box-sizing: border-box;
}

/* Friend Profile Styles */
.friend-profile-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, var(--grey-50) 0%, var(--grey-100) 100%);
    z-index: 1;
}

.friend-profile-circle-blur {
    position: absolute;
    z-index: 2;
    width: 500px;
    height: 500px;
    left: calc(50% - 500px/2);
    top: 41px;
    background: linear-gradient(90deg, #EFA7E1 0%, #A9F0E8 25%, #9CBEFD 50%, #F6EAC0 75%, #D1F39E 100%);
    filter: blur(50px);
    animation: floatAnimation 10s ease-in-out infinite;
}

.friend-profile-content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0 24px;
    gap: 102px;
}

.friend-profile-header-block {
    display: flex;
    height: 40px;
    padding: var(--telegram-header-height) 16px 0 16px;
    align-items: center;
    gap: 16px;
    align-self: stretch;
}

.friend-profile-info-block {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 142px);
    width: 100vw;
    margin-left: -24px;
    margin-right: -24px;
    margin-bottom: -60px;
    border-radius: 24px 24px 0 0;
    background: var(--white);
}

.friend-profile-info-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 390px;
    margin: 0 auto;
    position: relative;
}

.friend-profile-avatar {
    display: flex;
    width: 120px;
    height: 120px;
    padding: 8px;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    aspect-ratio: 1/1;
    border-radius: 28px;
    background: var(--white);
    margin-bottom: 16px;
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.friend-profile-avatar::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 4px;
    border-radius: 28px;
    background: linear-gradient(
        45deg,
        rgba(239, 167, 225, 1) 0%,
        rgba(169, 240, 232, 1) 33%,
        rgba(156, 190, 253, 1) 67%,
        rgba(209, 243, 158, 1) 100%
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
    pointer-events: none;
}

.friend-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.friend-profile-name {
    color: var(--grey-900);
    text-align: center;
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: Manrope;
    font-size: 24px;
    font-style: normal;
    font-weight: 700;
    line-height: 30px;
    letter-spacing: -0.5px;
    margin-top: 106px;
    margin-bottom: 8px;
}

.friend-profile-age-location {
    color: var(--grey-900);
    text-align: center;
    font-feature-settings: 'liga' off, 'clig' off;
    font-family: Manrope;
    font-size: 16px;
    font-style: normal;
    font-weight: 500;
    line-height: 30px;
    letter-spacing: -0.5px;
    margin-bottom: 24px;
}



.friend-profile-interests {
    display: flex;
    width: 340px;
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    border-radius: 12px;
    background: var(--grey-50);
}

.friend-interests-label {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 20px;
    color: var(--grey-700);
    margin-bottom: 8px;
}

.friend-interests-text {
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 24px;
    color: var(--grey-950);
}
