  /* =========================================
           СТИЛИ ОВЕРЛЕЯ И ФОТОАЛЬБОМА
           ========================================= */
        
        .album-overlay {
            width: 100%;
            height: 100%;
            /*background-color: #ffffff;*/
            z-index: 1000;
            overflow-y: auto;
            box-sizing: border-box;
        }

        .album-header {
            position: sticky;
            top: 0;
            background: #ffffff;
            padding: 16px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #e5e7eb;
            z-index: 10;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }

        .album-title {
            margin: 0;
            font-size: 18px;
            font-weight: bold;
        }

        .btn-close {
            background: none;
            border: none;
            font-size: 28px;
            line-height: 1;
            color: #6b7280;
            cursor: pointer;
            padding: 0 8px;
            transition: color 0.2s;
        }

        .btn-close:hover {
            color: #ef4444;
        }

        .album-controls {
            padding: 20px;
            text-align: center;
        }

        .upload-label {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            background-color: #fbbf24;
            color: #000000;
            padding: 12px 24px;
            border-radius: 8px;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.2s, transform 0.1s;
            box-shadow: 0 2px 4px rgba(251, 191, 36, 0.3);
        }

        .upload-label:hover { background-color: #f59e0b; }
        .upload-label:active { transform: scale(0.98); }
        .upload-input { display: none; }

        .gallery-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
            gap: 12px;
            padding: 0 20px 20px 20px;
        }

        /* =========================================
           КАРТОЧКА ФОТО И НОВЫЕ ЭЛЕМЕНТЫ УПРАВЛЕНИЯ
           ========================================= */
        .photo-card {
            position: relative;
            aspect-ratio: 1 / 1;
            border-radius: 8px;
            overflow: hidden;
            background-color: #f3f4f6;
            border: 1px solid #e5e7eb;
            box-shadow: 0 1px 3px rgba(0,0,0,0.05);
            transition: opacity 0.3s;
        }

        .photo-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: opacity 0.3s ease;
            cursor: pointer;
        }

        .photo-img.is-uploading {
            opacity: 0.4;
            filter: grayscale(50%);
        }

        /* Кнопка удаления (крестик) */
        .btn-delete {
            position: absolute;
            top: 4px;
            right: 4px;
            background: rgba(255, 255, 255, 0.9);
            color: #ef4444;
            border: 1px solid #fecaca;
            border-radius: 6px;
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 10;
            font-size: 18px;
            line-height: 1;
            padding-bottom: 2px; /* Выравнивание символа × */
            transition: all 0.2s;
        }

        .btn-delete:hover {
            background: #fee2e2;
            color: #dc2626;
        }

         /* Плашка "Внутреннее фото" */
        .internal-badge {
            position: absolute;
            bottom: 4px;
            left: 4px;
            right: 4px;
            background: rgba(255, 255, 255, 0.95);
            padding: 6px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 6px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
            z-index: 10;
            cursor: pointer;
            border: 1px solid #e5e7eb;
        }
        
        .internal-badge input {
            margin: 0;
            cursor: pointer;
            /* Форсируем отображение стандартного чекбокса, перебивая глобальные стили проекта */
            display: inline-block !important;
            width: 14px !important;
            height: 14px !important;
            opacity: 1 !important;
            visibility: visible !important;
            -webkit-appearance: checkbox !important;
            appearance: checkbox !important;
            flex-shrink: 0;
        }

        .internal-badge:hover {
            background: #ffffff;
            border-color: #d1d5db;
        }

        /* Лоадеры и ошибки */
        .loading-overlay {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            pointer-events: none;
            z-index: 5;
        }

        .spinner {
            width: 24px;
            height: 24px;
            border: 3px solid rgba(0,0,0,0.1);
            border-radius: 50%;
            border-top-color: #3b82f6;
            animation: spin 1s linear infinite;
            margin-bottom: 4px;
        }

        .loading-text {
            font-size: 11px;
            font-weight: 600;
            color: #1f2937;
            text-shadow: 0 0 4px rgba(255,255,255,0.8);
        }

        .error-overlay {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: rgba(254, 226, 226, 0.8);
            color: #dc2626;
            font-size: 12px;
            font-weight: bold;
            text-align: center;
            padding: 4px;
            z-index: 5;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* =========================================
           ЛАЙТБОКС (ПОЛНОЭКРАННОЕ ФОТО)
           ========================================= */
        .lightbox-overlay {
            display: none;
            position: fixed;
            top: 0; left: 0; width: 100%; height: 100%;
            background-color: rgba(0, 0, 0, 0.85);
            z-index: 9999;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(5px);
        }

        .lightbox-img {
            max-width: 90%;
            max-height: 90vh;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.5);
            object-fit: contain;
        }

        .lightbox-close {
            position: absolute;
            top: 20px;
            right: 20px;
            background: none;
            border: none;
            color: #fff;
            font-size: 40px;
            cursor: pointer;
            line-height: 1;
            padding: 10px;
            transition: color 0.2s;
        }

        .lightbox-close:hover {
            color: #fbbf24;
        }
        
        
        
        
        
        
.photo-add-btn-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px; /* Высота становится небольшой, комфортной для пальца */
    background-color: #f9fafb; /* Мягкий фон */
    border: 1px dashed #cbd5e1; /* Пунктирная рамка показывает зону для дропа/нажатия */
    border-radius: 12px;
    color: var(--primary-blue);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
  }

  .photo-add-btn-compact svg {
    margin-right: 8px;
  }

  .photo-add-btn-compact:active {
    background-color: #eff6ff;
    border-color: var(--primary-blue);
    transform: scale(0.98);
  }
  
  
  
  
/* =========================================
     СОСТОЯНИЕ 1: ЕСТЬ ФОТОГРАФИИ (Карусель)
     ========================================= */
  .photo-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 10px 20px 20px 0px; 
    scrollbar-width: none; 
    -ms-overflow-style: none; 
    scroll-snap-type: x mandatory; 
  }

  .photo-carousel::-webkit-scrollbar {
    display: none; 
  }

  .photo-item {
    flex-shrink: 0;
    width: 84px;
    height: 84px;
    border-radius: 12px;
    scroll-snap-align: start;
    position: relative;
  }

  .photo-add-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f9fafb;
    border: 2px dashed #cbd5e1;
    color: var(--primary-blue);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
    box-sizing: border-box;
  }

  .photo-add-btn:active {
    background-color: #f1f5f9;
    border-color: var(--primary-blue);
    transform: scale(0.96);
  }

  .photo-add-btn span {
    font-size: 11px;
    font-weight: 500;
    margin-top: 6px;
    color: var(--text-secondary);
  }

  .photo-thumbnail {
    background-color: #e5e7eb; 
    overflow: hidden;
    cursor: pointer;
    border: 1px solid #f3f4f6;
  }

  .photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: block;
  }

  .photo-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background-color: #ffffff;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
  }
  
  
  
.photo-badge-creator{
    position: absolute; 
    top: 4px; 
    left: 4px; 
    background: rgba(0,0,0,0.6); 
    color: white; 
    font-size: 10px; 
    padding: 2px 6px; 
    border-radius: 4px; 
    z-index: 5; 
    pointer-events: none;
}