/* --- ОСНОВНЫЕ СТИЛИ --- */
:root {
    --click-x: 50%;
    --click-y: 50%;
    --primary-color: #4A90E2;
    /* --primary-color: ##3498db; */
    --secondary-color: #646669;
    --secondary: #2ecc71;
    /* --danger: #e74c3c;  */
    --danger-color: #ff4d4d; 
    --cancel-color: #373839;
    --bg: #f0f2f5;

/* смена темы */
    /* Светлая тема */
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.3);
    --text-main: #2c3e50;
    --text-sub: #7f8c8d;
    --card-bg: rgba(255, 255, 255, 0.8);
    --input-bg: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] {
    /* Темная тема */
    --bg-gradient: linear-gradient(135deg, #1a1c20 0%, #0f1013 100%);
    --glass-bg: rgba(30, 32, 35, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ecf0f1;
    --text-sub: #bdc3c7;
    --card-bg: rgba(40, 44, 52, 0.8);
    --input-bg: rgba(255, 255, 255, 0.05);
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    background: #f0f2f5;
}

/* Применяем переменные к существующим классам */
body, #pages-slider { background: var(--bg-gradient); color: var(--text-main); }

/* Убираем стрелочки (spinners) у input type="number" */
/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}
/* Firefox */
input[type="number"] {
    -moz-appearance: textfield;
}

button { cursor: pointer; border: none; font-weight: bold; border-radius: 6px; }

label { font-size: 11px; font-weight: bold; margin-bottom: 2px; display: block; }

/* ВЫНОС ИЗ СТИЛЕЙ КАТАЛОГА И ШАР*/
/* БЛОК КОМБИНИРОВАННЫХ ПОЛЕЙ ПОИСКА: СОСКАНЕРОМ И ВСТРОЕННОЙ КНОПКОЙ ПОИСКА */
.search-group {
    position: relative;
    display: flex;
    width: 100%;
    max-width: 600px; /* Ограничитель, чтобы на десктопе не было слишком длинным */
    height: 50px;  /* Фиксированная высота для симметрии */
    transition: transform 0.3s ease;
    z-index: 999;
}
/* Эффект легкого увеличения при фокусе */
.search-group.focused {
    transform: scale(1.02);
}

.search-field {
    flex-grow: 1;  /* Поле занимает все свободное место */
    margin: 0;
    padding: 0 20px;
    font-size: 16px;
    border: 2px solid #3498db;
    border-right: none; /* Убираем правую границу, чтобы "склеить" с кнопкой */
    border-radius: 25px 0 0 25px; /* Скругляем только левые углы */
    outline: none;
    transition: box-shadow 0.3s ease;
}

.search-input {
    text-align: center;
    border-radius: 0% !important;
}

.group-field-left {
    padding-left: 50px !important;
    text-align: center;
}

/* Кнопка сканера (внутри слева) */
/* .scanner-btn {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #3498db;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    z-index: 2;
    transition: all 0.2s ease;
    border-radius: 50%;
    max-width: 50px;
}

.scanner-btn:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: #2980b9;
}

.scanner-btn svg {
    width: 22px;
    height: 22px;
} */



/* Кнопка поиска (справа) */
.search-action {
    /* background-color: #3498db; */
    background-color: var(--input-bg);
    border: 2px solid #3498db;
    border-radius: 0 25px 25px 0;
    width: 65px;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    /* transition: background-color 0.2s ease, border-color 0.2s ease; */
}

.search-action svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-main);
    transition: transform 0.2s ease;
}

/* .search-action:hover {
    background-color: #2980b9;
    border-color: #2980b9;
} */

.search-action:hover svg{
    transform: scale(1.2);
}

.search-action:active {
    transform: scale(0.95);
    /* background-color: #1c5982; */
    color: #3498db;
}

/* .search-field:focus {
    box-shadow: inset 0 0 5px rgba(52, 152, 219, 0.2);
} */


@media (max-width: 600px) {
    .search-group {
        height: 54px; /* Увеличиваем высоту для удобства тапа */
        max-width: 100%; /* Убираем ограничения по ширине */
    }

    .search-field {
        font-size: 18px; /* Крупный текст, чтобы не щуриться */
        padding: 0 15px;
    }

    .search-action {
        width: 70px; /* Кнопка чуть шире для уверенного нажатия пальцем */
    }

    /* Убираем эффект hover для сенсорных экранов (он там не нужен) */
    .search-action:hover {
        /* background-color: #3498db; */
        transform: scale(1);
    }
    
    /* Оставляем только эффект при реальном нажатии */
    .search-action:active {
        /* background-color: #1c5982; */
        transform: scale(0.95);
        color: #3498db;
    }
}


