.wpcg-container {
    background: transparent;
    color: #ffffff;
    padding: 0px; margin: 0px;
    width: 100%; max-width: 100% !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    user-select: none; box-sizing: border-box;
}

.wpcg-top-bar {
    display: flex; justify-content: space-between; align-items: center;
    background: #141414; padding: 10px 15px; border-radius: 10px;
    margin-bottom: 20px; border: 1px solid #222; min-height: 54px; box-sizing: border-box;
}
.wpcg-toolbar { display: flex; align-items: center; gap: 15px; transition: 0.2s; }
.wpcg-selected-count { font-size: 13px; color: #ffffff; font-weight: 600; }
.wpcg-btn-action {
    background: #ffffff; color: #000000; border: none; padding: 6px 14px;
    border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 12px;
    display: inline-flex; align-items: center; gap: 6px;
}

.wpcg-view-options { display: flex; gap: 5px; }
.wpcg-size-btn { background: transparent; border: none; color: #555; padding: 6px; cursor: pointer; display: flex; align-items: center; }
.wpcg-size-btn:hover { color: #fff; background: #222; }
.wpcg-size-btn.active { color: #ffffff; background: #222222; }

.wpcg-layout-wrapper { display: table; width: 100%; table-layout: fixed; }
.wpcg-sidebar { display: table-cell; width: 260px; vertical-align: top; background: #141414; padding: 15px; border-radius: 10px; border-right: 1px solid #222; }
.wpcg-main-content { display: table-cell; vertical-align: top; padding-left: 20px; position: relative; }

.wpcg-select-zone { width: 100%; height: 100%; min-height: 400px; position: relative; }
.wpcg-grid { display: grid; padding: 10px; box-sizing: border-box; }

.wpcg-grid.size-small  { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px; }
.wpcg-grid.size-medium { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.wpcg-grid.size-large  { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }

.wpcg-list-size-display { display: none; font-size: 12px; color: #888; margin-right: 15px; white-space: nowrap; }

/* Настройки режима списка остаются неизменными */
.wpcg-grid.size-list { grid-template-columns: 1fr; gap: 6px; padding: 6px 10px; }
.wpcg-grid.size-list .wpcg-file-card { display: flex; align-items: center; height: 38px; border-radius: 6px; }
.wpcg-grid.size-list .wpcg-preview-box { width: 38px; height: 38px; border-radius: 6px 0 0 6px; flex-shrink: 0; }
.wpcg-grid.size-list .wpcg-file-info { flex-grow: 1; height: 100%; background: transparent; padding: 0 12px; border: none; display: flex; justify-content: space-between; align-items: center; }
.wpcg-grid.size-list .wpcg-file-name { flex-grow: 1; text-align: left; max-width: 65%; }
.wpcg-grid.size-list .wpcg-list-size-display { display: block; margin-left: auto; }
.wpcg-grid.size-list .wpcg-file-icon-box { font-size: 9px; padding: 3px 5px; }
.wpcg-grid.size-list .wpcg-video-badge { display: none; }
.wpcg-grid.size-list .wpcg-svg-folder-icon,
.wpcg-grid.size-list .wpcg-grid-folder-icon { width: 16px; height: 16px; }

.wpcg-sidebar-title { font-size: 11px; text-transform: uppercase; color: #555; letter-spacing: 1px; margin-bottom: 12px; font-weight: 700; }
.wpcg-tree-node { margin-bottom: 2px; }
.wpcg-tree-item { display: flex; align-items: center; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #aaa; position: relative; }
.wpcg-tree-item:hover { background: #222; color: #fff; }
.wpcg-tree-item.active { background: rgba(255, 255, 255, 0.1); color: #ffffff; font-weight: 600; }
.wpcg-tree-toggle { color: #ffffff; font-size: 9px; width: 14px; display: inline-block; text-align: center; opacity: 0; margin-right: 4px; transition: transform 0.15s; }
.wpcg-tree-toggle.has-children { opacity: 0.6; }
.wpcg-tree-toggle.collapsed { transform: rotate(-90deg); }
.wpcg-tree-icon { display: inline-flex; align-items: center; margin-right: 6px; }

/* Кастомная SVG-иконка папки в дереве */
.wpcg-svg-folder-icon { width: 16px; height: 16px; object-fit: contain; vertical-align: middle; }

/* Кастомная SVG-иконка папки в сетке миниатюр */
.wpcg-grid-folder-icon { width: 48px; height: 48px; object-fit: contain; }
.wpcg-grid.size-small .wpcg-grid-folder-icon { width: 36px; height: 36px; }
.wpcg-grid.size-large .wpcg-grid-folder-icon { width: 64px; height: 64px; }

.wpcg-btn-download-placeholder { width: 24px; flex-shrink: 0; }

.wpcg-lasso-box { position: absolute; background: rgba(255, 255, 255, 0.08); border: 1px dashed #ffffff; pointer-events: none; z-index: 9999; }
.wpcg-file-card { background: #161616; border-radius: 10px; overflow: hidden; position: relative; border: 1px solid transparent; transition: border-color 0.15s, background-color 0.15s; cursor: default; user-select: none; -webkit-user-drag: none; }
.wpcg-file-card:hover { border-color: #666666; }
.wpcg-file-card.selected { border-color: #ffffff; background: #1f1f1f; }

.wpcg-preview-box { width: 100%; height: 160px; background: #0b0b0b; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; border-radius: 10px 10px 0 0; user-select: none; -webkit-user-drag: none; }
.wpcg-grid.size-small .wpcg-preview-box { height: 100px; }
.wpcg-grid.size-medium .wpcg-preview-box { height: 150px; }
.wpcg-grid.size-large .wpcg-preview-box { height: 220px; }

.wpcg-thumb-img { width: 100%; height: 100%; object-fit: cover; user-select: none !important; -webkit-user-drag: none !important; pointer-events: none; }
.wpcg-preview-box static-file { background: #1a1a1a; }
.wpcg-file-icon-box { font-size: 16px; font-weight: 800; color: #777; background: #252525; padding: 8px 12px; border-radius: 6px; border: 1px solid #333; }

/* Кастомная SVG-иконка видео на миниатюрах */
.wpcg-video-badge { position: absolute; width: 24px; height: 24px; object-fit: contain; bottom: 8px; right: 8px; z-index: 2; }
.wpcg-grid.size-small .wpcg-video-badge { width: 18px; height: 18px; bottom: 6px; right: 6px; }
.wpcg-grid.size-large .wpcg-video-badge { width: 32px; height: 32px; bottom: 12px; right: 12px; }

/* Сокращение расстояния между названием и кнопкой скачать на миниатюрах в 2.5 раза */
.wpcg-file-info { padding: 10px 12px; display: flex; justify-content: flex-start; align-items: center; gap: 8px; background: #131313; position: relative; }
.wpcg-file-name { font-size: 12px; color: #999; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80%; }

.wpcg-btn-download { background: transparent !important; display: inline-flex; align-items: center; justify-content: center; border: none !important; opacity: 0; transition: opacity 0.15s; width: 24px; height: 24px; flex-shrink: 0; margin-left: 0; }
.wpcg-btn-download svg { stroke: #ffffff !important; fill: none !important; }
.wpcg-file-card:hover .wpcg-btn-download { opacity: 1; }
.wpcg-empty { color: #444; text-align: center; grid-column: 1/-1; padding: 40px 0; font-size: 13px; }

/* Дерево папок: кнопки скачивания */
.wpcg-tree-folder-dl { position: absolute; right: 8px; display: inline-flex; align-items: center; justify-content: center; background: transparent !important; opacity: 0; cursor: pointer; transition: opacity 0.15s, transform 0.1s; width: 20px; height: 20px; }
.wpcg-tree-folder-dl svg { stroke: #ffffff !important; fill: none !important; }
.wpcg-tree-item:hover .wpcg-tree-folder-dl { opacity: 0.5; }
.wpcg-tree-folder-dl:hover { opacity: 1 !important; transform: scale(1.15); }
.wpcg-tree-children { padding-left: 14px; border-left: 1px solid #222; margin-left: 10px; display: block; }

/* Lightbox Styles */
.wpcg-lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(5, 5, 5, 0.5) !important; backdrop-filter: blur(4px); z-index: 999999; display: flex; align-items: center; justify-content: center; }
.wpcg-lightbox-content { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 80px 40px 40px 40px; box-sizing: border-box; }
.wpcg-lightbox-media { width: 100%; height: 100%; max-width: 100vw; max-height: 100vh; object-fit: contain; z-index: 1000000; }

.wpcg-lightbox-top-header { position: absolute; top: 0; left: 0; width: 100%; height: 60px; background: transparent; display: flex; align-items: center; justify-content: center; padding: 0 240px; box-sizing: border-box; pointer-events: none; z-index: 100004; }
.wpcg-lightbox-title-text { color: #ffffff; font-size: 15px; font-weight: 500; text-shadow: 0 2px 4px rgba(0,0,0,0.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.wpcg-lightbox-controls { position: absolute; top: 15px; right: 25px; display: flex; align-items: center; gap: 24px; z-index: 1000020; }
.wpcg-lightbox-select-label { display: inline-flex; align-items: center; cursor: pointer; width: 24px; height: 24px; position: relative; }
.wpcg-lightbox-chk { position: absolute; opacity: 0; width: 0; height: 0; }
.wpcg-custom-chk-visual { width: 20px; height: 20px; border: 2px solid #ffffff; border-radius: 4px; background: transparent; transition: background 0.1s, border-color 0.1s; display: inline-block; }
.wpcg-lightbox-chk:checked + .wpcg-custom-chk-visual { background: #ffffff; }
.wpcg-lightbox-chk:checked + .wpcg-custom-chk-visual::after { content: ""; position: absolute; left: 8px; top: 4px; width: 5px; height: 10px; border: solid #000000; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }

.wpcg-lightbox-dl-btn { display: inline-flex; align-items: center; justify-content: center; background: transparent; width: 28px; height: 28px; cursor: pointer; opacity: 0.8; transition: opacity 0.15s; }
.wpcg-lightbox-dl-btn:hover { opacity: 1; }
.wpcg-lightbox-dl-btn svg { stroke: #ffffff !important; fill: none !important; }

.wpcg-lightbox-close { color: #ffffff !important; font-size: 42px; font-weight: 200; cursor: pointer; line-height: 1; opacity: 0.8; transition: opacity 0.15s, transform 0.1s; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.wpcg-lightbox-close:hover { opacity: 1; transform: scale(1.1); }

.wpcg-lightbox-btn { position: absolute; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,0.3); font-size: 64px; cursor: pointer; padding: 20px; z-index: 1000008; }
.wpcg-lightbox-btn:hover { color: #fff; }
.wpcg-lightbox-prev { left: 10px; }
.wpcg-lightbox-next { right: 10px; }