/* =========================================
   ГЛОБАЛЬНОЕ СКРЫТИЕ СКРОЛЛБАРА
   ========================================= */

/* Скрываем для Firefox */
* {
    scrollbar-width: none !important;
}

/* Скрываем для IE и старого Edge */
* {
    -ms-overflow-style: none !important;
}

/* Скрываем для Chrome, Safari и Opera */
*::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* --- 1. ГЛОБАЛЬНЫЕ ПРАВИЛА --- */
html, body {
    position: fixed; /* Жестко фиксируем окно */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0; /* Растягиваем до самого физического низа экрана */
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Отключаем любой скролл */
    overscroll-behavior: none; /* Отключаем "резинку" */
    touch-action: none; /* Блокируем зум двумя пальцами по всей странице */
    -webkit-text-size-adjust: 100%;
}

#map {
    position: absolute; /* Карта внутри body */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0; /* Карта уходит в самый низ экрана, ПОД панель Safari */
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #f5f5f7;
}

/* Разрешаем вертикальный скролл там, где он действительно нужен (шторки, списки) */
.sidebar-content, 
.details-card, 
.profile-list,
.scrollable-list {
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
}

body { margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; overflow: hidden; background: #ffffff; }

/* Хедер */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Боковые блоки по краям */
    position: relative; /* Контекст для абсолютного позиционирования */
    /* padding: 0 20px; */
    height: 64px;
    align-items: center;
    justify-content: space-between;
    position: fixed; top: 0; left: 0; width: 100%; height: 64px;
    background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 20px; box-sizing: border-box; z-index: 1000; border-bottom: 1px solid rgba(0,0,0,0.05);
}
.nav-left, .nav-right {
    flex-basis: 250px; /* Задаем им базовую ширину, чтобы было место для центра */
    display: flex;
    align-items: center;
}

.nav-left { justify-content: flex-start; }
.nav-right { justify-content: flex-end; }

.nav-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-60%, -50%); /* Главный трюк: Абсолютное позиционирование */
    
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 550px; /* ЗАДАЕМ ШИРИНУ ВСЕМУ БЛОКУ (как фильтры) */
}


.logo { font-size: 20px; font-weight: 800; color: #1d1d1f; white-space: nowrap; }
.search-container {
    position: relative; /* Важно для выпадающего списка */
    display: flex;
    align-items: center;
    background: #f0f2f5; /* Цвет как у инпутов в macOS */
    border-radius: 12px;
    border: 1px  #e0e2e7;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 450px; /* Увеличим немного */
    /* padding-left: 10px;  */
}
/* .search-container:focus-within {
    background: #ffffff;
    border-color: #007AFF;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
} */
/* Кнопка-переключатель режимов (смайлик) */
.search-toggle-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 8px;
    font-size: 20px;
    opacity: 0.7;
    transition: transform 0.2s;
}

#mobile-search-toggle {
    display: none;
}

.search-toggle-btn:hover {
    transform: scale(1.15);
    opacity: 1;
}
#search-dropdown {
    position: absolute;
    top: 112%; /* Сразу под инпутом */
    left: 0;
    width: 100%;
    background: #ffffff;
    border-radius: 12px;
    margin-top: 8px; /* Небольшой отступ от поля */
    box-shadow: 0 10px 40px rgba(0,0,0,0.15); /* Красивая тень */
    max-height: 300px; /* Если результатов много - будет скролл */
    overflow-y: auto;
    display: none; /* Скрыт по умолчанию */
    z-index: 2000;
    border: 1px solid rgba(0,0,0,0.05);
    animation: fadeIn 0.2s ease;
}

/* Элемент результата поиска */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid #f5f5f7;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f2f2f7; /* Цвет наведения как в iOS */
}

/* Иконка в поиске */
.search-item-icon {
    font-size: 20px;
    width: 32px;
    height: 32px;
    background: #f0f0f2;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Текст в поиске */
.search-item-info {
    display: flex;
    flex-direction: column;
}

.search-item-title {
    font-weight: 600;
    font-size: 14px;
    color: #1d1d1f;
}

.search-item-meta {
    font-size: 12px;
    color: #86868b;
}

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

#map-search {
    flex: 1; /* Занимает все свободное место */
    border: none;
    background: transparent;
    padding: 12px 10px 12px 0; /* Вертикальные отступы */
    font-size: 15px;
    outline: none; /* Убираем стандартную рамку фокуса */
    width: 100%;
}

#map-search:focus { background: #fff; border-color: #007AFF; box-shadow: 0 0 0 4px rgba(0,122,255,0.1); }
.menu-btn { background: none; border: none; font-size: 26px; cursor: pointer; }