/* Слой размытия и затемнения */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Полупрозрачный черный */
    backdrop-filter: blur(8px);    /* Эффект размытия */
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998; /* Чуть ниже самого поиска */
    }

/* Когда поиск активен */
.search-overlay.active {
    opacity: 1;
    visibility: visible;
}
/* ---------------------------- */





/* --- SPLASH SCREEN --- */
#splash-screen {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.6s ease-out;
}

.splash-content { text-align: center; }

#splash-text, #app-name {
    font-family: 'Georgia', serif;
    transition: opacity 0.5s ease-in-out;
}

#splash-text { font-size: 1.2rem; color: #7f8c8d; }
#app-name { font-size: 3rem; font-weight: bold; color: #2c3e50; letter-spacing: 2px; }

/* .hidden { display: none; opacity: 0; } */
.fade-in { opacity: 1; animation: fadeIn 0.8s ease-in; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.splash-footer { position: absolute; bottom: 30px; font-size: 0.8rem; color: #bdc3c7; }

/* --- АВТОРИЗАЦИЯ (ЦЕНТРИРОВАНИЕ) --- */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.auth-card {
    width: 85%;
    max-width: 380px;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    border-radius: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

input, select, textarea {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    border: 1px solid var(--glass-border); 
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-main); 
    box-sizing: border-box;
    font-size: 1rem;
}
textarea {
    resize: none;
}

select option {
    background: var(--glass-bg);
    color: var(--text-main);
}

/* Общие стили для кнопок */
/* .btn {
    display: inline-flex;
} */

/* .btn {
    flex: 1;             Кнопки делят пространство поровну 50/50
    display: inline-flex;
    gap: 10px;
} */

.btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 30px;
    border: none;
    outline: none;
    font-size: 15px;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-top: 15px;
    white-space: nowrap; /* Запрещаем перенос текста */
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(74, 144, 226, 0.3);
    transition: all 0.2s ease;
}

.btn-main {
    background: var(--primary-color);
}

.btn-sub {
    background: var(--secondary-color);
}







/* --- СЛАЙДЕР СТРАНИЦ --- */
#pages-slider {
    display: flex;
    width: 100%;
    /* height: 100vh; */
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    /* background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); */
    touch-action: pan-y; /* Позволяет браузеру обрабатывать вертикальный скролл, но оставляет горизонтальный нам */
    will-change: transform;
}

.app-page {
    min-width: 100vw;
    height: 95vh;
    overflow-y: scroll; /* Изменено с auto на scroll для стабильности */
    -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
    box-sizing: border-box;
    position: relative;
    transition: transform 0.6s, opacity 0.6s;
}

.page-scaling {
    transform: scale(0.9) !important;
    opacity: 0.6;
}

/* --- DASHBOARD (СТЕКЛЯННЫЕ БЛОКИ) --- */
.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 30px 20px;
}

.menu-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-card:active { transform: scale(0.96); background: rgba(255,255,255,0.6); }

.menu-card .icon { font-size: 2.2rem; margin-right: 20px; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.1)); }
.menu-card .text { font-size: 1.2rem; font-weight: 600; color: #2c3e50; }

/* --- ФОРМА СТЕЛЛАЖЕЙ --- */
.glass-content {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.search-row { display: flex; gap: 10px; }
.coord-row { display: flex; gap: 10px; }
.form-buttons { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 15px; 
    position: relative;
    z-index: 10;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-glass.highlight { background: rgba(74, 144, 226, 0.2); color: #2980b9; }

/* --- КАРТОЧКИ ИСТОРИИ --- */
/* .history-container { margin-top: 25px; } */
.shelf-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 10px;
    border-left: 5px solid var(--primary-color);
}

/* --- КАРТА В DIALOG --- */
dialog#map-dialog {
    width: 100vw; height: 100vh;
    max-width: 100vw; max-height: 100vh;
    border: none; padding: 0; margin: 0;
    clip-path: circle(0% at var(--click-x) var(--click-y));
    transition: clip-path 0.7s cubic-bezier(0.19, 1, 0.22, 1);
    background: #fff;
    z-index: 10001;
}

dialog#map-dialog[open] {
    clip-path: circle(150% at var(--click-x) var(--click-y));
}

#map { width: 100%; height: 100%; }

.dialog-header { position: absolute; top: 15px; right: 15px; z-index: 2000; }
.close-btn {
    background: rgba(0,0,0,0.3); border: none; color: white;
    font-size: 28px; width: 45px; height: 45px; border-radius: 50%;
    backdrop-filter: blur(5px); cursor: pointer;
}

.map-controls {
    position: absolute; bottom: 30px; left: 50%;
    transform: translateX(-50%); z-index: 2000;
    width: 80%;
}

.map-float-btn { width: 100%; padding: 15px; font-size: 1rem; }

/* --- FOOTER --- */
footer {
    position: fixed; bottom: 10px; width: 100%;
    text-align: center; font-size: 1rem; color: var(--text-main);
    pointer-events: none;
}

.loader-text { font-size: 0.8rem; margin: 5px 0; min-height: 1.2rem; }




 /* Стили для работы с картой */
.leaflet-popup-content button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 8px;
    margin-top: 5px;
    cursor: pointer;
    width: 100%;
}

