/* CSS переменные для часто используемых значений */
:root {
    --primary-color: #333; --secondary-color: #aab; --accent-color: #66f; --light-bg: #f9f9f9;
    --border-color: #ddd; --shadow: 0 4px 6px rgba(0, 0, 0, 0.2); --transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Основные стили */
body { font-family: Arial, sans-serif; margin: auto; padding-top: 58px !important; box-sizing: border-box; 
    background-color: var(--light-bg); max-width: 90%; display: flex; flex-direction: column; min-height: 100dvh;}
.page-body { flex: 1; max-width: 1001px;}
h1, h2 { text-align: left; color: var(--primary-color); display: inline-block; margin-right: 10px; }

.hint { background: #f5f5f5; border-left: 3px solid #333; padding: 10px 15px; margin-bottom: 0px; font-size: 0.8em; color: #555; border-radius: 0 5px 5px 0; }
.upload-loader {font-size:0.9em;font-weight:bold;color:#000;margin:8px 0 4px 0;text-align:center;}
.upload-loader {animation: slowBlink 1s ease-in-out infinite;}
@keyframes slowBlink {0%, 100% { opacity: 1; }50% { opacity: 0.4; }}

/* Фиксированная шапка */
.header-container {
    position: fixed; top: 0; left: 0; width: 100%; box-sizing: border-box; background: #000; z-index: 3000;
    display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 1px rgba(0,0,0,0.07);
    padding: 0 18px; height: 56px; gap: 12px; color: white;
    font-size:clamp(0.5em, 0.8em, 1.2em);
}
.header-main { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; color: white; }
.header-right { display: flex; align-items: center; gap: 10px; color: white; font-size: 0.9em; }

.footer-container {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    box-sizing: border-box;
    background: #000;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.2);
    padding: 0 18px; height: 40px; gap: 12px; color: white;
    font-size: clamp(0.5em, 0.8em, 1.2em);
    margin-top: 16px;
}
.footer-container a{    
    color: white;
    text-decoration: underline;
    font-weight: bold;}

/* Кнопки */
.menu-button {
    width: 40px; height: 40px; background-color: black; color: white; border: none; border-radius: 5px;
    cursor: pointer; display: flex; justify-content: center; align-items: center; font-size: 1.5em;
    margin-right: 0; position: static !important; top: auto !important; left: auto !important; z-index: 3000;
}
.circle-button {
    width: 22px; height: 22px; background-color: var(--secondary-color); color: #fff; border: none;
    border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 1.2em;
    cursor: pointer; box-shadow: var(--shadow); transition: var(--transition);
}
.circle-button:hover { animation: hoverAnimation 2s ease; }
.block_info{margin-top:10px}
.avatar{width:100px;height:100px;border-radius:50%;background-color:#ccc;display:block;flex-shrink:0;}
.button1 {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: normal;      /* Разрешить перенос */
    text-align: center;
    word-break: break-word;   /* Переносить длинные слова */
    padding: 3px 5px;  
    /*border: 1px solid var(--primary-color);*/
    border-radius: 5px;
    background-color: #f9f9fb; cursor: pointer; font-size: 0.7em; color: rgb(0, 0, 0);
    transition: background-color 0.3s ease; 
    margin: 4px;
    min-height:15.5px;

    /*margin-right: 10px;margin-left:5px;*/
}
.button1:hover { background-color: rgb(146, 146, 146); color: var(--primary-color);}

@keyframes hoverAnimation {
    0% { background-color: var(--secondary-color); transform: scale(1); }
    50% { background-color: #5599ff; transform: scale(1.2); }
    100% { background-color: var(--secondary-color); transform: scale(1); }
}

/* Скрытые элементы */
#my_options { display: none; }
.archive { display: none; } /* ↕ JS: toggleArchive() — ui-interactions.js */

/* Контейнеры объектов */
.object-header-container { margin-top: 10px; display: inline-flex; align-items: center; gap: 10px;cursor: pointer; padding-left:19px;margin-left:5px}
/*.object-header-container { background-color: black; padding:5px 5px 5px 19px; border-radius:5px;margin-top: 10px; display: flex; align-items: center; gap: 10px;cursor: pointer; }*/


.object-header { margin: 0; font-size: 0.7em; color: #444; }
.complex-container {
     background-color: #f9f9fb; border: 1px solid var(--border-color);
    border-radius: 1px; padding: 2px; margin-top:2px;/*margin: 5px auto;*/
}
/*.complex-name { writing-mode: vertical-rl;text-align:right; transform: rotate(180deg); padding: 0px 0px 50px 0px; }*/
.complex-items { width: 100%; }
.plosh {
    background-color: #f0f0f0; border: 1px solid var(--border-color); border-radius: 5px;
    padding: 2px; /*margin: 2px auto;*/
}

.show_hidden{
    background-color: #f0f0f0; border: 1px solid var(--border-color); border-radius: 5px;
    text-align: center;  color: #555;
    cursor: pointer; padding: 2px; margin: 2px auto;    
}

.plosh-description { display: none; /* ↕ JS: toggleDescription() — ui-interactions.js */ 
    margin-top: 10px; font-size: 1em; color: #555; 
    background-color: #fff; border: 1px solid var(--border-color); border-radius: 5px; padding: 2px;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);
}
.plosh-status { font-size: 0.5em; display: flex; flex-direction: column; }
.plosh-buttons { width: auto; min-height: 30px; font-size: 0.7em; }

/* Кнопки и ссылки */
.button_add { display: inline-block; cursor: pointer; color: var(--accent-color); }

/* Меню */
.menu-container { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8);
    display: none; flex-direction: column; justify-content: center; align-items: center; color: #fff; z-index: 1000;
}
.menu-container a { color: #fff; text-decoration: none; font-size: 1.5em; margin: 10px 0; }
.menu-container .back-button { position: absolute; top: 10px; left: 10px; font-size: 1.5em; cursor: pointer; }

/* Копирование ссылок */
.copy-container {display: flex; align-items: center; justify-content: center; 
    padding: 5px; margin:2px;border: 1px solid var(--border-color); border-radius: 5px;
    background-color: var(--light-bg); cursor: pointer; font-size: 11px; color: var(--primary-color);
    transition: background-color 0.3s ease; 
    height:14.5px;
    text-align: center;
    /*margin-right: 10px;margin-left:5px;*/
}
.copy-container:hover { background-color: #e0e0e0; }

/* Шапка аккаунта */
.account-header { box-sizing: border-box;      
    background-color: #f9f9fb; border: 1px solid var(--border-color);
    border-radius: 1px; padding: 2px; margin-top:2px;/*margin: 5px auto;*/}

/* Заглушка (нет аватарки, owner) */
.account-avatar-placeholder {
    width: 80px; min-width: 80px; height: 80px;
    background: #e8e8e8; border-radius: 4px; border: 1px dashed #bbb;
    display: flex; align-items: center; justify-content: center;
    text-align: center; cursor: pointer;
    padding: 6px; box-sizing: border-box;
    line-height: 1.4; color: #999; font-size: 0.75em;
}
.account-avatar-placeholder:hover { background: #ddd; border-color: #999; }

/* Обёртка аватарки (есть фото) */
.account-avatar-wrap {
    position: relative; width: 80px; min-width: 80px; height: 80px;
    flex-shrink: 0; border-radius: 4px; overflow: hidden;
}
.account-avatar-img {
    width: 80px; height: 80px;
    object-fit: contain; object-position: center center;
    display: block; border-radius: 4px; 
}

/* Оверлей (появляется при hover или .active для touch) */
.account-avatar-overlay {
    position: absolute; inset: 0;
    display: flex; flex-direction: column;
    opacity: 0; transition: opacity 0.2s;
    pointer-events: none;
}
.account-avatar-wrap:hover .account-avatar-overlay,
.account-avatar-wrap.active .account-avatar-overlay {
    opacity: 1; pointer-events: auto;
}
.account-avatar-action {
    flex: 1; display: flex; align-items: center; justify-content: center;
    font-size: 0.7em; color: #fff; cursor: pointer;
    text-align: center;
}
.account-avatar-action.top  { background: rgba(0,0,0,0.45); }
.account-avatar-action.bottom { background: rgba(180,30,30,0.6); }
.account-avatar-action:hover.top    { background: rgba(0,0,0,0.65); }
.account-avatar-action:hover.bottom { background: rgba(180,30,30,0.85); }

.account-comment-wrap { line-height: 1.5; }

.address-desc-text{font-size:0.7em;color:#555;margin: 8px 0;}
#account-comment-text  {display:block; max-height: 100px; overflow-y: auto;}
/* Мелкие ссылки-действия (изменить, сохранить) */
.link-small {
    font-size: 0.85em;
    color: var(--primary-color);
    text-decoration: underline;
    cursor: pointer;
    white-space: nowrap;
}
.link-small:hover { text-decoration: underline; }

.birka::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 3px;
    background: #f0f0f0;
    border-radius: 50%;
    margin-right: 2px;
    vertical-align: middle;
    border: 1px solid #aaa;
  }
  

.birka { 
    font-size: 0.7em; border-radius: 13px 3px 3px 13px; padding: 3px 7px 3px 2px; vertical-align: middle;text-align:left;
    color: white; display: inline-block; background-color: #999;  width: 40px; cursor: pointer;
} 

/* Цвета бирок по умолчанию (на основе данных из БД) */
.birka.arenda { background-color: limegreen; }
.birka.prodaja { background-color: #999; }
.birka.inactive { background-color: #999; }

/* iOS-стиль чекбоксов с текстом внутри */
.checkbox-ios {
    display: inline-block; height: 24px; margin-right: 0px; position: relative;
    vertical-align: middle; font-size: 14px; user-select: none;
    white-space: nowrap;
}

.checkbox-ios .checkbox-ios-switch {
    position: relative; display: inline-block; box-sizing: border-box; 
    width: 84px; height: 24px; 
    border-radius: 12px; 
    vertical-align: top; background: #999; transition: .3s;
    overflow: hidden; 
    text-align: center;
    line-height: 24px; /* Центрируем текст по вертикали */
    color: white;
    font-size: 7px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    padding-left:18px;
    padding-right:18px;
}

/* Текст справа у выключенного чекбокса */
.checkbox-ios input[type=checkbox]:not(:checked) + .checkbox-ios-switch {
    text-align: right;
}

/* Текст слева у включенного чекбокса */
.checkbox-ios input[type=checkbox]:checked + .checkbox-ios-switch {
    text-align: left;
}

/* Круглый слайдер */
.checkbox-ios .checkbox-ios-switch:before {
    content: ''; position: absolute; top: 2px; left: 2px; display: inline-block; 
    width: 20px; height: 20px; 
    border-radius: 50%; background: white; 
    box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: .25s;
    z-index: 2; /* Поверх текста */
}

.checkbox-ios input[type=checkbox] { 
    display: block; width: 0; height: 0; position: absolute; z-index: -1; opacity: 0; 
}

.checkbox-ios input[type=checkbox]:not(:disabled):active + .checkbox-ios-switch:before { 
    box-shadow: inset 0 0 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .3); 
}

/* Активное состояние - аренда */
.checkbox-ios input[type=checkbox]:checked + .checkbox-ios-switch { 
    /*background: limegreen; */ 
     background: #0c780c;
}

/* Активное состояние - продажа */
.checkbox-ios.prodaja input[type=checkbox]:checked + .checkbox-ios-switch { 
    /*background: #ff5623; */ 
     background: #983518;
}

/* Анимация слайдера */
.checkbox-ios input[type=checkbox]:checked + .checkbox-ios-switch:before { 
    transform: translateX(60px); /* Увеличиваем сдвиг под новую ширину */
}

.checkbox-ios input[type="checkbox"]:not(:disabled) + .checkbox-ios-switch { 
    cursor: pointer; border-color: rgba(0, 0, 0, .3); 
}

.checkbox-ios input[type=checkbox]:disabled + .checkbox-ios-switch { 
    filter: grayscale(70%); border-color: rgba(0, 0, 0, .1); 
}

.checkbox-ios input[type=checkbox]:disabled + .checkbox-ios-switch:before { 
    background: #eee; 
}

.checkbox-ios.focused .checkbox-ios-switch:before { 
    box-shadow: inset 0px 0px 4px #ff5623, 0 2px 8px rgba(0, 0, 0, .2); 
}

/* Обновляем стили для бирок, убираем их, так как текст теперь внутри переключателя */
.checkbox-ios input[type=checkbox]:checked ~ .birka { 
    display: none; /* Скрываем бирки, так как текст теперь в переключателе */
}

.checkbox-ios input[type=checkbox]:checked ~ .birka.prodaja { 
    display: none; /* Скрываем бирки, так как текст теперь в переключателе */
}

/* Стрелки и иконки */
.arrow-photo-container {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    width: 12px;
}
.photo-icon {
    position: static !important;
    right: auto !important;
    top: auto !important;
    transform: none !important;
    width: 14px;
    height: 14px;
    color: #aaa;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1px;
}
.arrow-down {
    position: static;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid grey;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.arrow-down.rotated {
    transform: rotate(180deg); /* ↕ JS: toggleDescription() добавляет .rotated — ui-interactions.js */
}

.mic-button {
    display: none; /* ↕ JS: initializeSpeechRecognition() — voice-input.js */
    position: absolute;
    right: 8px;
    top: 4px;
    width: 27px;
    height: 27px;
    background: none;
    color: #888;
    border: none;
    border-radius: 0;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: none;
    transition: color 0.2s;
    overflow: visible;
    z-index: 10;
    padding: 0;
}
.mic-button svg {
    width: 27px;
    height: 27px;
    display: block;
    position: static;
    top: auto;
    left: auto;
    transform: none;
    stroke: #888;
}
.mic-button:hover,
.mic-button:focus {
    color: #333;
}
.mic-button:hover svg,
.mic-button:focus svg {
    stroke: #333;
}

/* Контейнер для textarea с кнопкой микрофона */
.textarea-with-mic {
    position: relative; /* ↕ JS: нужен для абсолютного позиционирования .save-comment-btn — voice-input.js */
    display: block;
    width: 100%;
}

/* Textarea с отступом справа для кнопки */
.textarea-with-mic textarea {
    width: 100%;
    padding-right: 44px !important;
    box-sizing: border-box;
    overflow: hidden; /* ↕ JS: авто-высота через scrollHeight — voice-input.js */
    resize: none;
    transition: height 0.1s ease;
    min-height: 36px;
}

/* === ДИКТОФОН-ОВЕРЛЕЙ === */
/* Фон-затемнение (только на десктопе видно, на мобиле окно = весь экран) */
.vd-overlay {
    display: none; /* ↕ JS: VoiceDictophone.open() / _close() */
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 10000;
    background: rgba(0,0,0,0.55);
    justify-content: center;
    align-items: center;
}
/* Окно — position:fixed; inset:0, как .slider-container в галерее.
   Так крестик всегда внутри видимого viewport, ничего не уходит под адресную строку. */
.vd-window {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10001;
    /* Отступ под статус-бар/выемку (iOS Notch, Android) */
    padding-top: 0; /* safe-area теперь учитывается в vd-topbar */
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
/* На широких экранах — центрированный модальный блок */
@media (min-width: 600px) {
    .vd-window {
        position: static; /* обычный flex-child внутри overlay */
        width: 100%;
        max-width: 700px;
        max-height: 90vh;
        border-radius: 14px;
        padding: 0;
        box-shadow: 0 8px 40px rgba(0,0,0,0.22);
    }
}
.vd-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    min-height: 56px;
    flex-shrink: 0;
    border-bottom: 1px solid #eee;
    padding-top: env(safe-area-inset-top, 0px);
}
/* Крестик — внутри topbar, без абсолютного позиционирования */
.vd-close {
    background-color: rgba(240, 240, 240, 0.92);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1.3em;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}
.vd-close:hover { background-color: #e0e0e0; }
.vd-editor {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 12px 20px;
    font-size: 1em;
    line-height: 1.6;
    color: #222;
    outline: none;
    word-break: break-word;
    white-space: pre-wrap;
}
.vd-editor:empty:before {
    content: 'Говорите...';
    color: #bbb;
    pointer-events: none;
}
.vd-hint {
    font-size: 0.78em;
    color: #aaa;
    padding: 4px 20px 8px;
    flex-shrink: 0;
    line-height: 1.4;
}
.vd-interim {
    color: #aaa;
    font-style: italic;
}
.vd-status {
    font-size: 1.2em;
    min-height: 22px;
    color: #888;
    flex: 1;
}
.vd-recording {
    color: #e53935;
    animation: vd-pulse 1.2s ease-in-out infinite;
}
.vd-paused { color: #f57c00; }
@keyframes vd-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}
.vd-controls {
    display: flex;
    gap: 8px;
    padding: 12px 16px 16px;
    border-top: 1px solid #eee;
    flex-wrap: wrap;
    flex-shrink: 0;
    background: #fff;
}
.vd-btn {
    flex: 1;
    min-width: fit-content;
    padding: 10px 8px;
    border: none;
    border-radius: 8px;
    font-size: 1.2em;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
}
.vd-btn:disabled { opacity: 0.4; cursor: default; }
.vd-btn-undo  { background: #f0f0f0; color: #555;}
.vd-btn-undo:hover  { background: #e0e0e0; }
.vd-btn-clear { background: #fce4e4; color: #c62828; }
.vd-btn-clear:hover { background: #ffcdd2; }
.vd-btn-pause { background: #fff3e0; color: #e65100; }
.vd-btn-pause:hover { background: #ffe0b2; }
.vd-btn-stop  { background: #e8f5e9; color: #2e7d32; }
.vd-btn-stop:hover  { background: #c8e6c9; }



/* Фотогалерея */
.photo-gallery { display: flex; flex-wrap: wrap; gap: 2px; }
.gallery-photo { height: 50px; cursor: pointer; object-fit: cover; transition: transform 0.2s ease; }
.gallery-photo:hover { transform: scale(1.1); }

/* Контейнер для кнопок добавления с подписями */
.add-button-container {
    display: flex;
    padding: 0px 2px;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    transition: all 0.2s ease;
}

.add-button-container:hover {
    transform: scale(1.1);
}

/* Подписи под кнопками */
.button-caption {
    font-size: 10px;
    color: #666;
    text-align: center;
    font-weight: 500;
    margin-top: -2px;
}

/* Кнопка добавления фото */
.add-photo-button {
    width: 50px;
    height: 50px;
    border: none;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    color: #999;
    margin-bottom: -8px;
}

.add-photo-button:hover {
    color: #666;
}

.add-photo-button svg {
    width: 46px;
    height: 46px;
}

/* Кнопка добавления планов */
.add-plan-button {
    width: 50px;
    height: 50px;
    border: none;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    color: #999;
    margin-bottom: -8px;
}

.add-plan-button:hover {
    color: #666;
}

.add-plan-button svg {
    width: 46px;
    height: 46px;
}

/* Кнопка добавления документов */
.add-doc-button {
    width: 50px;
    height: 50px;
    border: none;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    color: #999;
    margin-bottom: -8px;
}

.add-doc-button:hover {
    color: #666;
}

.add-doc-button svg {
    width: 46px;
    height: 46px;
}

/* Слайдер */
.slider-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8);
    display: none; /* ↕ JS: openSlider() / closeSlider() — photo-gallery.js */
    justify-content: center; align-items: center; flex-direction: column; z-index: 3000;
}
.slider-container img { max-width: 90%; max-height: 80%; object-fit: contain; }
.slider-button {
    position: absolute; top: 50%; transform: translateY(-50%); 
    /*background-color: rgba(255, 255, 255, 0.8);border: none; border-radius: 50%; 
    width: 40px; height: 40px;*/
     cursor: pointer; 
    font-size: 1.5em; 
    display: flex; justify-content: center; align-items: center; z-index: 1001;
}
.slider-button.left { left: 20px; }
.slider-button.right { right: 20px; }
.slider-button:hover { background-color: rgba(255, 255, 255, 1); }
.close-button {
    position: absolute; top: 20px; right: 20px; background-color: rgba(255, 255, 255, 0.8); border: none;
    border-radius: 50%; width: 40px; height: 40px; cursor: pointer; font-size: 1.5em;
    display: flex; justify-content: center; align-items: center;
}
.slider-actions { margin-top: 20px; display: flex; gap: 10px; }
.action-button {
    padding: 10px 20px; background-color: var(--accent-color); color: #fff; border: none;
    border-radius: 5px; cursor: pointer; font-size: 1em;
}
.action-button:hover { background-color: #5599ff; }

/* Уведомления */
#copy_title {
    display: none; /* ↕ JS: shareOrCopy() — ui-interactions.js */
    position: fixed; top: 70px; left: 50%; transform: translateX(-50%);
    justify-content: center; text-align: center;
    background-color: var(--primary-color); color: #fff; padding: 10px; border-radius: 5px; font-size: 1em; z-index: 3000;
}

/* --- Модальные окна --- */
.modal-overlay {
    display: none; /* ↕ JS: CloseModal(), openPloshModal(), openAddressModal(), showPaymentModal() и др. */
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.6);
    z-index: 9999; justify-content: center; align-items: center; backdrop-filter: blur(2px); animation: fadeIn 0.2s ease-out;
}

/*
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}*/
/* Анимация для модального окна - охренительно тормозит в Edge, поэтому убита*/

.modal-window {
    background: #fff; padding: 0; border-radius: 12px; min-width: 400px; max-width: 600px; width: 98vw; 
    max-height: 95vh;
    max-height: 85dvh; /* Динамическая высота — учитывает адресную строку на мобильных */
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); position: relative; display: flex; flex-direction: column;
    animation: slideIn 0.3s ease-out; overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #555 100%); color: #fff; padding: 5px 14px;
    font-size: 1.2em; font-weight: 600; display: flex; align-items: center; justify-content: space-between;
    border-radius: 12px 12px 0 0; margin: 0; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); flex-shrink: 0;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2); border: none; color: #fff; width: 32px; height: 32px; border-radius: 50%;
    font-size: 1.2em; cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: background-color 0.2s ease; margin: 0; padding: 0; flex-shrink: 0;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.3); transform: scale(1.1); }

.modal-body { padding: 15px 28px 28px 28px; flex: 1; overflow-y: auto; min-height: 0;}
.modal-content { padding: 28px; flex: 1; overflow-y: auto; min-height: 0; }

.modal-footer {
    padding: 6px 14px; background: var(--light-bg); border-top: 1px solid var(--border-color);
    display: flex; justify-content: flex-end; gap: 12px; border-radius: 0 0 12px 12px; flex-shrink: 0;
}

.modal-btn {
    background: var(--accent-color); color: #fff; border: none; border-radius: 8px; padding: 10px 20px;
    cursor: pointer; font-size: 0.95em; font-weight: 500; transition: all 0.2s ease; min-width: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.modal-btn:hover { background: #5599ff; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); }
.modal-btn.cancel { background: #e74c3c; color: #fff; white-space: nowrap; }
.modal-btn.cancel:hover { background: #c0392b; }

/* === КОМПАКТНОЕ МОДАЛЬНОЕ ОКНО === */
.modal-compact {
    /*min-width: 480px;*/
    max-width: 600px;
    width: 95vw;
}
.modal-btn:disabled {
    background: #ccc; cursor: not-allowed; box-shadow: none;
}

/* Стили формы в универсальном модальном окне */
#plosh-modal-form, #address-modal-form {
    display: flex; flex-direction: column; gap: 10px; padding: 24px; overflow-y: auto; flex: 1; min-height: 0;
}
#plosh-modal-form .modal-form-row, #address-modal-form .modal-form-row {
    display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px;
}
#plosh-modal-form label, #address-modal-form label {
    flex: 1 1 15%;  display: flex; flex-direction: column; gap: 0px; font-weight: 500;
    color: var(--primary-color); font-size: 0.95em; margin-bottom: 12px;
}
#plosh-modal-form input[type="text"], #address-modal-form input[type="text"], 
#plosh-modal-form select, #address-modal-form select {
    width: 100%; padding: 2px 6px; border: 2px solid var(--border-color); border-radius: 8px; 
    transition: all 0.2s ease; background: #fff; box-sizing: border-box; margin-top: 2px;
    height: 42px; /* ДОБАВЛЯЕМ ФИКСИРОВАННУЮ ВЫСОТУ */
}
#plosh-modal-form input[type="text"]:focus, #address-modal-form input[type="text"]:focus, 
#plosh-modal-form select:focus, #address-modal-form select:focus {
    outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(102, 255, 255, 0.1);
}

/* Стили для чекбоксов в универсальном модальном окне */
#plosh-modal-form .modal-checkbox-group {
    display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid #eee; margin-bottom: 8px;
}
#plosh-modal-form .modal-checkbox-group:last-of-type { border-bottom: none; padding-bottom: 8px; margin-bottom: 16px; }

/* Стили для формы оплаты */
#payment-modal-form {
    display: flex; flex-direction: column; gap: 20px; padding: 24px; overflow-y: auto; flex: 1; min-height: 0;
}

#payment-modal-form input[type="number"] {
    width: 100%; padding: 2px 6px; border: 2px solid var(--border-color); border-radius: 8px; 
    transition: all 0.2s ease; background: #fff; box-sizing: border-box; margin-top: 4px;
    height: 42px;
}

#payment-modal-form input[type="number"]:focus {
    outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(102, 255, 255, 0.1);
}

/* === БЛОК КОМИССИЙ === */
.info-blocks-container {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    flex-direction: row; /* ГОРИЗОНТАЛЬНО! */
}

.info-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 4px;
    border-radius: 4px;
    min-width: 50px;
    min-height: 17.8px;
    font-size: 0.7em;
    border-left: 3px solid;
    flex: 0 0 auto; /* Не растягиваются */
    background-color: #f1f1f1;
}

.commission-rent {
    /* background-color: #e8f5e8; */
    border-color: #0c780c;
    /* color: #2e7d32; */
}

.commission-sale {
    /* background-color: #fff3e0; */
    border-color: #983518;
    /* color: #e65100; */
}

.commission-label {
    font-size: 0.7em;
    font-weight: 500;
    margin-bottom: 1px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
    color:#888;
}

.commission-value {
    font-weight: normal;
    font-size: 0.8em;
    line-height: 1;
    
}




/*

.plosh-content-flex {
    display: flex;
    align-items: center; 
    gap: 1vw;
    flex-wrap: wrap;
    position: relative;
    cursor: pointer;
    padding-left: 19px; 
}

.plosh-area,
.plosh-floor {
    flex: 1 0 13%; 
    font-size: 1.4em;
    order: 1; 
    white-space: nowrap; 
}*/

.metriki {font-size:0.7em;color:#444;}

.plosh-area {
    min-width: fit-content; 
    justify-content: flex-end;
    text-align:right
}

.plosh-floor {
     min-width: 3ch; 
}


/* КОНТЕЙНЕР для всех групп - чтобы они переносились ТОЛЬКО ВМЕСТЕ */
.plosh-content-flex{
    display: flex;
    min-height: 55px;
    flex-wrap: nowrap;
    cursor: pointer;
    position: relative;
    padding-left: 44px; 
    padding-right: 24px; 
    padding-top: 4px;
    padding-bottom: 4px;
    align-items: center; 
    gap: 1.5vh 15vw; 
    justify-content: space-between;
}

.plosh-content-flex > :first-child {font-size:1.5em;white-space: nowrap; }
.plosh-content-flex >:nth-child(2) {min-width:fit-content}

.plosh-groups-container {  
    display: flex;
    flex-wrap:nowrap;
    justify-content: space-between;
    flex: 1 1 25%;
    gap:0.1vw;
}








/* Группы элементов внутри контейнера */
.plosh-checkbox-group,
.plosh-rate-group,
.plosh-commission-group {
    /*flex: 1 1 0; /* Равномерно делят пространство внутри контейнера */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    white-space: nowrap;
}

.plosh-rate-group {min-width: 12ch; /* Убираем ограничения внутри контейнера */}
.plosh-commission-group {min-width: 5ch}



/* Элементы внутри групп */
.plosh-rent-checkbox,
.plosh-rent-rate,
.plosh-rent-commission,
.plosh-sale-checkbox,
.plosh-sale-rate,
.plosh-sale-commission {
    display: flex;
    align-items: center;
    /*justify-content: center;*/
    width: 100%;
    min-height:24px;
}



/* Выравнивание текста по правому краю в ставках и комиссиях 
.plosh-rate-group,
.plosh-commission-group,
.plosh-floor {
     text-align: right; 
    
}*/


.plosh-rent-rate,
.plosh-rent-commission,
.plosh-sale-rate,
.plosh-sale-commission {
    justify-content: flex-end;
}
/*checkpoint*/

@media (max-width: 600px) {
    .plosh-content-flex > :first-child {font-size:1.4em}
    .plosh-content-flex >:nth-child(2) {font-size:0.7em}  
    .plosh-content-flex {
        flex-wrap: wrap;
        gap: 1.5vh 12vw; /* Уменьшаем отступы на мобильных */
        padding-left: 24px; 
    }
    
    
    

}
@media (max-width: 380px) {
    .plosh-groups-container{gap:15vw;}
    .plosh-groups-container{justify-content: flex-start;}
    .plosh-rent-rate,
.plosh-rent-commission,
.plosh-sale-rate,
.plosh-sale-commission {
    justify-content: flex-start;
}

}



/* Кнопка выхода */
.logout-button {
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.3); color: white;
    padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.9em; transition: all 0.2s ease; margin-left: 10px;
}
.logout-button:hover { background: rgba(255, 255, 255, 0.2); border-color: rgba(255, 255, 255, 0.5); }


/* === БОКОВОЕ ВЫДВИЖНОЕ МЕНЮ === */
.slide-menu {
    position: fixed;
    top: 0;
    left: -100%; /* ↕ JS: toggleMenu() добавляет .open → left:0 — ui-interactions.js */
    width: min(280px, 100vw);
    height: 100vh;
    height: 100dvh; /* Новая единица для мобильных браузеров */
    background: #000;
    z-index: 2500;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
}

.slide-menu.open {
    left: 0; /* ↕ JS */
}

/* Оверлей для закрытия меню */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;           /* ↕ JS: toggleMenu() добавляет .show — ui-interactions.js */
    visibility: hidden;   /* ↕ JS */
    transition: all 0.3s ease;
    pointer-events: none; /* ↕ JS */
}

.menu-overlay.show { /* ↕ JS */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Заголовок меню */
.slide-menu-header {
    padding: 16px 20px;
    border-bottom: 1px solid #333;
    background: #111;
    color: white;
    flex-shrink: 0;
    min-height: 56px;
    display: flex;
    align-items: center;
}

.slide-menu-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #fff;
}

/* Контент меню */
.slide-menu-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    /* Скрываем скроллбар но оставляем функциональность */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.slide-menu-content::-webkit-scrollbar {
    display: none;
}



/* Пункты меню */
.slide-menu-item {
    display: block;
    padding: 16px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9em;
    cursor: pointer;
    border-bottom: 1px solid #333;
    transition: background-color 0.2s ease;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
}

.slide-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.slide-menu-item:active {
    background: rgba(255, 255, 255, 0.2);
}

/* Футер меню с кнопкой выхода */
.slide-menu-footer {
    padding: 16px 20px;
    border-top: 1px solid #333;
    background: #111;
    flex-shrink: 0;
}

.slide-menu-logout {
    width: 100%;
    background: #dc3545;
    border: none;
    color: white;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.2s ease;
    border-radius: 6px;
    font-weight: 500;
}

.slide-menu-logout:hover {
    background: #c82333;
}

.slide-menu-logout:active {
    background: #bd2130;
    transform: translateY(1px);
}

/* Служебные пункты меню */
.slide-menu-basic {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 10px 14px;
    border-top: 1px solid #2a2a2a;
    background: #080808;
    flex-shrink: 0;
}

.slide-menu-basic-item {
    color: #666;
    text-decoration: none;
    font-size: 0.75em;
    padding: 3px 6px;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.slide-menu-basic-item:hover {
    color: #aaa;
}

/* === ФОРМЫ В МОДАЛЬНЫХ ОКНАХ === */
.modal-form {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    flex: 1;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
    border-left: 4px solid #ddd;
}

.form-section:nth-child(1) {
    border-left-color: #333; /* Основные параметры */
}

.form-section:nth-child(2) {
    border-left-color: #4caf50; /* Аренда */
}

.form-section:nth-child(3) {
    border-left-color: #ff9800; /* Продажа */
}

.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.form-row {
    display: flex;
    gap: 1vw;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 20px; /* Место для абсолютных подписей */
}


.field-wrapper {
    position: relative;
    flex: 1 1 21%;
/*    min-width: 90px;*/
}


.field-label {
    position: absolute;
    top: -14px;
    left: 2px;
    font-size: 0.85em;
    font-weight: 500;
    color: #333;
    pointer-events: none;
    white-space: nowrap;
}

.field-hint {
    position: absolute;
    bottom: -26px;
    left: 2px;
    font-size: 0.8em !important;
    color: #333;
    white-space: nowrap;
    cursor: pointer;
}

.etaj_hidden {display:none !important}


.form-row input:focus,
.form-row select:focus {
    outline: none;
    border-color: #66f;
    box-shadow: 0 0 0 3px rgba(102, 255, 255, 0.1);
}

/* Тире между этажами - теперь точно по центру */
.floor-separator {
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px; /* Такая же высота как поля */
}

/* === ДИНАМИЧЕСКОЕ СКРЫТИЕ ПОЛЕЙ ПРОДАЖИ === */
/* Убраны неиспользуемые стили .sale-fields.hidden/.visible 
   Теперь используется только inline style="display:flex/none" */


/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    body { margin: 10px auto; max-width: 100%; }
    .info-blocks-container {
        gap: 4px;
    }
    
    .info-block {
        padding: 3px 6px;
        min-width: 50px;
        font-size: 0.65em;
    }
    
    .commission-label {
        font-size: 0.55em;
    }
    
    .commission-value {
        font-size: 0.85em;
    }
}

/* === ИСТОРИЯ ТРАНЗАКЦИЙ === */
.transaction-history-section {
    margin-top: 20px;
}

.transaction-history-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border: 1px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    background: #f9f9f9;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.transaction-history-toggle:hover {
    background: #f0f0f0;
    border-color: #999;
}

.toggle-icon {
    font-size: 1.2em;
    font-weight: bold;
    color: #666;
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(45deg); /* ↕ JS: toggleTransactionHistory() добавляет .rotated — payment.js */
}

.transaction-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 12px;
}

.transaction-tabs .tab {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    background: #f5f5f5;
    color: #666;
    font-weight: 500;
    transition: all 0.2s ease;
}

.transaction-tabs .tab:first-child {
    border-radius: 4px 0 0 0;
}

.transaction-tabs .tab:last-child {
    border-radius: 0 4px 0 0;
}

.transaction-tabs .tab.active {
    background: white;
    color: #333;
    border-bottom-color: #4CAF50;
}

.transaction-tabs .tab:hover:not(.active) {
    background: #eee;
    color: #333;
}

.transaction-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    background: white;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:hover {
    background: #f8f8f8;
}

.transaction-date {
    color: #666;
    font-size: 0.85em;
}

.transaction-amount {
    font-weight: 600;
}

.transaction-amount.positive {
    color: #4CAF50;
}

.transaction-amount.negative {
    color: #f44336;
}

.transaction-list-empty {
    padding: 24px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.transaction-list-loading {
    padding: 24px;
    text-align: center;
    color: #666;
}

/* Кастомный скроллбар для списка транзакций */
.transaction-list::-webkit-scrollbar {
    width: 6px;
}

.transaction-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.transaction-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.transaction-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* === СТИЛИ ПОДПИСОК === */
/* Кнопка подписки */
.subscribe-button {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    border: none;
}

.subscribe-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.subscribe-button:active {
    transform: translateY(0);
}

/* Модал подписки */
.subscribe-modal {
    max-width: 600px;
}

.channel-selection h3 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #333;
}

.channel-group {
    margin: 15px 0;
}

.channel-header {
    display: block;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
    font-weight: 500;
}

.channel-header:hover {
    background: #f0f0f0;
}

.channel-header input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.service-options {
    margin-left: 30px;
    margin-top: 10px;
}

/* Блок существующих подписок */
.existing-subscriptions-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.existing-subscriptions {
    font-size: 0.9em;
    color: #666;
}

.existing-subscriptions strong {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 0.95em;
}

.existing-subscriptions ul {
    margin: 0;
    padding-left: 20px;
    list-style: none;
}

.existing-subscriptions li {
    margin: 5px 0;
    line-height: 1.4;
    padding: 5px 0;
}

.existing-subscriptions li::before {
    content: '•';
    color: #667eea;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* Результат подписки */
.subscription-results {
    padding: 20px;
}

.result-item {
    margin: 15px 0;
    padding: 15px;
    border-radius: 8px;
    background: #f9f9f9;
}

.telegram-result {
    background: #e3f2fd;
    border-left: 4px solid #0088cc;
}

.email-result {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

.webhook-result {
    background: #f3e5f5;
    border-left: 4px solid #9c27b0;
}

.result-item h3 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.1em;
    color: #333;
}

.result-item p {
    margin: 8px 0;
    color: #666;
}

.result-item strong {
    color: #333;
    font-size: 1.2em;
    font-family: monospace;
    background: rgba(0, 0, 0, 0.05);
    padding: 4px 8px;
    border-radius: 4px;
}

.telegram-link {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: #0088cc;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
}

.telegram-link:hover {
    background: #006699;
}

/* === СТИЛИ ДЛЯ ЗАБЛОКИРОВАННЫХ ПОЛЕЙ === */
.field-value {
    padding: 2px 6px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #f0f0f0;
    color: #333;
    font-weight: 500;
    text-align: center;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* Toast-уведомления */
.app-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #323232;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    z-index: 99999;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
}
.app-toast.app-toast--show { opacity: 1; }
.app-toast.app-toast--error { background: #c62828; }