/* Фильтры */
.filter-bar {
    position: fixed;
    top: 74px; /* Начальная позиция */
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    transition: top 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Плавный сдвиг */
    padding: 6px; border-radius: 16px; backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.filter-btn {
    padding: 8px 16px; border-radius: 12px; border: none; background: transparent;
    cursor: pointer; font-weight: 600; font-size: 13px; color: #555; transition: 0.2s;
}
.filter-btn.active { background: #fff; color: #007AFF; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

/* Сайдбар */
.sidebar {
    position: fixed; top: 0; right: -350px; width: 320px; height: 100vh; background: #fff;
    box-shadow: -10px 0 40px rgba(0,0,0,0.1); transition: right 0.4s ease; z-index: 2000; display: flex; flex-direction: column;
}
.sidebar.active { right: 0; }
.sidebar-header { display: flex; justify-content: space-between; padding: 20px; border-bottom: 1px solid #eee; height: 64px; box-sizing: border-box; align-items: center; }
.menu-list { list-style: none; padding: 20px; margin: 0; }
.menu-list li { margin-bottom: 15px; }
.menu-list a { text-decoration: none; color: #333; font-size: 18px; display: block; }
.layer-switcher { padding: 0 20px; }
.layer-option { display: flex; gap: 10px; padding: 10px 0; cursor: pointer; }

/* Карта и Popup */
#map { position: absolute; top: 0; bottom: 0; width: 100%; z-index: 1; }

.ol-popup {
    position: absolute; background: white; padding: 0; border-radius: 16px;
    bottom: 25px; left: -50%; transform: translateX(-50%);
    width: 260px; box-shadow: 0 15px 40px rgba(0,0,0,0.25); border: 1px solid rgba(0,0,0,0.05); overflow: hidden;
}
.popup-preview-img { width: 100%; height: 140px; object-fit: cover; display: block; }
.popup-preview-content { padding: 15px; }
.popup-preview-content h4 { margin: 0 0 10px; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-details { width: 100%; background: #007AFF; color: white; border: none; padding: 10px; border-radius: 10px; font-weight: bold; cursor: pointer; }

/* Большая детальная карточка */
.details-card {
    position: relative; background: #fff; border-radius: 24px;
    width: 100%; max-width: 450px; max-height: 90vh;
    overflow-y: auto; overflow-x: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: popIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column;
}
.details-card .close-btn {
    position: absolute; top: 15px; right: 15px; width: 36px; height: 36px;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px);
    border-radius: 50%; border: none; cursor: pointer; z-index: 20;
    color: #fff; font-size: 20px; display: flex; align-items: center; justify-content: center; transition: 0.2s;
}
.details-header-img { width: 100%; height: 250px; object-fit: cover; display: block; }
.details-body { padding: 24px; box-sizing: border-box; }
.details-body h2 { margin: 10px 0; font-size: 24px; line-height: 1.2; }
.category-badge { background: #f0f0f2; padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; display: inline-block; color: #333; }
.details-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; width: 100%; box-sizing: border-box; }
.details-photos img { width: 100%; height: 100px; object-fit: cover; border-radius: 12px; cursor: zoom-in; border: 1px solid #eee; }
.btn-route {
    display: block; width: 100%; box-sizing: border-box;
    background: #28a745; color: white; text-align: center; padding: 14px;
    border-radius: 14px; font-weight: bold; text-decoration: none;
    margin-top: 25px; font-size: 16px; transition: 0.2s;
}
.btn-route:hover { background: #218838; transform: translateY(-2px); }
.details-card .close-btn:hover { background: rgba(0, 0, 0, 0.8); transform: scale(1.1); }

/* Формы */
.form-card.wide { max-width: 800px; width: 90%; }
.form-row { display: flex; gap: 15px; width: 100%; }
.form-row > * { flex: 1; } 
#marker-title, #selected-category, textarea {
    padding: 12px 15px; border: 1px solid #d2d2d7; border-radius: 12px;
    font-size: 15px; background: #f9f9f9; box-sizing: border-box; width: 100%;
}
textarea { resize: vertical; min-height: 80px; }

.file-drop-zone {
    display: flex; align-items: center; gap: 10px; padding: 15px;
    background: #f5f5f7; border-radius: 12px; border: 2px dashed #d2d2d7;
    cursor: pointer; transition: all 0.2s;
}
.file-drop-zone:hover { border-color: #007AFF; background: #eef5ff; }
.file-drop-icon { font-size: 24px; }
.file-drop-text strong { display: block; font-size: 13px; color: #1d1d1f; }
.file-drop-text span { font-size: 11px; color: #86868b; word-break: break-all; }

/* Модалки общие */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 3000; justify-content: center; align-items: center; backdrop-filter: blur(5px);
}
.form-card { background: #fff; padding: 25px; border-radius: 24px; display: flex; flex-direction: column; gap: 0px; box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.form-buttons { display: flex; gap: 10px; margin-top: 10px; }
.btn-save { background: #007AFF; color: white; border: none; padding: 12px; border-radius: 12px; font-weight: bold; flex: 1; cursor: pointer; }
.btn-cancel { background: #e5e5ea; color: #333; border: none; padding: 12px; border-radius: 12px; font-weight: 600; flex: 1; cursor: pointer; }

/* Лайтбокс и Тосты */
#lightbox-img { max-width: 95%; max-height: 90%; border-radius: 12px; }
#toast-container { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 4000; }
.toast { background: #1d1d1f; color: #fff; padding: 12px 24px; border-radius: 30px; margin-top: 10px; animation: popIn 0.3s; }

/* Геолокация */
#locate-btn {
    position: absolute; bottom: 30px; left: 20px; z-index: 100;
    width: 44px; height: 44px; background: #fff; border: none; border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15); cursor: pointer; font-size: 20px;
}
#locate-btn.tracking { color: #007AFF; box-shadow: 0 0 0 2px #007AFF; }

/* Отзывы */
.reviews-section { margin-top: 30px; border-top: 1px solid #eee; padding-top: 20px; }
.reviews-title { font-size: 18px; font-weight: bold; margin-bottom: 15px; }
.reviews-list {
    text-align: left;
}
.review-item {
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #f0f0f2;
    margin-bottom: 8px;
    position: relative;
    /* Убираем лишние внешние отступы, чтобы не ехало вправо */
    margin-left: 0; 
    margin-right: 0;
}

.review-header {
    display: flex;
    align-items: center; /* Центрируем по вертикали */
    gap: 12px; /* Отступ между фото и текстом */
    margin-bottom: 8px;
}
.review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #eee;
    flex-shrink: 0; /* Чтобы фото не сжималось */
}

.review-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.3;
}
.review-author {
    font-weight: 600;
    font-size: 14px;
    color: #1d1d1f;
}

.review-date {
    font-size: 11px;
    color: #86868b;
}
.review-stars { color: #ffcc00; letter-spacing: 2px; }
.review-text { font-size: 14px; line-height: 1.4; color: #1d1d1f; }

.review-form { background: #f0f0f2; padding: 15px; border-radius: 16px; }
.review-form input, .review-form textarea {
    width: 100%; box-sizing: border-box; padding: 10px; margin-bottom: 10px;
    border: 1px solid #ddd; border-radius: 8px; font-family: inherit;
}
.star-rating { display: flex; gap: 5px; margin-bottom: 10px; cursor: pointer; }
.star-rating span { font-size: 24px; color: #ccc; transition: 0.2s; }

/* Авторизация и профиль */
.auth-btn { padding: 8px 16px; border-radius: 20px; border: 1px solid #007AFF; background: transparent; color: #007AFF; cursor: pointer; font-weight: 600; transition: 0.2s; }
.auth-btn:hover { background: #007AFF; color: white; }
.auth-btn.logout { border-color: #ff3b30; color: #ff3b30; font-size: 12px; padding: 6px 12px; margin-left: 10px; }
.auth-btn.logout:hover { background: #ff3b30; color: white; }
#user-profile { display: flex; align-items: center; font-weight: bold; font-size: 14px; }

.auth-card { background: #fff; padding: 40px; border-radius: 24px; width: 360px; position: relative; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.close-btn-auth { position: absolute; top: 20px; right: 20px; background: transparent; border: none; font-size: 20px; cursor: pointer; color: #999; }
.auth-header { text-align: center; margin-bottom: 30px; }
.auth-header h2 { margin: 0; font-size: 24px; color: #111; }
.auth-header p { margin: 8px 0 0; color: #666; font-size: 14px; }

.input-group { position: relative; margin-bottom: 20px; }
.input-group input { width: 100%; padding: 14px 16px; border: 1px solid #e0e0e0; border-radius: 12px; font-size: 16px; background: #fafafa; outline: none; transition: 0.2s all; box-sizing: border-box; }
.input-group input:focus { border-color: #007AFF; background: #fff; box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1); }
.input-group label { position: absolute; top: 15px; left: 16px; color: #999; font-size: 15px; pointer-events: none; transition: 0.2s all ease-out; background: transparent; }
.input-group input:focus + label, .input-group input:not(:placeholder-shown) + label { top: -9px; left: 12px; font-size: 12px; color: #007AFF; background: #fff; padding: 0 4px; font-weight: 600; }

.btn-auth-action { width: 100%; padding: 14px; background: linear-gradient(135deg, #007AFF, #0056b3); color: white; border: none; border-radius: 12px; font-size: 16px; font-weight: bold; cursor: pointer; box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3); }
.auth-footer { margin-top: 20px; text-align: center; font-size: 14px; color: #666; }
.auth-footer a { color: #007AFF; text-decoration: none; font-weight: 600; }

.action-buttons-row { display: flex; gap: 10px; margin-top: 20px; }
.btn-fav { background: #f0f0f2; border: none; border-radius: 12px; width: 50px; font-size: 24px; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-fav.active { color: #ff3b30; background: #ffe5e5; }
.stats-row { display: flex; gap: 15px; margin-bottom: 15px; color: #666; font-size: 13px; }
.stat-item { display: flex; align-items: center; gap: 5px; }

/* Личный кабинет */
.profile-card {
    position: relative;
    max-width: 500px; 
    width: 90%; 
    height: 80vh; /* Возвращаем фиксированную высоту из твоего первого кода */
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Чтобы ничего не торчало за скругленными углами */
}

#profile-view-mode, #profile-edit-mode {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden; /* Внутренний скролл будет только у списка */
}

.profile-tabs { display: flex; gap: 10px; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.tab-btn { background: none; border: none; font-size: 16px; padding: 10px; cursor: pointer; color: #999; }
.tab-btn.active { color: #007AFF; font-weight: bold; border-bottom: 2px solid #007AFF; }
.profile-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Включаем вертикальный скролл */
    flex: 1; /* Занимает всё оставшееся место */
    min-height: 0; /* <--- ВАЖНО: Разрешаем сжатие контейнера для активации скролла */
    padding-right: 5px; /* Отступ под скроллбар */
}

/* Добавляем стили скроллбара СПЕЦИАЛЬНО для этого списка, 
   чтобы перебить глобальное скрытие из начала файла */
.profile-list::-webkit-scrollbar {
    display: block !important;
    width: 4px !important; /* Тонкий скроллбар */
}

.profile-list::-webkit-scrollbar-track {
    background: transparent;
}

.profile-list::-webkit-scrollbar-thumb {
    background-color: #c1c1c1; /* Цвет ползунка */
    border-radius: 4px;
}

.profile-list::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8;
}
.profile-item { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: #f9f9f9; border-radius: 12px; border: 1px solid #eee; }
.status-badge { padding: 4px 8px; border-radius: 6px; font-size: 11px; font-weight: bold; }
.status-approved { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }
.close-btn-profile { position: absolute; top: 15px; right: 15px; background: #f0f0f2; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 18px; color: #333; display: flex; align-items: center; justify-content: center; transition: 0.2s; z-index: 10; }
.close-btn-profile:hover { background: #e0e0e0; transform: scale(1.1); }
/* --- НОВЫЙ ДИЗАЙН ФОРМЫ СОЗДАНИЯ --- */

/* Группировка в строку */
.form-grid-row {
    display: flex;
    gap: 12px;
    width: 100%;
}

.modern-input {
    background: #f2f2f7; /* Мягкий серый фон как в iOS */
    border: 2px solid transparent;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 16px;
    outline: none;
    transition: all 0.2s ease;
    color: #1d1d1f;
    font-weight: 500;
}

.modern-input::placeholder {
    color: #8e8e93;
    font-weight: 400;
}

.modern-input:focus {
    background: #ffffff;
    border-color: #007AFF; /* Подсветка при фокусе */
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.15);
}

.category-label {
    font-size: 13px;
    color: #86868b;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 колонки */
    gap: 10px;
    margin-bottom: 15px;
}

.cat-card {
    background: #ffffff;
    border: 2px solid #e5e5ea;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

.cat-card:hover {
    border-color: #d1d1d6;
    background: #f9f9f9;
}

.cat-card.active {
    border-color: #007AFF;
    background: #f0f7ff; /* Очень светлый голубой */
    color: #007AFF;
}

.cat-card.active .cat-icon {
    transform: scale(1.1);
}

.cat-icon {
    font-size: 20px;
    transition: transform 0.2s;
}

.cat-name {
    font-weight: 600;
    font-size: 14px;
}

/* Галочка для активной категории */
.cat-check {
    margin-left: auto;
    width: 18px;
    height: 18px;
    background: #007AFF;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    display: none; /* Скрыта по умолчанию */
    align-items: center;
    justify-content: center;
}

.cat-card.active .cat-check {
    display: flex; /* Показываем галочку когда активно */
}

/* Убираем стрелочки у инпута number */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
  -webkit-appearance: none; 
  margin: 0; 
}

/* Красивая плашка адреса */
.address-badge {
    background: #f2f2f7;
    border-radius: 12px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1d1d1f;
    font-size: 14px;
    border: 1px solid rgba(0,0,0,0.05);
    transition: 0.2s;
}
.address-badge.loading { opacity: 0.7; }
.address-icon { font-size: 18px; }
.address-text { 
    font-weight: 500; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    flex: 1;
}

/* Стилизация инпута Года */
input[type="number"] {
    -moz-appearance: textfield; /* Убираем стрелочки в Firefox */
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Убираем стрелочки в Chrome */
    margin: 0;
}

/* --- НОВЫЙ ДИЗАЙН ПОДТВЕРЖДЕНИЯ (Confirm) --- */
.confirm-card {
    text-align: center;
    width: 320px;
    padding: 30px;
}

.confirm-icon-wrapper {
    width: 60px;
    height: 60px;
    background: #eef5ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 15px auto;
    color: #007AFF;
}

.confirm-card h3 { margin: 0 0 10px 0; font-size: 20px; }
.confirm-card p { color: #666; margin: 0 0 25px 0; font-size: 15px; line-height: 1.4; }

.confirm-buttons {
    display: flex;
    gap: 10px;
}
.confirm-buttons button {
    padding: 12px 0;
    font-size: 16px;
}

/* --- АВАТАРКИ --- */

/* Аватар в шапке (маленький) */
.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
    border: 2px solid #e5e5ea;
}

/* Аватар в профиле (большой) */
.profile-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.profile-avatar-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    cursor: pointer;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: 0.2s;
}

.profile-avatar-wrapper:hover .profile-avatar {
    filter: brightness(0.8);
}

/* Иконка камеры поверх аватара при наведении */
.profile-avatar-edit-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 24px;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s;
}

.profile-avatar-wrapper:hover .profile-avatar-edit-icon {
    opacity: 1;
}

/* Аватар в отзыве */
.review-header {
    display: flex;
    align-items: center; /* Выравнивание по центру */
    gap: 10px; /* Отступ между аватаркой и именем */
}
.review-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #eee;
}
.review-meta {
    display: flex;
    flex-direction: column;
}

.profile-item-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.2s ease;
    cursor: default;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    flex-shrink: 0;
}
.profile-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    border-color: #d1d1d6;
}

/* Миниатюра фото (для избранного) */
.card-thumb {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    background: #f2f2f7;
    flex-shrink: 0;
}

/* Инфо-блок */
.card-info {
    flex: 1; /* Занимает все свободное место */
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden; /* Чтобы текст не вылезал */
}

.card-title {
    font-weight: 600;
    font-size: 15px;
    color: #1d1d1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-subtitle {
    font-size: 12px;
    color: #86868b;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Статистика (для моих меток) */
.card-stats {
    display: flex;
    gap: 10px;
    margin-top: 2px;
}

.stat-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    background: #f2f2f7;
    color: #555;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- КНОПКИ В КАРТОЧКЕ --- */
.btn-mini {
    background: #f2f2f7;
    color: #007AFF;
    border: none;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.btn-mini:hover {
    background: #007AFF;
    color: white;
}

/* Кнопка-иконка (стрелочка) */
.btn-icon-only {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f2f2f7;
    color: #007AFF;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 16px;
}

.btn-icon-only:hover {
    background: #007AFF;
    color: white;
}

/* --- ПЕРЕКЛЮЧАТЕЛЬ РЕЖИМА ПОИСКА --- */
.search-mode-switch {
    position: relative;
    display: flex;
    align-items: center;
    background-color: #e9e9f0;
    border-radius: 20px;
    padding: 4px;
    flex-shrink: 0; /* Чтобы не сжимался */
}
.mode-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1;
}

.search-mode-switch.address-active .mode-slider {
    left: 50%; /* Сдвигаем вправо */
}

.mode-btn {
    border: none;
    background: transparent;
    padding: 6px 12px;
    cursor: pointer;
    z-index: 2;
    font-size: 18px;
    transition: color 0.3s;
    color: #8e8e93;
}
.search-mode-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #8e8e93;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    z-index: 2;
}

.mode-btn.active { color: #1d1d1f; }

.search-mode-btn.active {
    background: #ffffff;
    color: #1d1d1f;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Изменим контейнер поиска, чтобы вместить переключатель */
/* .search-container {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
} */

/* Уберем старые стили инпута, так как теперь он внутри паддинга */
#map-search {
    width: 100%;
    box-sizing: border-box; /* Чтобы padding не ломал ширину */
    background: #f0f2f5;
    border-radius: 12px;
    border: 1px solid #e0e2e7;
    padding: 12px 16px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

#map-search:focus {
    background: #ffffff;
    border-color: #007AFF;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

/* ... (Старые стили navbar оставляем, но обновляем nav-right) ... */

.nav-user-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 20px;
    transition: background 0.2s;
}
.nav-user-container:hover {
    background: rgba(0,0,0,0.05);
}

/* --- ОБНОВЛЕННЫЙ SIDEBAR --- */
.sidebar {
    position: fixed; top: 0; right: -350px; width: 320px; height: 100vh; 
    background: #fff; box-shadow: -10px 0 40px rgba(0,0,0,0.15); 
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); 
    z-index: 2000; 
    display: flex; flex-direction: column;
}
.sidebar.active { right: 0; }

/* Хедер меню (Карточка юзера) */
.sidebar-header {
    padding: 25px;
    background: #f9f9fb;
    border-bottom: 1px solid #eee;
    position: relative;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-avatar-img {
    width: 50px; height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.menu-guest-icon {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; color: #fff;
}

.menu-user-info h3 {
    margin: 0;
    font-size: 18px;
    color: #1d1d1f;
}

.menu-role-badge {
    font-size: 12px;
    color: #86868b;
    font-weight: 500;
}

.close-btn {
    position: absolute;
    top: 20px; right: 20px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}
.close-btn:hover { color: #333; }

/* Контент меню */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.menu-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    font-weight: 700;
    margin-bottom: 10px;
    margin-top: 10px;
}
.menu-section-title:first-child { margin-top: 0; }

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0 0 25px 0;
}

.menu-list li {
    margin-bottom: 5px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    color: #1d1d1f;
    font-size: 16px;
    border-radius: 10px;
    transition: background 0.2s;
    font-weight: 500;
}

.menu-link:hover {
    background: #f2f2f7;
    color: #007AFF;
}

.menu-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Переключатель слоев (Редизайн) */
.layer-switcher {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layer-option input { display: none; }

.layer-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #eee;
    cursor: pointer;
    transition: 0.2s;
    font-size: 14px;
    color: #333;
}

.layer-option input:checked + .layer-card {
    border-color: #007AFF;
    background: #f0f7ff;
    color: #007AFF;
    font-weight: 600;
}

/* Футер меню */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #fcfcfc;
}

.menu-logout-btn {
    width: 100%;
    padding: 12px;
    background: #fff0f0;
    color: #ff3b30;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: 0.2s;
}

.menu-logout-btn:hover {
    background: #ffe5e5;
}

.version-text {
    text-align: center;
    font-size: 11px;
    color: #ccc;
    margin-top: 15px;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none; /* Убираем подчеркивание */
    user-select: none;     /* Чтобы не выделялось как текст */
}

.logo-img {
    border: 1px solid #000000;
    height: 50px;         /* Оптимальная высота (высота меню 64px) */
    width: auto;     
    object-fit: contain;
    border-radius: 50%;
 
    /* Опционально: отступ, если лого слишком прижат к краю */
    /* margin-left: 5px; */ 
    
    transition: transform 0.2s ease, opacity 0.2s;
}

/* Эффект при наведении */
.logo-link:hover .logo-img {
    opacity: 0.9;
    transform: scale(1.02);
}

/* Вложенные комментарии */
/* Отступ только для ПЕРВОГО уровня вложенности */
.review-children-indent {
    margin-left: 30px; /* Сдвиг вправо для первого ответа */
    margin-top: 10px;
    padding-left: 10px;
    border-left: 2px solid #e0e0e0; /* Линия ветки */
}

/* Для второго и последующих уровней - БЕЗ дополнительного отступа */
.review-children-flat {
    margin-left: 0; /* Не сдвигаем дальше */
    margin-top: 10px;
    padding-left: 0;
    border-left: none; /* Убираем линию или оставляем тонкую, если хочется */
    
    /* Чтобы визуально отделить, можно добавить верхний бордер или фон */
    border-top: 1px solid #f5f5f7;
    padding-top: 10px;
}
/* 1. ПЕРВАЯ СТУПЕНЬ (Ответ на корневой комментарий) */
.replies-indent {
    margin-left: 30px; /* Единственный сдвиг вправо */
    margin-top: 8px;
    border-left: 2px solid #e0e0e0; /* Линия ветки */
    padding-left: 10px;
    
    /* Важно: сбрасываем ширину, чтобы не вылезало */
    width: auto; 
}

/* 2. ВСЕ ПОСЛЕДУЮЩИЕ СТУПЕНИ (Ответ на ответ) */
.replies-flat {
    margin-left: 0 !important; /* ЗАПРЕЩАЕМ сдвиг вправо */
    padding-left: 0 !important; /* ЗАПРЕЩАЕМ внутренний отступ */
    border-left: none !important; /* Убираем линию */
    margin-top: 8px;
}

/* Небольшой тюнинг кнопки ответа, чтобы не занимала много места */
.btn-reply {
    margin-left: auto;
    border: none;
    background: #f0f2f5;
    color: #007AFF;
    cursor: pointer;
    font-size: 14px;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    transition: 0.2s;
}
.btn-reply:hover { background: #e1e4e8; }

/* Кнопки управления в Моих метках */
.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.btn-action-icon {
    width: 32px; height: 32px;
    border-radius: 8px; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px; transition: 0.2s;
}
.btn-edit-marker { background: #eef5ff; color: #007AFF; }
.btn-delete-marker { background: #fff0f0; color: #ff3b30; }

/* Индикатор ответа */
#reply-indicator {
    background: #f0f7ff;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #007AFF;
    display: flex; justify-content: space-between; align-items: center;
}

/* --- НОВЫЕ СТИЛИ ДЛЯ КОММЕНТАРИЕВ --- */

/* Прозрачная обертка. Не имеет padding/margin, чтобы не накапливать отступы */
.review-wrapper {
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

/* Видимая карточка комментария (белая плашка) */
.review-card {
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #f0f0f2;
    position: relative;
    /* Тень опциональна */
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.02); */
}

/* УРОВЕНЬ 1: Ответ на корневой комментарий */
/* Делаем отступ и рисуем линию */
.replies-indent {
    margin-left: 30px; 
    border-left: 2px solid #e0e0e0;
    padding-left: 10px;
    margin-top: 10px;
}

/* УРОВЕНЬ 2+: Ответ на ответ */
/* СТРОГО ОБНУЛЯЕМ все отступы */
.replies-flat {
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-left: none !important;
    margin-top: 10px;
}

/* Кнопка ответа */
.btn-reply {
    margin-left: auto;
    border: none;
    background: #f2f2f7;
    color: #007AFF;
    border-radius: 50%;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 14px;
}
.btn-reply:hover { background: #e1e4e8; }

.reviews-root {
    margin: 0;
    padding: 0;
}

/* Обертка комментария (чтобы отделить карточку от вложенных детей) */
.review-wrapper {
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

/* Сама карточка (белая плашка) */
.review-card {
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #f0f0f2;
    position: relative;
    margin-bottom: 5px; /* Небольшой отступ до детей */
}

/* 1. ПЕРВАЯ СТУПЕНЬ (Ответы на корневые комментарии) */
/* Это применяется к КОНТЕЙНЕРУ детей, если глубина = 0 */
.replies-indent {
    margin-left: 35px; /* СДВИГ ВПРАВО */
    padding-left: 10px;
    border-left: 2px solid #e0e0e0; /* Линия ветки */
    margin-top: 5px;
}

/* 2. ВТОРАЯ И ПОСЛЕДУЮЩИЕ СТУПЕНИ (Глубокие ответы) */
/* Это применяется к КОНТЕЙНЕРУ детей, если глубина > 0 */
.replies-flat {
    margin-left: 0 !important; /* БОЛЬШЕ НИКАКИХ СДВИГОВ */
    padding-left: 0 !important;
    border-left: none !important;
    margin-top: 5px;
}

/* Дополнительная красота */
.reply-arrow {
    color: #999;
    font-size: 12px;
    font-weight: 400;
    margin-left: 5px;
}

.review-stars {
    color: #ffcc00;
    font-size: 12px;
    margin-bottom: 4px;
}

.btn-reply {
    margin-left: auto;
    border: none;
    background: #f2f2f7;
    color: #007AFF;
    border-radius: 50%;
    width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}
.btn-reply:hover { background: #e1e4e8; }

/* --- СТИЛИ КОММЕНТАРИЕВ (ИСПРАВЛЕННЫЕ) --- */

/* Уровень 0: Корневые комментарии */
.replies-root {
    margin: 0;
    padding: 0;
    border: none;
}

/* Уровень 1: Первый отступ (Ступенька) */
.replies-indent {
    margin-left: 35px;       /* Сдвигаем ветку вправо */
    padding-left: 10px;      /* Внутренний отступ от линии */
    border-left: 2px solid #e0e0e0; /* Рисуем серую линию ветки */
    margin-top: 5px;
}

/* Уровень 2+: Плоский список (Вертикально вниз) */
.replies-flat {
    margin-left: 0 !important;   /* Запрещаем дальнейший сдвиг */
    padding-left: 0 !important;
    border-left: none !important; /* Линия не нужна, она наследуется от уровня 1 */
    margin-top: 5px;
    
    /* Опционально: можно добавить тонкий разделитель сверху */
    /* border-top: 1px dashed #eee; */ 
}

/* Общие стили карточки */
.review-wrapper {
    margin-bottom: 8px;
}

.review-card {
    background: #fff;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #f0f0f2;
    position: relative;
}

.reply-arrow {
    color: #999;
    font-size: 12px;
    margin-left: 5px;
}

/* Мета-информация (автор, дата, исправлено) */
.review-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-right: auto; /* Толкаем кнопки вправо */
}

/* Пометка "Исправлено" */
.edited-label {
    font-size: 11px;
    color: #999;
    font-style: italic;
}

/* Контейнер действий (Редактировать, Удалить, Ответить) */
.review-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Кнопки иконок (карандаш, мусорка) */
.btn-comment-action {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    opacity: 0.6;
    transition: 0.2s;
}
.btn-comment-action:hover { opacity: 1; transform: scale(1.1); }
.action-edit { color: #007AFF; }
.action-delete { color: #ff3b30; }

/* Шторка (Кнопка свернуть/развернуть) */
.toggle-replies-btn {
    background: none;
    border: none;
    color: #007AFF;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 5px;
    display: flex; align-items: center; gap: 5px;
    padding: 5px 0;
}
.toggle-replies-btn:hover { text-decoration: underline; }

/* Скрытый контейнер ответов */
.replies-hidden { display: none; }

/* Поле редактирования (появляется вместо текста) */
.edit-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #007AFF;
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
    margin-top: 5px;
}
.edit-buttons { display: flex; gap: 10px; margin-top: 5px; }

/* Карточка комментария должна быть 'relative', чтобы позиционировать кнопки */
.review-card {
    background: #fff;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid #f0f0f2;
    position: relative; /* <--- ВАЖНО */
    transition: background 0.2s;
}
.review-card:hover {
    background: #fcfcfd; /* Легкая подсветка при наведении */
}

/* 1. КОНТЕЙНЕР ДЛЯ КНОПОК ДЕЙСТВИЙ (Редактировать, Удалить, Ответить) */
.review-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    background: #fff;
    padding: 4px;
    border-radius: 20px;
    border: 1px solid #eee;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);

    /* Скрываем по умолчанию */
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.2s ease-out;
    pointer-events: none; /* Чтобы не мешали кликать по тексту */
}

/* ПОКАЗЫВАЕМ КНОПКИ ПРИ НАВЕДЕНИИ НА КАРТОЧКУ КОММЕНТАРИЯ */
.review-card:hover .review-actions {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto; /* Делаем кликабельными */
}

/* 2. СТИЛЬ САМИХ КНОПОК-ИКОНОК */
.review-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    transition: background 0.2s, color 0.2s;
}

.review-action-btn:hover {
    background: #f0f2f5;
}
/* Цвета для разных действий при наведении */
.review-action-btn.action-edit:hover { color: #007AFF; }
.review-action-btn.action-delete:hover { color: #ff3b30; }
.review-action-btn.action-reply:hover { color: #34c759; }

/* 3. ШТОРКА (Кнопка свернуть/развернуть) */
.toggle-replies-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    padding: 2px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.toggle-replies-btn:hover {
    color: #007AFF;
}
.toggle-replies-btn .arrow {
    transition: transform 0.2s;
}
/* Класс для перевернутой стрелки */
.arrow-collapsed {
    transform: rotate(-90deg);
}

/* Контейнер для скрытых ответов */
.replies-hidden {
    display: none;
}
.card-spacer {
    height: 15px;       /* Высота отступа */
    width: 100%;        /* На всю ширину */
    flex-shrink: 0;     /* Запрещаем ему сжиматься */
    display: block;     /* Гарантируем, что это блок */
    background: transparent; /* Он невидимый */
}

/* Бейдж ранга в комментариях */
.rank-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 700;
    margin-left: 5px;
    display: inline-block;
    vertical-align: middle;
    text-transform: uppercase;
}

/* Обновляем мета-данные в комментах, чтобы всё ровно стояло */
.review-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center; /* Центрируем по вертикали */
    gap: 6px;
    margin-right: auto;
}

/* Имя автора делаем чуть жирнее */
.review-author {
    font-weight: 700;
    color: #333;
}

.review-header {
    display: flex;
    align-items: flex-start; /* Выравнивание по верху */
    gap: 12px;
    margin-bottom: 8px;
    position: relative;
    padding-right: 80px; /* Место справа, чтобы текст не наезжал на кнопки действий */
}

/* Аватар */
.review-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0; /* Чтобы не сжимался */
    border: 1px solid #eee;
}

#compass-btn {
    display: none;
}

/* Колонка с текстом */
.review-header-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px; /* Расстояние между верхней и нижней строкой */
}

/* Верхняя строка (Имя, Ранг) */
.review-line-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.review-author {
    font-weight: 700;
    font-size: 14px;
    color: #1d1d1f;
}

/* Нижняя строка (Кому ответ, Дата) */
.review-line-bottom {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 12px;
    color: #86868b;
}

.reply-arrow {
    color: #007AFF;
    background: #f0f7ff;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.meta-dot {
    font-size: 10px;
    color: #ccc;
}

.review-date {
    font-size: 11px;
    color: #999;
}

/* Текст самого комментария */
.review-text {
    margin-left: 48px; /* Сдвигаем текст, чтобы он был под Именем (36px аватар + 12px gap) */
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* На мобильных убираем большой отступ текста */
@media (max-width: 480px) {
    .review-text {
        margin-left: 0;
        margin-top: 8px;
    }
}
/* Футер комментария с лайками */
.review-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    margin-left: 48px; /* Выравниваем под текстом */
}

.vote-btn {
    background: #f5f5f7;
    border: none;
    border-radius: 12px;
    padding: 4px 10px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
    color: #555;
}

.vote-btn:hover { background: #e0e0e0; }

.vote-btn.active-like {
    background: #e6fffa;
    color: #00b894;
    border: 1px solid #00b894;
}

.vote-btn.active-dislike {
    background: #fff5f5;
    color: #d63031;
    border: 1px solid #d63031;
}

/* Кнопка жалобы (флажок) */
.action-report:hover { color: #e67e22; }

/* Кнопка языка в меню */
.lang-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #eee;
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
}
.lang-btn:hover { background: #f9f9f9; }

/* На мобильном футер отзыва сдвигаем влево */
@media (max-width: 480px) {
    .review-footer { margin-left: 0; }
}

/* --- КОНТЕКСТНОЕ МЕНЮ --- */
.context-menu {
    display: none;
    position: absolute;
    z-index: 10000;
    background: #2f3136; /* Цвет Discord темный */
    color: #dcddde;
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.24);
    padding: 6px 0;
    width: 180px;
    font-size: 14px;
}

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

.context-menu li {
    padding: 8px 12px;
    cursor: pointer;
    display: flex; gap: 10px; align-items: center;
    transition: 0.1s;
}

.context-menu li:hover {
    background: #40444b;
    color: #fff;
}

.context-menu hr {
    border: 0; border-top: 1px solid #40444b;
    margin: 4px 0;
}

/* --- ТАБЛЕТКИ РЕАКЦИЙ (Discord Style) --- */
.reactions-container {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    margin-left: 48px; /* Выравнивание под текстом */
}

.reaction-pill {
    background: #2f31360d; /* Очень светлый серый */
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 2px 6px;
    font-size: 12px;
    cursor: pointer;
    display: flex; align-items: center; gap: 4px;
    transition: 0.2s;
    user-select: none;
}

.reaction-pill:hover { background: #e0e0e0; }

.reaction-pill.active {
    background: #e7f5ff; /* Светло-синий фон */
    border-color: #007AFF;
    color: #007AFF;
}

.reaction-count { font-weight: bold; }

.replies-hidden { display: none; }

/* --- СТИЛИ ДЛЯ РЕДАКТИРОВАНИЯ ПРОФИЛЯ --- */

#profile-edit-mode h3 {
    margin: 0 0 20px 0;
    font-size: 22px;
}

#profile-edit-mode .profile-header {
    gap: 0; /* Убираем лишний отступ */
}

#profile-edit-mode label {
    font-size: 13px;
    font-weight: 600;
    color: #86868b;
    margin-top: 15px;
    margin-bottom: 5px;
}

#profile-edit-mode .modern-input {
    width: 100%;
    box-sizing: border-box; /* Чтобы padding не ломал ширину */
}

#profile-edit-mode hr {
    border: none;
    border-top: 1px solid #e5e5ea;
    margin: 25px 0;
}

/* Стилизуем кнопку удаления, чтобы она была заметнее */
#profile-edit-mode .btn-delete {
    background: #fff0f0;
    color: #ff3b30;
    border: 1px solid #ffdede;
    font-weight: bold;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

#profile-edit-mode .btn-delete:hover {
    background: #ff3b30;
    color: white;
    border-color: #ff3b30;
}

.edit-profile-header h3 {
    text-align: center;
    margin-bottom: 25px;
    font-size: 20px;
}

.edit-avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.edit-input-group {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.edit-input-group label {
    font-size: 12px;
    font-weight: 700;
    color: #8e8e93;
    margin-bottom: 6px;
    margin-left: 4px;
    text-transform: uppercase;
}

.edit-input-group textarea {
    min-height: 100px;
    resize: none;
}

.danger-zone {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.danger-zone p {
    font-size: 12px;
    color: #ff3b30;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.btn-delete-account {
    width: 100%;
    background: #fff;
    color: #ff3b30;
    border: 1px solid #ff3b30;
    padding: 10px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-delete-account:hover {
    background: #ff3b30;
    color: #fff;
}

/* В style.css */
.modal-overlay {
    display: none; 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); /* Чуть темнее фон */
    z-index: 10000 !important; /* Форсируем самый верхний слой */
    justify-content: center; 
    align-items: center; 
    backdrop-filter: blur(8px); /* Сильнее размытие для акцента */
}

.edit-profile-scroll-container {
    padding: 10px;
    background: #fcfcfd;
    border-radius: 16px;
    border: 1px solid #f2f2f7;
    margin-bottom: 15px;
}

.edit-input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #8e8e93;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#my-bio-edit {
    line-height: 1.5;
    font-family: inherit;
    border: 1px solid #e5e5ea;
}

#my-bio-edit:focus {
    border-color: #007AFF;
    background: #fff;
}

/* Кнопка удаления аккаунта (опасная зона) */
.btn-delete-account:hover {
    color: #ff3b30;
    text-decoration: none !important;
    opacity: 0.7;
}

#toast-container {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    /* Устанавливаем экстремально высокий z-index, выше всех модалок (10001) */
    z-index: 999999 !important; 
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    /* Чтобы контейнер не мешал кликать по карте, когда уведомлений нет */
    pointer-events: none; 
}

.toast {
    background: rgba(29, 29, 31, 0.95);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px; /* Овальная форма в стиле iOS */
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: toastIn 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    white-space: nowrap;
    /* Возвращаем кликабельность самим уведомлениям */
    pointer-events: auto; 
}

/* Специальные цвета для типов (опционально) */
.toast.error {
    background: rgba(255, 59, 48, 0.95); /* Красный */
}

.toast.success {
    background: rgba(52, 199, 89, 0.95); /* Зеленый */
}

/* Анимация появления снизу вверх */
@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.scrollable-list {
    overflow-y: auto !important;  /* Включаем вертикальный скролл */
    max-height: calc(70vh - 200px);  /* Ограничение высоты: 70vh минус место для шапки/табов (подгоните под ваш дизайн) */
    display: flex;
    flex-direction: column;
    gap: 10px;  /* Расстояние между карточками, как в iOS */
    padding: 10px;  /* Внутренние отступы */
    border-radius: 12px;  /* Скругление, если нужно */
    background: #ffffff;  /* Легкий фон для контраста */
}

/* Восстанавливаем скроллбар для этого класса (тонкий и красивый, как в macOS) */
.scrollable-list::-webkit-scrollbar {
    display: block !important;  /* Переопределяем глобальное скрытие */
    width: 8px !important;  /* Узкий скроллбар */
    height: 8px !important;
}

.scrollable-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);  /* Полупрозрачный серый */
    border-radius: 4px;
}

.scrollable-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);  /* Темнее при hover */
}

.scrollable-list::-webkit-scrollbar-track {
    background: transparent;  /* Без фона */
}

/* Для Firefox: Восстанавливаем скроллбар */
.scrollable-list {
    scrollbar-width: thin !important;  /* Тонкий скроллбар */
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;  /* Цвет thumb и track */
}

/* Для IE/Edge: Восстанавливаем */
.scrollable-list {
    -ms-overflow-style: auto !important;  /* Обычный скролл */
}

/* Стили для карточек внутри (чтобы они не ломали скролл) */
.scrollable-list .profile-card {
    flex-shrink: 0;  /* Карточки не сжимаются */
    width: 100%;  /* На всю ширину */
}

#top100-modal .profile-item-card:hover {
    background: #f0f8ff;
    transform: translateX(5px);
}

/* --- COOKIE BANNER --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95); /* Почти непрозрачный белый */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    
    padding: 20px;
    /* Учет безопасной зоны снизу (для iPhone) */
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    z-index: 9999; /* Поверх карты, но под модалками */
    
    animation: slideUpCookie 0.5s ease-out;
    box-sizing: border-box;
}

@keyframes slideUpCookie {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.cookie-text {
    font-size: 13px;
    color: #333;
    line-height: 1.4;
    flex: 1; /* Текст занимает все свободное место */
}

.cookie-text a {
    color: #007AFF;
    text-decoration: underline;
    font-weight: 500;
}

.cookie-btn {
    background: #1d1d1f; /* Черная кнопка (стильно) */
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap; /* Текст не переносится */
    transition: transform 0.1s;
}

.cookie-btn:hover {
    transform: scale(1.05);
    background: #000;
}

/* На мобильных чуть меньше отступы */
@media (max-width: 768px) {
    .cookie-banner {
        flex-direction: column; /* Кнопка под текстом на узких экранах */
        align-items: stretch;
        text-align: center;
        gap: 15px;
    }
    .cookie-btn {
        width: 100%;
        padding: 12px;
    }
}

/* --- ГАЛОЧКА СОГЛАСИЯ --- */
.legal-check-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    text-align: left;
}

.legal-check-wrapper input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0; /* Чтобы галочка не сплющивалась */
}

.legal-check-wrapper label {
    cursor: pointer;
    user-select: none;
}

.legal-check-wrapper a {
    color: #007AFF;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border 0.2s;
}

.legal-check-wrapper a:hover {
    border-bottom-color: #007AFF;
}

/* --- НЕАКТИВНАЯ КНОПКА --- */
.btn-auth-action:disabled {
    background: #d1d1d6; /* Серый цвет */
    color: #8e8e93;       /* Тусклый текст */
    cursor: not-allowed;
    box-shadow: none;
    transform: none !important;
}

/* Обертка для галочки */
.legal-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
    text-align: left;
    padding: 0 5px;
}

.legal-wrapper input {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #007AFF; /* Синяя галочка */
    flex-shrink: 0;
}

.legal-wrapper a {
    color: #007AFF;
    text-decoration: underline;
}

/* Стиль выключенной кнопки */
.btn-auth-action:disabled {
    background: #e5e5ea !important;
    color: #999 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important; /* Убираем эффект нажатия */
}

/* =========================================
   ПОЛНОЭКРАННАЯ МОБИЛЬНАЯ АДАПТАЦИЯ (v.12 - ОЧИЩЕННАЯ)
   ========================================= */

/* --- 2. МОБИЛЬНАЯ АДАПТАЦИЯ (Только для экранов до 768px) --- */
/* --- 2. МОБИЛЬНАЯ АДАПТАЦИЯ (Только для экранов до 768px) --- */
@media (max-width: 768px) {
    
    /* Эти правила уже применены глобально, но мы оставляем их для надежности */
    html, body, #map {
        /* Больше никаких 100dvh! Только жесткие координаты */
    }

    /* --- ВЕРХНИЙ БАР (NAVBAR) --- */
    .navbar {
        position: fixed; 
        top: 0;
        left: 0;
        width: 100%;
        height: calc(60px + env(safe-area-inset-top)) !important; 
        padding-top: env(safe-area-inset-top) !important;
        padding-left: 12px;
        padding-right: 12px;
        gap: 5px;
        background: rgba(255, 255, 255, 0.95); 
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: 2000;
        display: flex;
        align-items: center;
        box-sizing: border-box;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .nav-left, .nav-right { flex: 0 0 auto !important; width: auto !important; }
    
    /* Увеличенный логотип */
    .logo-img { height: 36px !important; width: auto; } 
    
    #desktop-search-switch, .nav-user-container, #login-btn { display: none !important; }

    .nav-center { 
        flex: 1 !important; 
        margin: 0 5px !important; 
        position: static !important; 
        transform: none !important; 
        display: flex !important; 
        align-items: center; 
    }
    
    .mobile-toggle-btn {
        display: flex !important;
        width: 30px !important; 
        height: 30px !important; 
        border-radius: 50%;
        background: #fff; 
        border: 1px solid #e0e0e0;
        font-size: 14px !important; 
        align-items: center; 
        justify-content: center;
        flex-shrink: 0;
    }
    
    .search-container { flex: 1 !important; height: 32px !important; background: #f2f2f7; border-radius: 20px; }
    #map-search { width: 100% !important; padding: 0 12px; font-size: 14px !important; height: 100%; }

    /* --- ФИЛЬТРЫ (СТЕКЛО) --- */
    .filter-bar {
        top: calc(64px + env(safe-area-inset-top)) !important; 
        left: 10px !important;
        right: 10px !important;
        width: auto !important; 
        transform: none;
        border-radius: 16px !important;
        padding: 8px 10px !important; 
        background: rgba(255, 255, 255, 0.6) !important; 
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
        display: flex; 
        overflow-x: auto; 
        gap: 8px;
        scrollbar-width: none; 
        -ms-overflow-style: none; 
    }
    .filter-bar::-webkit-scrollbar { display: none; }
    .filter-btn { flex-shrink: 0; background: #fff; border: 1px solid rgba(0,0,0,0.05); }

    /* --- КНОПКИ УПРАВЛЕНИЯ КАРТОЙ --- */
    #locate-btn { 
        bottom: calc(20px + env(safe-area-inset-bottom)) !important; 
        left: 15px !important; 
        top: auto !important; 
        z-index: 100;
    }

    #compass-btn {
        display: flex !important;
        position: fixed !important;
        bottom: calc(20px + env(safe-area-inset-bottom)) !important; 
        right: 15px !important; 
        top: auto !important;
        z-index: 100;
        width: 44px !important; 
        height: 44px !important;
        padding: 0 !important; 
        border-radius: 50%;
        background: #ffffff;
        border: none;
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
        align-items: center; 
        justify-content: center;
        font-size: 24px;
        cursor: pointer;
        transition: transform 0.1s linear; 
    }

    /* --- ОКНА-ШТОРКИ --- */
    .modal-overlay {
        display: none;
        align-items: flex-end !important;
        padding: 0 !important;
        z-index: 5000;
    }
    
    .form-card, .details-card, .profile-card, .auth-card {
        width: 100% !important;
        height: auto !important; 
        max-height: 85dvh !important; 
        border-radius: 24px 24px 0 0 !important;
        /* Уменьшаем боковые отступы: сверху 20px, по бокам 12px (вместо 20px) */
        padding: 20px 12px !important;
        padding-bottom: calc(30px + env(safe-area-inset-bottom)) !important; 
        animation: slideUpSheet 0.3s cubic-bezier(0.25, 1, 0.5, 1);
        box-sizing: border-box;
    }

    @keyframes slideUpSheet {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }

    .form-grid-row { display: flex !important; flex-direction: row !important; gap: 10px !important; }
    .category-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 12px !important; }
    .form-buttons { display: flex !important; flex-direction: row !important; gap: 12px !important; }
    .btn-save, .btn-cancel { flex: 1; padding: 16px 0 !important; }

    .details-header-img {
        /* Компенсируем новые боковые отступы (12px + 12px = 24px) */
        width: calc(100% + 24px) !important;
        margin: -20px -12px 15px -12px !important;
        height: 180px !important;
        border-radius: 24px 24px 0 0 !important;
    }
    
        .details-body {
        padding: 0 !important;
    }
}

#lightbox.modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #000000 !important; /* Глухой черный цвет, чтобы скрыть карточку */
    z-index: 999999 !important; /* Перекрывает абсолютно всё */
    align-items: center !important; /* Центрируем по вертикали (отменяет прилипание к низу) */
    justify-content: center !important; /* Центрируем по горизонтали */
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important; /* Убираем скругления шторок */
}

#lightbox-img {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important; /* Фото вписывается целиком, не обрезаясь */
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    animation: zoomInPhoto 0.25s ease-out; /* Плавное появление */
}

@keyframes zoomInPhoto {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