.btn-select-map {
    background: #4A90E2;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.3);
    width: 100%;
    margin-top: 5px;
    font-family: inherit;
}

.btn-select-map:active {
    transform: scale(0.95);
    background: #357ABD;
}

/* Стилизация текста внутри балуна Leaflet */
.leaflet-popup-content-wrapper {
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
}





.books-header { display: flex; justify-content: space-between; align-items: center; }
.filter-tabs { display: flex; gap: 10px; margin: 15px 0; }
.tab { 
    flex: 1; padding: 8px; border-radius: 10px; border: none; 
    background: rgba(255,255,255,0.3); cursor: pointer; 
}
.tab.active { background: var(--primary-color); color: white; }

.book-item.taken .status-dot { background: #4cd137; } /* Зеленый - взял себе */
.book-item.given .status-dot { background: #fbc531; } /* Желтый - оставил на полке */
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 10px; }

#interactive.viewport { width: 100%; height: 250px; overflow: hidden; border-radius: 15px; }
#interactive.viewport canvas, video { width: 100%; height: auto; }





.profile-header { text-align: center; margin-bottom: 25px; }
.avatar-circle {
    width: 80px; height: 80px; background: var(--primary-color);
    color: white; border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    font-size: 2rem; font-weight: bold; margin: 0 auto 10px;
    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.3);
}
.user-stats { font-size: 0.9rem; color: #666; }
.field-label {
    display: block; text-align: left; font-size: 0.8rem;
    color: #888; margin: 10px 0 -5px 5px;
}
.push-settings .btn-sub { font-size: 0.9rem; text-decoration: underline; }









.avatar-upload-container { text-align: center; margin-bottom: 20px; }
.avatar-preview {
    width: 100px; height: 100px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: rgba(74, 144, 226, 0.1);
    border: 2px dashed var(--primary-color);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden;
    background-size: cover; background-position: center;
}
#avatar-placeholder { font-size: 2rem; color: var(--primary-color); }
.error-text { margin-top: -5px; margin-bottom: 10px; font-weight: bold; }








/* Кастомный чекбокс */
.glass-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    color: #2c3e50;
}

.glass-checkbox input { display: none; }

.checkmark {
    width: 20px; height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 6px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s;
}

.glass-checkbox input:checked + .checkmark {
    background: var(--primary-color);
}

.glass-checkbox input:checked + .checkmark:after {
    content: '✓';
    position: absolute;
    color: white;
    left: 4px; top: -2px;
}

/* Публичная карточка владельца */
.public-profile-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid rgba(255,255,255,0.5);
}

.mini-avatar {
    width: 50px; height: 50px;
    border-radius: 50%;
    background-size: cover;
}














/* Заголовки страниц */
.glass-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    transition: opacity 0.3s;
}

#header-title {
    font-family: 'Georgia', serif;
    font-size: 1.4rem;
    color: #2c3e50;
    margin: 0;
    letter-spacing: 1px;
}

/* Скрываем хедер на странице авторизации */
.header-hidden {
    display: none;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    padding: 10px;
    cursor: pointer;
    /* color: #2c3e50; */
    color: var(--text-main);;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s, transform 0.2s;
}

.nav-btn:active { transform: translateY(-50%) scale(0.9); }
.nav-btn.left { left: 10px; }
.nav-btn.right { right: 10px; }

/* Скрытие кнопки назад на главной */
.nav-hidden { 
    opacity: 0; 
    pointer-events: none; 
}

/* Индикатор уведомлений */
.badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ff4757;
    border-radius: 50%;
    border: 2px solid white;
    display: none; /* Появляется, когда есть данные */
}

.badge.active { display: block; }

/* Добавляем отступ сверху для страниц, чтобы заголовок их не закрывал */
.app-page {
    padding-top: 70px; /* Высота хедера + запас */
}





.glass-header, .menu-card, .glass-content, .btn-glass {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border) !important;
    color: var(--text-main);
}

#header-title, .menu-card .text, .field-label { color: var(--text-main); }

/* Инверсия иконок карты для темной темы */
[data-theme="dark"] .leaflet-tile { filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%); }

/* Модальное окно подтверждений */
/* Фон затемнения */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none; /* Скрыто по умолчанию */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    z-index: 10000;
}
/* Контент окна */

.modal-content {
    background: var(--bg-gradient);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease;
    overflow: hidden;
}
@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-buttons {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}
/* Кнопки */
.btn-confirm, .btn-cancel {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}
.btn-confirm { background: var(--danger-color); color: white; }
.btn-cancel { background: var(--secondary-color); }

.modal-icon {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    /* Легкая пульсация для привлечения внимания (опционально) */
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
/* Сделаем текст вопроса чуть крупнее и жирнее */
.modal-content p {
    font-size: 18px;
    margin: 0 0 20px 0;
    color: var(--text-main);
    font-family: sans-serif;
}



/* Общие классы для catalog и book модулей */
.share-container { 
    background: var(--glass-bg); border: 1px solid var(--glass-bg); border-top: none; border-radius: 0 0 8px 8px;
    overflow: hidden; max-height: 0; opacity: 0; padding: 0 15px;
    transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.3s ease;
}
.share-container.open { max-height: 1500px; opacity: 1; padding: 15px; margin-bottom: 10px; }
.share-grid { display: grid; grid-template-columns: 1fr 1fr 1fr auto; align-items: stretch; gap: 8px; margin-top: 10px; }
/* Модальный сканер */
.modal-scanner { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); display: none; align-items: center; justify-content: center;  z-index: 10000;}
/* .modal-content { width: 90%; max-width: 500px; background: #000; border-radius: 15px; position: relative; overflow: hidden; } */
.close-scanner { position: absolute; top: 15px; right: 15px; background: var(--danger-color); color: white; width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer; font-weight: bold; z-index: 10001; }
.scanner-hint { position: absolute; bottom: 20px; width: 100%; text-align: center; color: white; font-weight: bold; text-shadow: 0 1px 4px #000; z-index: 10001; }
/* Сканеры */
.search-wrapper { position: relative; display: flex; align-items: center; gap: 10px; }
.btn-scan { background: #eee; border: none; border-radius: 6px; padding: 10px; cursor: pointer; font-size: 1.5rem; }
#global-reader { width: 100%; border-radius: 8px; overflow: hidden; margin-top: 10px; display: none; }
/* Вспышка */
/* #flash-effect { position: fixed; top:0; left:0; width:100%; height:100%; background:white; opacity:0; pointer-events:none; z-index: 2; } */
#flash-effect { position: fixed; top:0; left:0; width:100%; height:100%; background:white; opacity:0; pointer-events:none; z-index:9999; }
#flash-effect.active { opacity: 0.8; transition: none; }
/* Форма редактора */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; padding-bottom: 3rem; }
.full-width { grid-column: span 2; }
input, select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; font-size: 14px; transition: 0.3s; }
input.error { border-color: var(--danger-color); background: #fff5f5; }
/* ИЗбранное и история поиска*/
.sm-list-container { display: flex; gap: 10px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.sm-list-item { 
    position: relative; width: 150px; overflow: visible; transition: opacity 0.4s ease, transform 0.4s ease;
    flex: 0 0 100px; background: var(--input-bg); padding: 5px; border-radius: 8px; border: 1px solid #ddd; 
    text-align: center; cursor: pointer; }
.sm-list-item img { width: 100%; height: 70px; object-fit: contain; }
.sm-list-item div { font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }


/* Зона Обложки */
#cover-area { width: 140px; height: 190px; margin: 0 auto 15px; position: relative; border: 2px dashed #ccc; border-radius: 8px; background: #fafafa; overflow: hidden; }
#book-cover-img { width: 100%; height: 100%; object-fit: contain; display: none; background: white; }
#add-photo-btn { width: 60px; height: 60px; border-radius: 50%; border: 2px dashed var(--primary-color); background: #fff; cursor: pointer; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--primary-color); z-index: 2; }
#change-photo-btn { display: none; position: absolute; bottom: 0; width: 100%; background: rgba(0,0,0,0.6); color: white; border: none; padding: 6px; font-size: 10px; cursor: pointer; font-weight: bold; z-index: 3; }


/* Список и Аккордеон */
.list-item { background: var(--input-bg); transition: 0.3s; border-left: 5px solid transparent; box-shadow: 0 2px 5px rgba(0,0,0,0.05); border-radius: 8px; }
.list-item.selected { border-left-color: var(--primary-color); background: var(--glass-bg); }

/* Список и Аккордеон */
.book-item { display: flex; align-items: center; padding: 12px; background: var(--glass-bg); border-radius: 8px; margin-top: 10px; transition: 0.3s; border-left: 5px solid transparent; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.book-item-info { cursor: pointer; }
.book-item.selected { border-left-color: var(--primary-color); 
    /* background: #eef7ff;  */
    background: var(--glass-bg); 
}
.book-item img { cursor: pointer; width: 45px; height: 65px; object-fit: cover; border-radius: 4px; margin-right: 12px; }




