/* ===== GalleryPlus - Chevereto-style gallery ===== */

.galleryplus {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* --- Header --- */
.galleryplus-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 24px;
    gap: 16px;
}

.galleryplus-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
}

/* --- Breadcrumbs --- */
.galleryplus-breadcrumbs {
    margin-bottom: 12px;
    font-size: 14px;
    color: #888;
}
.galleryplus-breadcrumbs a {
    color: #555;
    text-decoration: none;
}
.galleryplus-breadcrumbs a:hover {
    color: #333;
    text-decoration: underline;
}
.galleryplus-breadcrumbs-sep {
    margin: 0 6px;
    color: #bbb;
}

/* --- Category tabs --- */
.galleryplus-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
    width: 100%;
    flex: 0 0 100%;
}
.galleryplus-category-tab {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: inherit;
    background: transparent;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
.galleryplus-category-tabs > .galleryplus-category-tab:first-child {
    color: #ff5317;
}
.galleryplus-category-tab:hover {
    background: rgba(255, 83, 23, 0.08);
    color: #ff5317;
}
.galleryplus-category-tab.active,
.galleryplus-category-tabs > .galleryplus-category-tab:first-child.active {
    background: #ff5317;
    color: #fff !important;
}
.galleryplus-category-tab-count {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    background: rgba(255, 83, 23, 0.12);
    color: inherit;
    padding: 1px 7px;
    border-radius: 10px;
    line-height: 1.4;
}
.galleryplus-category-tab.active .galleryplus-category-tab-count {
    background: rgba(255,255,255,.25);
    color: #fff;
}

.galleryplus-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.galleryplus-toolbar::-webkit-scrollbar {
    display: none;
}

.galleryplus-tabs {
    display: flex;
    gap: 4px;
    background: rgba(0,0,0,.04);
    border-radius: 8px;
    padding: 3px;
}

.galleryplus-tab {
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: inherit;
    transition: all .15s;
}

.galleryplus-tab-like-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    fill: currentColor;
    color: inherit;
    vertical-align: -2px;
    margin-right: 2px;
}

.galleryplus-album-like-icon,
.galleryplus-item-like-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    fill: currentColor;
    color: inherit;
    vertical-align: -1px;
    margin-right: 2px;
}

.galleryplus-tab:hover {
    background: rgba(0,0,0,.06);
}

.galleryplus-tab.active {
    background: #fff;
    color: #111;
    box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

.black-theme .galleryplus-tabs {
    background: rgba(255,255,255,.08);
}

.black-theme .galleryplus-tab:hover {
    background: rgba(255,255,255,.1);
}

.black-theme .galleryplus-tab.active {
    background: #ff5317;
    color: #fff;
    box-shadow: none;
}

.galleryplus-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.galleryplus-view-switch {
    display: flex;
    gap: 2px;
}

.galleryplus-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #666;
    transition: all .15s;
}

.galleryplus-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

a.galleryplus-btn.galleryplus-upload-btn {
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    background: #1a73e8 !important;
    color: #fff !important;
    border-color: #1a73e8 !important;
    padding: 7px 16px;
    white-space: nowrap;
}

a.galleryplus-btn.galleryplus-upload-btn:hover {
    background: #1557b0 !important;
    border-color: #1557b0 !important;
}

/* --- Grid (JS masonry) --- */
.galleryplus-grid {
    position: relative;
    margin: 0;
    padding: 0;
    opacity: 1; /* видно сразу; .jsly после masonry только для плавности не нужен как gate */
    transition: opacity .15s ease;
}

/* Без JS / до masonry: CSS grid — иначе img width/height:100% коллапсит */
.galleryplus-grid:not(.jsly) {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}

.galleryplus-grid:not(.jsly) .galleryplus-item {
    width: 100%;
    position: relative;
    left: auto;
    top: auto;
}

.galleryplus-grid:not(.jsly) .galleryplus-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.galleryplus-grid.jsly {
    display: block;
    opacity: 1;
}

.galleryplus-item {
    display: inline-block;
    vertical-align: top;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.galleryplus-item.position-absolute {
    position: absolute;
}

.galleryplus-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform .3s ease;
}

.galleryplus-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.galleryplus-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,.7));
    color: #fff;
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
    border-radius: 0 0 8px 8px;
}

.galleryplus-item-overlay-title {
    display: block;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    pointer-events: auto;
    width: 100%;
    color: #fff;
    text-decoration: none;
}

.galleryplus-item-overlay-title:hover {
    text-decoration: underline;
    color: #fff;
}

.galleryplus-item-overlay-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.galleryplus-item-overlay-stats {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.galleryplus-item-likes,
.galleryplus-item-comments {
    font-size: 12px;
    white-space: nowrap;
    opacity: .9;
    pointer-events: none;
    color: #fff;
}

.galleryplus-item-views {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    pointer-events: none;
    user-select: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.galleryplus-item-views-icon {
    display: block;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    fill: currentColor;
    color: inherit;
}

/* Views + likes badges (explore / liked widget) */
.galleryplus-item-badges {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}
.galleryplus-item-badges .galleryplus-item-views {
    position: static;
}
.galleryplus-item-likes-badge .galleryplus-item-like-icon {
    display: block;
    width: 12px;
    height: 12px;
    margin: 0;
    fill: currentColor;
    color: inherit;
}

@media (max-width: 640px) {
    .galleryplus-item-badges {
        right: 6px;
        top: 6px;
        gap: 4px;
    }
    .galleryplus-item-views,
    .galleryplus-item-badges .galleryplus-item-views {
        right: 6px;
        top: 6px;
        gap: 3px;
        padding: 2px 6px;
        font-size: 10px;
        line-height: 1.2;
    }
    .galleryplus-item-views-icon {
        width: 11px;
        height: 11px;
    }
    .galleryplus-item-likes-badge .galleryplus-item-like-icon {
        width: 10px;
        height: 10px;
    }
}

/* Liked widget: views + likes badges, author like albums */
.galleryplus-liked-grid .galleryplus-item-author-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 20px 10px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    pointer-events: none;
}
.galleryplus-liked-grid .galleryplus-item-author-bar .galleryplus-album-author {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    pointer-events: auto;
}
.galleryplus-liked-grid .galleryplus-item-author-bar .galleryplus-view-avatar {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: block;
    border-radius: 50%;
    overflow: hidden;
}
.galleryplus-liked-grid .galleryplus-item-author-bar .galleryplus-view-avatar img,
.galleryplus-liked-grid .galleryplus-item-author-bar .galleryplus-view-avatar .default_avatar,
.galleryplus-liked-grid .galleryplus-item-author-bar .galleryplus-view-avatar .default_avatar img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.galleryplus-liked-grid .galleryplus-item-author-bar .galleryplus-view-avatar .default_avatar {
    line-height: 28px;
    font-size: 12px;
    background-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    text-align: center;
}
.galleryplus-liked-grid .galleryplus-item-author-bar .galleryplus-album-author a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.galleryplus-liked-grid .galleryplus-item-author-bar .galleryplus-album-author a:hover {
    color: #fff;
    text-decoration: underline;
}

.galleryplus-item-author {
    font-size: 12px;
    opacity: .9;
    pointer-events: auto;
    text-decoration: none;
}

.galleryplus-item-author:hover {
    text-decoration: underline;
}

.galleryplus-item:hover .galleryplus-item-overlay {
    opacity: 1;
}

.galleryplus-item:hover img {
    transform: scale(1.03);
}

.galleryplus-item-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.galleryplus-item-author {
    font-size: 12px;
    opacity: .85;
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Loading indicator --- */
.galleryplus-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 0;
    opacity: 0;
    transition: opacity .3s;
}

.galleryplus-loading.active {
    opacity: 1;
}

.galleryplus-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: galleryplus-spin .7s linear infinite;
}

@keyframes galleryplus-spin {
    to { transform: rotate(360deg); }
}

/* --- Pagination --- */
.galleryplus-pagination {
    text-align: center;
    padding: 24px 0;
}

/* --- Photo View --- */
.galleryplus-view {
    display: flex;
    gap: 24px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px;
}

.galleryplus-view-image {
    flex: 1;
    min-width: 0;
    position: relative;
}

.galleryplus-view-image img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 0 auto;
}

.galleryplus-view-dots {
    display: none;
}

.galleryplus-view-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    flex-shrink: 0;
    transition: background .15s ease, transform .15s ease;
}

.galleryplus-view-dot.is-active {
    background: #fb5117;
    transform: scale(1.15);
}

@media (max-width: 640px) {
    .galleryplus-view-dots {
        position: absolute;
        top: auto;
        left: 50%;
        bottom: 12px;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 3px;
        z-index: 2;
        pointer-events: none;
        padding: 3px 6px;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.28);
    }
}

.galleryplus-view-sidebar {
    width: 320px;
    flex-shrink: 0;
}

.galleryplus-view-meta {
    margin-bottom: 16px;
}

.galleryplus-view .tags_bar {
    margin-bottom: 16px;
}

.galleryplus-view-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.galleryplus-view-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.galleryplus-view-stats {
    font-size: 13px;
    color: #888;
    display: flex;
    gap: 12px;
}

.galleryplus-view-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    .galleryplus-view-actions .galleryplus-action-btn--edit,
    .galleryplus-view-actions .galleryplus-action-btn--delete,
    .galleryplus-view-actions .galleryplus-like-btn,
    .galleryplus-view-actions .galleryplus-dl-btn {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        box-sizing: border-box;
    }
}

.galleryplus-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    font-size: 13px;
    line-height: 1;
    box-sizing: border-box;
    transition: all .15s;
    cursor: pointer;
}

.galleryplus-action-btn:hover {
    background: #f5f5f5;
}

.galleryplus-action-btn--edit {
    color: #2980b9;
    border-color: #2980b9;
}

.galleryplus-action-btn--edit:hover {
    background: #2980b9;
    color: #fff;
}

.galleryplus-action-btn--delete {
    color: #c0392b;
    border-color: #c0392b;
}

.galleryplus-action-btn--delete:hover {
    background: #c0392b;
    color: #fff;
}

.galleryplus-view-like-stat {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.galleryplus-view-like-stat .galleryplus-like-btn {
    padding: 8px 12px;
}

.galleryplus-view-like-stat .galleryplus-like-icon {
    position: relative;
    display: block;
    width: 22px;
    height: 22px;
    font-size: 0;
    line-height: 0;
}

.galleryplus-view-like-stat .galleryplus-like-svg {
    display: block;
    width: 22px;
    height: 22px;
    fill: currentColor;
    color: inherit;
}

.galleryplus-view-like-stat .galleryplus-like-svg--filled {
    display: none;
    color: #ff3040;
    fill: #ff3040;
}

.galleryplus-view-like-stat .galleryplus-like-btn.liked .galleryplus-like-svg--outline {
    display: none;
}

.galleryplus-view-like-stat .galleryplus-like-btn.liked .galleryplus-like-svg--filled {
    display: block;
}

.galleryplus-view-like-stat .galleryplus-like-count {
    display: inline-block;
    min-width: 1em;
    font-size: 14px;
    font-weight: 600;
    color: #fff !important;
    text-decoration: none;
}

.galleryplus-view-like-stat .galleryplus-like-count--clickable {
    cursor: pointer;
    color: #fff !important;
}

.galleryplus-view-like-stat .galleryplus-like-count--clickable:hover {
    color: #fff !important;
    text-decoration: underline;
}

.galleryplus-likes-users {
    width: 280px;
    max-width: 100%;
    margin: 15px;
    display: flex;
    flex-flow: row wrap;
    gap: 10px 12px;
}

.galleryplus-likes-users--many {
    max-height: 220px;
    overflow-y: auto;
}

.galleryplus-likes-user a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 72px;
    text-decoration: none;
    color: inherit;
}

.galleryplus-likes-user-name {
    display: block;
    max-width: 72px;
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.galleryplus-likes-empty {
    margin: 15px auto;
    text-align: center;
}

.galleryplus-like-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    transition: all .15s;
}

.galleryplus-like-btn:hover:not(.disabled) {
    background: #fef0f0;
    border-color: #faa;
}

.galleryplus-like-btn.liked {
    background: #fee;
    border-color: #f88;
    color: #e33;
}

.galleryplus-like-btn.disabled {
    opacity: .5;
    cursor: default;
}

.galleryplus-like-icon {
    font-size: 18px;
}

.galleryplus-dl-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    font-size: 14px;
    transition: all .15s;
}

.galleryplus-dl-btn:hover {
    background: #f5f5f5;
}

.galleryplus-view-desc {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.galleryplus-view-album {
    margin-bottom: 16px;
}

.galleryplus-view-album a {
    color: #07b;
    text-decoration: none;
}

.galleryplus-view-album a:hover {
    text-decoration: underline;
}

.black-theme .galleryplus-view-album a {
    color: #fff;
}

/* --- Tabs (view page: siblings of .galleryplus-view, not children) --- */
.galleryplus-tabs:has(> .galleryplus-tabs-nav) {
    background: none;
    border-radius: 0;
    gap: 0;
    display: block;
    max-width: 1280px;
    margin: 0 auto 24px;
    padding: 0 16px;
    box-sizing: border-box;
}

.galleryplus-tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #eee;
    margin-bottom: 16px;
}

.galleryplus-tabs-nav button {
    padding: 10px 20px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    color: #888;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .15s;
}

.galleryplus-tabs-nav button:hover {
    color: #333;
}

.galleryplus-tabs-nav button.active {
    color: #111;
    border-bottom-color: #333;
}

.black-theme .galleryplus-tabs-nav {
    border-bottom-color: #444;
}

.black-theme .galleryplus-tabs-nav button {
    color: #aaa;
}

.black-theme .galleryplus-tabs-nav button:hover {
    color: #fff;
}

.black-theme .galleryplus-tabs-nav button.active {
    color: #fff;
    border-bottom-color: #fff;
}

.black-theme .galleryplus-view-desc {
    color: #ccc;
}

.black-theme .galleryplus-exif-list dt {
    color: #aaa;
}

.black-theme .galleryplus-exif-list dd {
    color: #eee;
}

.galleryplus-tab-pane {
    display: none;
    padding: 8px 0;
}

.galleryplus-tab-pane.active {
    display: block;
}

.galleryplus-tabs-content {
    max-width: 1280px;
    margin: 0 auto 24px;
    padding: 0 16px;
    box-sizing: border-box;
}

/* --- Embed table --- */
.galleryplus-embed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.galleryplus-embed-table th,
.galleryplus-embed-table td {
    padding: 6px 8px;
    border: 1px solid #eee;
    text-align: left;
}

.galleryplus-embed-table th {
    background: #fafafa;
    font-weight: 600;
}

.galleryplus-embed-label {
    white-space: nowrap;
    font-weight: 500;
    color: #555;
}

.galleryplus-embed-code {
    width: 100%;
    min-width: 120px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 11px;
    font-family: monospace;
    background: #fafafa;
    resize: none;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

.galleryplus-direct-links {
    margin-top: 16px;
}

.galleryplus-direct-links code {
    font-size: 12px;
    color: #888;
}

.galleryplus-direct-links input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 12px;
    background: #fafafa;
    cursor: pointer;
    margin-bottom: 6px;
}

/* --- EXIF list --- */
.galleryplus-exif-list {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 4px 8px;
    font-size: 13px;
}

.galleryplus-exif-list dt {
    font-weight: 600;
    color: #555;
    padding: 4px 0;
}

.galleryplus-exif-list dd {
    margin: 0;
    padding: 4px 0;
    color: #333;
}

/* --- Album view --- */
.galleryplus.album-view .galleryplus-header {
    flex-direction: column;
    align-items: flex-start;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .galleryplus-view { flex-direction: column; }
    .galleryplus-view-sidebar { width: 100%; }
}

@media (max-width: 640px) {
    .galleryplus-header { flex-direction: column; align-items: flex-start; }
    .galleryplus-toolbar { gap: 8px; flex-wrap: wrap; }
    .galleryplus-tab { padding: 6px 10px; font-size: 13px; }
    .galleryplus-tab-label { display: none; }
}

/* --- Upload page --- */
.galleryplus-upload {
    max-width: 740px;
    padding: 0;
}

.galleryplus-upload-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px;
}

.galleryplus-upload-dropzone {
    border: 2px dashed #ccc;
    border-radius: 12px;
    padding: 32px 16px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    background: #fafafa;
}

.galleryplus-upload-dropzone:hover,
.galleryplus-upload-dropzone.dragover {
    border-color: #1a73e8;
    background: #f0f6ff;
}

.galleryplus-upload-icon {
    color: #999;
    margin-bottom: 8px;
}

.galleryplus-upload-text {
    font-size: 16px;
    color: #333;
    margin: 0 0 6px;
}

.galleryplus-upload-hint {
    font-size: 13px;
    color: #999;
    margin: 0;
}

.galleryplus-upload-progress {
    margin-top: 16px;
}

.galleryplus-upload-progress-bar {
    height: 4px;
    background: #1a73e8;
    border-radius: 2px;
    width: 0;
    transition: width .3s;
}

.galleryplus-upload-album-select {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.galleryplus-upload-album-select label {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.galleryplus-upload-album-select select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
}

.galleryplus-upload-new-album {
    margin-top: 8px;
}

.galleryplus-upload-new-album input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.galleryplus-upload-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.galleryplus-upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fff;
}

.galleryplus-upload-item-preview {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.galleryplus-upload-item-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
}

.galleryplus-upload-item-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #333;
    border-radius: 50%;
    animation: galleryplus-spin .7s linear infinite;
}

.galleryplus-upload-item-info {
    flex: 1;
    min-width: 0;
}

.galleryplus-upload-item-title {
    width: 100%;
    border: none;
    font-size: 14px;
    padding: 4px 0;
    outline: none;
    box-sizing: border-box;
}

.galleryplus-upload-item-title:focus {
    border-bottom: 1px solid #1a73e8;
}

.galleryplus-upload-item-error {
    font-size: 12px;
    color: #f44336;
    margin-top: 2px;
    line-height: 1.3;
}

.galleryplus-upload-item-notice {
    font-size: 12px;
    color: #b26a00;
    margin-top: 2px;
    line-height: 1.3;
}

.galleryplus-pending-thumb {
    position: relative;
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 4px;
    background: #f5f5f5;
}

.galleryplus-pending-thumb img {
    display: block;
    max-width: 60px;
    max-height: 60px;
    transform-origin: top left;
    transition: transform .2s ease;
}

.galleryplus-pending-thumb:hover img {
    transform: scale(2.5);
}

.galleryplus-pending-actions {
    margin-bottom: 12px;
}

.galleryplus-pending-actions .btn {
    margin-right: 6px;
}

.galleryplus-upload-item-progress {
    width: 80px;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    flex-shrink: 0;
}

.galleryplus-upload-item-bar {
    height: 4px;
    background: #1a73e8;
    border-radius: 2px;
    width: 0;
    transition: width .3s;
}

.galleryplus-upload-actions {
    margin-top: 16px;
    text-align: right;
}

.galleryplus-btn-primary {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    background: #1a73e8;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.galleryplus-btn-primary:hover {
    background: #1557b0;
}

/* --- Albums grid (CSS grid, без masonry) --- */
.galleryplus-empty {
    text-align: center;
    padding: 48px 20px;
    font-size: 15px;
    color: #888;
    background: #fafafa;
    border-radius: 10px;
}

.galleryplus-albums-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    position: relative;
    height: auto !important;
}

.galleryplus-albums-grid .galleryplus-album-card,
.galleryplus-albums-grid .galleryplus-album-card.position-absolute {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    overflow: hidden;
    background: #1a1a1a;
    border: 1px solid #eee;
    transition: box-shadow .2s, transform .2s;
    min-width: 0;
}

.galleryplus-album-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,.1);
    transform: translateY(-2px);
}

/* клик по карточке без вложенных <a> (теги ломали DOM) */
.galleryplus-album-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.galleryplus-albums-grid .galleryplus-album-cover {
    position: relative;
    z-index: 2;
    width: 100%;
    aspect-ratio: 4 / 3;
    min-height: 0;
    overflow: hidden;
    background: #2a2a2a;
    display: block;
    pointer-events: none;
}

.galleryplus-albums-grid .galleryplus-album-cover > img {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    aspect-ratio: auto;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.galleryplus-album-cover-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #999;
}

.galleryplus-album-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 24px 12px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,.75));
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
}
.galleryplus-album-info a,
.galleryplus-album-tags,
.galleryplus-album-tags a.galleryplus-tag-link {
    pointer-events: auto;
    position: relative;
    z-index: 3;
    color: inherit;
    text-decoration: none;
}
.galleryplus-album-info .galleryplus-album-title {
    display: block;
    overflow: hidden;
    min-width: 0;
    z-index: 1;
}

.galleryplus-album-meta-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: rgba(255,255,255,.85);
    flex-wrap: nowrap;
    min-width: 0;
    overflow: hidden;
}

.galleryplus-album-meta-row > .galleryplus-album-likes {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}

.galleryplus-album-dot {
    color: rgba(255,255,255,.5);
}

/* оверлей на обложке — светлый текст; серый #888 ниже только для info под карточкой */
.galleryplus-album-cover .galleryplus-album-info .galleryplus-album-user {
    display: inline;
    color: rgba(255,255,255,.85);
    margin-top: 0;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.galleryplus-album-cover .galleryplus-album-info .galleryplus-album-user:hover {
    color: #fff;
    text-decoration: underline;
}

.galleryplus-album-cover .galleryplus-album-info .galleryplus-album-count,
.galleryplus-album-cover .galleryplus-album-info .galleryplus-album-likes {
    font-size: 12px;
    color: rgba(255,255,255,.85);
    white-space: nowrap;
}

.galleryplus-album-cover .galleryplus-album-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 0;
    min-width: 0;
    pointer-events: auto;
    position: relative;
    z-index: 3;
}

.galleryplus-album-cover .galleryplus-album-author .galleryplus-view-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: block;
    border-radius: 50%;
    overflow: hidden;
}

.galleryplus-album-cover .galleryplus-album-author .galleryplus-view-avatar img,
.galleryplus-album-cover .galleryplus-album-author .galleryplus-view-avatar .default_avatar,
.galleryplus-album-cover .galleryplus-album-author .galleryplus-view-avatar .default_avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.galleryplus-album-cover .galleryplus-album-author .galleryplus-view-avatar .default_avatar {
    line-height: 32px;
    font-size: 14px;
    background-color: rgba(255,255,255,.18);
    color: #fff;
}

.galleryplus-album-cover .galleryplus-album-author a {
    color: rgba(255,255,255,.9);
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.galleryplus-album-cover .galleryplus-album-author a:hover {
    color: #fff;
    text-decoration: underline;
}

.galleryplus-album-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


@media (max-width: 640px) {
    .galleryplus-albums-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .galleryplus-grid:not(.jsly) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
    }

    .galleryplus-viewer-info {
        font-size: 13px;
    }
}

/* --- Viewer (lightbox) --- */
.galleryplus-viewer {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9999;
    transition: opacity .2s;
}

.galleryplus-viewer--hide {
    opacity: 0;
    pointer-events: none;
}

.galleryplus-viewer--show {
    opacity: 1;
}

.galleryplus-viewer-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000;
}

.galleryplus-viewer-content {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.galleryplus-viewer-img {
    max-width: 100vw;
    max-width: 100dvw;
    max-height: 100vh;
    max-height: 100dvh;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.galleryplus-viewer[data-cover="1"] .galleryplus-viewer-img {
    width: 100vw;
    width: 100dvw;
    height: 100vh;
    height: 100dvh;
    object-fit: contain;
}

/* --- Top bar (title + close) --- */
.galleryplus-viewer-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: linear-gradient(rgba(0,0,0,.6), transparent);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 56px;
    opacity: 0;
    transition: opacity .2s;
}

.galleryplus-viewer:hover .galleryplus-viewer-top,
.galleryplus-viewer--show:not(:hover) .galleryplus-viewer-top {
    opacity: 1;
}

html[data-idle] .galleryplus-viewer-top {
    opacity: 0 !important;
}

.galleryplus-viewer-top-left,
.galleryplus-viewer-top-right {
    min-width: 40px;
}

.galleryplus-viewer-title {
    position: absolute;
    bottom: 64px; left: 0; right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 16px;
    text-align: center;
    pointer-events: auto;
    opacity: 0;
    transition: opacity .2s;
}

.galleryplus-viewer-title:hover {
    text-decoration: underline;
}

.galleryplus-viewer-title-icon {
    flex-shrink: 0;
    opacity: .8;
}

.galleryplus-viewer:hover .galleryplus-viewer-title,
.galleryplus-viewer--show:not(:hover) .galleryplus-viewer-title {
    opacity: 1;
}

html[data-idle] .galleryplus-viewer-title {
    opacity: 0 !important;
}

.galleryplus-viewer-desc {
    position: absolute;
    bottom: 108px; left: 0; right: 0;
    z-index: 2;
    color: #fff;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
    padding: 0 16px;
    max-width: min(600px, 80%);
    margin: 0 auto;
    text-shadow: 0 1px 3px rgba(0,0,0,.7);
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
}

.galleryplus-viewer:hover .galleryplus-viewer-desc,
.galleryplus-viewer--show:not(:hover) .galleryplus-viewer-desc {
    opacity: 1;
}

html[data-idle] .galleryplus-viewer-desc {
    opacity: 0 !important;
}

.galleryplus-viewer-close {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: #fff;
    font-size: 28px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    opacity: .8;
    transition: opacity .15s;
}

.galleryplus-viewer-close:hover {
    opacity: 1;
}

/* --- Navigation arrows --- */
.galleryplus-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    background: rgba(255,255,255,.08);
    color: #fff;
    cursor: pointer;
    z-index: 3;
    opacity: 0;
    transition: opacity .2s, background .15s;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.galleryplus-viewer-nav:hover {
    background: rgba(255,255,255,.18);
}

.galleryplus-viewer-nav svg {
    flex-shrink: 0;
}

.galleryplus-viewer:hover .galleryplus-viewer-nav {
    opacity: 1;
}

html[data-idle] .galleryplus-viewer-nav {
    opacity: 0 !important;
}

.galleryplus-viewer--nav-prev .galleryplus-viewer-prev {
    left: 16px;
    display: block;
}

.galleryplus-viewer--nav-next .galleryplus-viewer-next {
    right: 16px;
    display: block;
}

.galleryplus-viewer-prev,
.galleryplus-viewer-next {
    display: none;
}

@media (max-width: 768px) {
    .galleryplus-viewer-nav {
        display: none !important;
    }
}

/* --- Bottom bar (avatar, author, like, share) --- */
.galleryplus-viewer-bottom {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: linear-gradient(transparent, rgba(0,0,0,.6));
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    opacity: 0;
    transition: opacity .2s;
}

.galleryplus-viewer:hover .galleryplus-viewer-bottom,
.galleryplus-viewer--show:not(:hover) .galleryplus-viewer-bottom {
    opacity: 1;
}

html[data-idle] .galleryplus-viewer-bottom {
    opacity: 0 !important;
}

.galleryplus-viewer-bottom-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.galleryplus-viewer-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.galleryplus-viewer-author {
    color: #fff;
    font-size: 13px;
    opacity: .85;
}

.galleryplus-viewer-bottom-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.galleryplus-viewer-like,
.galleryplus-viewer-comments,
.galleryplus-viewer-share {
    display: flex;
    align-items: center;
    gap: 4px;
    border: none;
    background: none;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    opacity: .7;
    transition: opacity .15s;
    white-space: nowrap;
    padding: 4px 8px;
    border-radius: 6px;
}

.galleryplus-viewer-like:hover,
.galleryplus-viewer-comments:hover,
.galleryplus-viewer-share:hover {
    opacity: 1;
    background: rgba(255,255,255,.1);
}

.galleryplus-viewer-like.liked {
    opacity: 1;
}

.galleryplus-viewer-like.disabled {
    opacity: .4;
    cursor: default;
}

.galleryplus-viewer-like-icon,
.galleryplus-viewer-comments-icon {
    font-size: 18px;
    line-height: 1;
}

.galleryplus-share-icon {
    display: block;
}

/* --- Body lock --- */
body.galleryplus-viewer-open {
    overflow: hidden;
}

/* --- Grid item title link --- */
.galleryplus-item-title {
    text-decoration: none;
}

.galleryplus-item-title:hover {
    text-decoration: underline;
}

.galleryplus-item-overlay .galleryplus-item-title {
    color: #fff;
}

.galleryplus-viewer-link {
    display: block;
    text-decoration: none;
}

/* --- Share Popup --- */
.galleryplus-viewer-share-popup {
    position: absolute;
    bottom: 64px;
    right: 16px;
    background: #2a2a2a;
    border-radius: 10px;
    padding: 8px;
    z-index: 5;
    display: none;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 4px 20px rgba(0,0,0,.5);
    min-width: 160px;
}

.galleryplus-viewer-share-popup--show {
    display: flex;
}

.galleryplus-viewer-share-popup-arrow {
    display: none;
}

.galleryplus-viewer-share-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: #eee;
    text-decoration: none;
    font-size: 14px;
    border-radius: 6px;
    transition: background .15s;
}

.galleryplus-viewer-share-option:hover {
    background: rgba(255,255,255,.1);
    color: #fff;
}

button.galleryplus-viewer-share-option {
    border: none;
    background: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.galleryplus-viewer-share-option svg {
    flex-shrink: 0;
}

/* --- Comments Side Panel --- */
.galleryplus-viewer-comments-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 4;
    display: none;
    align-items: stretch;
    justify-content: flex-end;
}

.galleryplus-viewer-comments-overlay--show {
    display: flex;
}

.galleryplus-viewer-comments-panel {
    width: 380px;
    max-width: 90vw;
    background: #1a1a1a;
    display: flex;
    flex-direction: column;
    animation: galleryplus-slide-in .25s ease;
}

@keyframes galleryplus-slide-in {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.galleryplus-viewer-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
}

.galleryplus-viewer-comments-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    opacity: .7;
    border-radius: 6px;
}

.galleryplus-viewer-comments-close:hover {
    opacity: 1;
    background: rgba(255,255,255,.1);
}

.galleryplus-viewer-comments-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    color: #ccc;
    font-size: 14px;
    line-height: 1.5;
}

.galleryplus-viewer-comments-loading {
    text-align: center;
    padding: 40px 0;
    color: #888;
}

/* Override comment styles inside the dark panel */
.galleryplus-viewer-comments-body .comments_widget {
    color: #ccc;
}

.galleryplus-viewer-comments-body .comments_widget a {
    color: #6af;
}

.galleryplus-viewer-comments-body .comment_item {
    border-bottom-color: #333;
}

.galleryplus-viewer-comments-body .form-control {
    background: #333;
    border-color: #444;
    color: #eee;
}

.galleryplus-viewer-link img {
    display: block;
    width: 100%;
}

.galleryplus-item-overlay .galleryplus-item-author {
    font-size: 12px;
    opacity: .85;
}

/* ===== Album Edit Page ===== */
.galleryplus-album-edit {
    max-width: 680px;
    margin: 0 auto;
    padding: 0;
}

.galleryplus-album-edit-header {
    margin-bottom: 12px;
}

.galleryplus-album-edit-header .galleryplus-title {
    margin-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.galleryplus-album-edit-subtitle {
    margin: 0;
    font-size: 14px;
    color: #888;
}

.galleryplus-album-edit-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
}

.galleryplus-album-edit .galleryplus-settings-section {
    margin-bottom: 12px;
}

.galleryplus-album-edit .galleryplus-input,
.galleryplus-album-edit input.form-control,
.galleryplus-album-edit textarea.form-control,
.galleryplus-album-edit select.form-control {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    background: #fff;
    color: #222;
    transition: border-color .15s, box-shadow .15s;
}

.galleryplus-album-edit .galleryplus-input:focus,
.galleryplus-album-edit input.form-control:focus,
.galleryplus-album-edit textarea.form-control:focus,
.galleryplus-album-edit select.form-control:focus {
    outline: 0;
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

.galleryplus-album-edit textarea.form-control {
    resize: vertical;
    min-height: 96px;
}

.galleryplus-album-edit-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.galleryplus-album-edit-check input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: #1a73e8;
}

.galleryplus-album-edit-check strong {
    display: block;
    font-size: 14px;
    color: #222;
}

.galleryplus-album-edit-check small {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

.galleryplus-album-edit-privacy .galleryplus-privacy-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.galleryplus-privacy-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #eee;
    border-radius: 10px;
    background: #fafafa;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.galleryplus-privacy-option:hover {
    border-color: #d0d7de;
    background: #f5f8ff;
}

.galleryplus-privacy-option:has(input:checked),
.galleryplus-privacy-option.is-selected {
    border-color: #1a73e8;
    background: #eef4ff;
}

.galleryplus-privacy-option input[type="radio"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: #1a73e8;
}

.galleryplus-privacy-option-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.galleryplus-privacy-option-body strong {
    font-size: 14px;
    color: #222;
}

.galleryplus-privacy-option-body small {
    font-size: 12px;
    color: #888;
    line-height: 1.4;
}

.galleryplus-album-edit .galleryplus-privacy-sub-input {
    margin: 0 0 4px 0;
    padding: 0 4px 4px 36px;
}

.galleryplus-field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #888;
}

.galleryplus-album-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 4px;
}

.galleryplus-album-edit .galleryplus-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border: none;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
}

.galleryplus-btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #555;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}

.galleryplus-btn-ghost:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #222;
    text-decoration: none;
}

.galleryplus-album-edit-danger {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.galleryplus-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid #f1b0b7;
    border-radius: 8px;
    background: #fff5f5;
    color: #c62828;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.galleryplus-btn-danger:hover {
    background: #ffe8e8;
    border-color: #e57373;
    color: #b71c1c;
}

@media (max-width: 640px) {
    .galleryplus-album-edit {
        padding: 0;
    }
    .galleryplus-album-edit-card {
        padding: 12px;
        border-radius: 10px;
    }
    .galleryplus-album-edit-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .galleryplus-album-edit-actions .galleryplus-btn-primary,
    .galleryplus-album-edit-actions .galleryplus-btn-ghost {
        width: 100%;
        text-align: center;
    }
}

/* ===== Album View ===== */
.galleryplus-album-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.galleryplus-album-description {
    margin: 8px 0;
    line-height: 1.6;
}

.galleryplus-album-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.galleryplus-album-user {
    font-weight: 500;
}

.galleryplus-album-user-link {
    margin-left: 4px;
}

/* ===== Author as Link ===== */
.galleryplus-item-author {
    color: inherit;
    text-decoration: none;
    opacity: .8;
    font-size: 12px;
}
.galleryplus-item-author:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ===== Locked Album ===== */
.galleryplus-album-locked {
    text-align: center;
    padding: 60px 20px;
    max-width: 480px;
    margin: 0 auto;
}

.galleryplus-album-locked-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: .5;
}

.galleryplus-album-locked h2 {
    font-size: 24px;
    margin-bottom: 12px;
}

.galleryplus-album-locked p {
    color: #666;
    margin-bottom: 24px;
}

.galleryplus-album-password-form {
    display: flex;
    gap: 8px;
    max-width: 360px;
    margin: 0 auto;
}

.galleryplus-album-password-form .form-control {
    flex: 1;
}

/* ===== Album card user ===== */
.galleryplus-album-user {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

/* ===== Privacy blur for non-public albums ===== */
.galleryplus-grid-blurred .galleryplus-item img {
    filter: blur(12px);
    transform: scale(1.1);
    pointer-events: none;
}

.galleryplus-karma-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

.galleryplus-karma-message {
    color: #fff;
    background: rgba(0,0,0,0.65);
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 15px;
    margin-top: 12px;
    max-width: 400px;
    text-align: center;
}

/* ===== Adult (18+) overlay ===== */
.galleryplus-item--adult {
    position: relative;
}

.galleryplus-item--adult img.galleryplus-blurred {
    filter: blur(16px);
    transform: scale(1.15);
}

.galleryplus-adult-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    color: #fff;
    font-weight: 800;
    letter-spacing: 2px;
    border-radius: 8px;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    white-space: nowrap;

    padding: 5px 15px;
    background: rgb(255 83 23);
    font-size: 12px;
}

/* Photos page: 2x */
.galleryplus-item .galleryplus-adult-badge {
    padding: 10px 30px;
    font-size: 24px;
    border-radius: 16px;
}

@media (max-width: 640px) {
    .galleryplus-adult-badge {
        padding: 2px 7px;
        font-size: 10px;
    }

    /* Photos page mobile: 2x */
    .galleryplus-item .galleryplus-adult-badge {
        padding: 4px 14px;
        font-size: 20px;
        border-radius: 8px;
    }

    /* Albums mobile: 3x */
    .galleryplus-album-card .galleryplus-adult-badge {
        padding: 6px 21px;
        font-size: 30px;
        border-radius: 12px;
    }
}

.galleryplus-album-card--adult {
    position: relative;
}

.galleryplus-album-card--adult .galleryplus-blurred {
    filter: blur(16px);
    transform: scale(1.15);
}

.galleryplus-album-card--protected {
    position: relative;
}

.galleryplus-album-card--protected .galleryplus-blurred {
    filter: blur(16px);
    transform: scale(1.15);
}

.galleryplus-album-lock-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 30px;
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.galleryplus-album-lock-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #546e7a;
    padding: 1px 6px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
}

.galleryplus-album-adult-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    padding: 1px 0px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
}

.galleryplus-viewer--adult .galleryplus-viewer-content::after {
    content: '18+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 4;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 96px;
    font-weight: 800;
    letter-spacing: 8px;
    padding: 40px 80px;
    border-radius: 24px;
    pointer-events: none;
    white-space: nowrap;
}

img.galleryplus-viewer-blurred {
    filter: blur(24px);
    transform: scale(1.2);
}

/* ===== View page adult blur ===== */
.galleryplus-view-image--adult {
    position: relative;
}

.galleryplus-view-image--adult img.galleryplus-blurred {
    filter: blur(16px);
    transform: scale(1.15);
}

.galleryplus-adult-badge.galleryplus-adult-badge--view {
    font-size: 36px;
    border-radius: 24px;
    padding: 32px 22px;
}

.galleryplus-view-adult-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 20px 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    text-align: center;
    z-index: 3;
}

.galleryplus-view-adult-overlay p {
    color: #fff;
    font-size: 16px;
    margin-bottom: 12px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.galleryplus-view-adult-overlay .button-submit {
    display: inline-block;
    padding: 8px 24px;
    background: #c62828;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.galleryplus-view-adult-overlay .button-submit:hover {
    background: #b71c1c;
}

.galleryplus-view-login-btn {
    display: inline-block;
    padding: 8px 24px;
    background: #c62828;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.galleryplus-view-login-btn:hover {
    background: #b71c1c;
}

/* ===== Album search autocomplete ===== */
.galleryplus-album-search-wrap {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}

.galleryplus-album-search-wrap .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    height: 38px;
}

.galleryplus-album-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
}

.galleryplus-album-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: background .1s;
}

.galleryplus-album-dropdown-item:hover {
    background: #f0f6ff;
}

.galleryplus-upload-album-select {
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.galleryplus-upload-album-select .btn,
.galleryplus-upload-album-select #galleryplus-new-album-btn {
    flex: 1 1 0;
    min-width: 0;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    margin-bottom: 0 !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 14px !important;
    white-space: nowrap;
    line-height: 1 !important;
}

.galleryplus-upload-new-album {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.galleryplus-upload-new-album .form-control {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    height: 38px;
}

/* Upload — black theme */
.black-theme .galleryplus-upload-dropzone {
    background: #222;
    border-color: #555;
}

.black-theme .galleryplus-upload-dropzone:hover,
.black-theme .galleryplus-upload-dropzone.dragover {
    background: #2a2a2a;
    border-color: #ff5317;
}

.black-theme .galleryplus-upload-text {
    color: #eee;
}

.black-theme .galleryplus-upload-icon {
    color: #888;
}

.black-theme .galleryplus-upload-hint {
    color: #888;
}

.black-theme .galleryplus-album-search-wrap .form-control,
.black-theme .galleryplus-upload-new-album .form-control,
.black-theme .galleryplus-upload .form-control,
.black-theme .galleryplus-selected-album .form-control,
.black-theme .galleryplus-privacy-sub-input .form-control {
    background: #222;
    border-color: #444;
    color: #eee;
}

.black-theme .galleryplus-album-search-wrap .form-control::placeholder,
.black-theme .galleryplus-upload .form-control::placeholder {
    color: #888;
}

.black-theme .galleryplus-album-dropdown {
    background: #222;
    border-color: #444;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
}

.black-theme .galleryplus-album-dropdown-item {
    color: #eee;
}

.black-theme .galleryplus-album-dropdown-item:hover {
    background: #333;
}

.black-theme .galleryplus-selected-album {
    background: #222;
    border-color: #444;
}

.black-theme .galleryplus-selected-album-name {
    color: #eee;
    border-bottom-color: #444;
}

.black-theme .galleryplus-upload-item {
    background: #222;
    border-color: #444;
}

.black-theme .galleryplus-upload-item-title {
    background: #2a2a2a;
    border-color: #444;
    color: #eee;
}

.black-theme .galleryplus-upload-item-tags {
    background: #2a2a2a;
    border-color: #444;
    color: #eee;
}

.black-theme .galleryplus-upload-item-tags::placeholder {
    color: #888;
}

.black-theme .galleryplus-upload-item-tags:focus {
    border-color: #5a9fd4;
    box-shadow: 0 0 0 0.15rem rgba(90, 159, 212, .25);
}

/* ===== Selected album panel on upload page ===== */
.galleryplus-selected-album {
    margin-top: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    padding: 12px;
}

.galleryplus-selected-album-name {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.galleryplus-album-upload-settings {
    margin-top: 8px;
}

.galleryplus-settings-section {
    margin-bottom: 16px;
}

.galleryplus-settings-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.galleryplus-privacy-options .custom-radio {
    margin-bottom: 8px;
}

.galleryplus-privacy-sub-input {
    margin: 6px 0 10px 28px;
}

.galleryplus-privacy-sub-input .form-control {
    width: 100%;
    max-width: 360px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
}

.galleryplus-selected-album-info {
    font-size: 14px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.galleryplus-selected-album-addto {
    color: #666;
}

.galleryplus-album-edit-btn {
    margin-top: 4px;
}

.galleryplus-selected-album-owner {
    color: #888;
    font-size: 13px;
}

.galleryplus-settings-actions {
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.galleryplus-settings-status {
    font-size: 13px;
}

.galleryplus-settings-status.success {
    color: #4caf50;
}

.galleryplus-settings-status.error {
    color: #f44336;
}

.galleryplus-settings-section textarea.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    resize: vertical;
}

/* Hide preview button in comments panel */
.galleryplus-viewer-comments-panel .button-preview {
    display: none;
}

/* ===== Original image viewer ===== */
.galleryplus-original-viewer {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.9);
}

.galleryplus-original-viewer-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.galleryplus-original-viewer-close {
    position: absolute;
    top: 16px;
    right: 24px;
    z-index: 2;
    font-size: 36px;
    color: #fff;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    transition: background 0.2s;
    line-height: 1;
}

.galleryplus-original-viewer-close:hover {
    background: rgba(255,255,255,0.25);
}

.galleryplus-original-viewer-wrap {
    position: relative;
    z-index: 1;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.galleryplus-original-viewer-img {
    display: block;
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
    transition: transform 0.2s;
    cursor: zoom-in;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

/* ===== Edit modal ===== */
.galleryplus-modal {
    position: fixed;
    z-index: 10001;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.galleryplus-modal-bg {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
}

.galleryplus-modal-wrap {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

.galleryplus-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
}

.galleryplus-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.galleryplus-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 0 4px;
    color: #999;
    line-height: 1;
}

.galleryplus-modal-close:hover {
    color: #333;
}

.galleryplus-modal-body {
    padding: 24px;
}

.galleryplus-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.galleryplus-edit-field {
    margin-bottom: 16px;
}

.galleryplus-edit-field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 14px;
    color: #555;
}

.galleryplus-edit-field input,
.galleryplus-edit-field textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.galleryplus-edit-field textarea {
    resize: vertical;
    font-family: monospace;
}

/* Selection bar */
.galleryplus-selection-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    margin: 0 0 16px;
    background: #e8edf2;
    border: 1px solid #9aa7b5;
    border-radius: 6px;
    color: #1a1a1a;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

.galleryplus-select-all-label,
.galleryplus-checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    user-select: none;
}

.galleryplus-select-cb,
.galleryplus-select-all-label > input[type="checkbox"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    background: transparent !important;
}

.galleryplus-checkbox {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #5a6a7a;
    border-radius: 4px;
    background: #fff;
    position: relative;
    flex-shrink: 0;
    box-sizing: border-box;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
}

.galleryplus-checkbox::after {
    content: '';
    display: none;
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.galleryplus-select-cb:checked + .galleryplus-checkbox,
.galleryplus-select-all-label > input[type="checkbox"]:checked + .galleryplus-checkbox {
    background: #d32f2f;
    border-color: #d32f2f;
}

.galleryplus-select-cb:checked + .galleryplus-checkbox::after,
.galleryplus-select-all-label > input[type="checkbox"]:checked + .galleryplus-checkbox::after {
    display: block;
}

.galleryplus-item {
    position: relative;
}

.galleryplus-item > .galleryplus-checkbox-wrap {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    margin: 0;
    opacity: 0;
    transition: opacity .25s ease;
}

.galleryplus-item:hover > .galleryplus-checkbox-wrap,
.galleryplus-item > .galleryplus-checkbox-wrap:has(.galleryplus-select-cb:checked),
body.galleryplus-selecting .galleryplus-item > .galleryplus-checkbox-wrap,
.galleryplus-grid.galleryplus-selecting .galleryplus-item > .galleryplus-checkbox-wrap {
    opacity: 1;
}

.galleryplus-btn.galleryplus-select-mode-btn {
    border-color: #9aa7b5;
    color: #1a1a1a;
    background: #fff;
    font-size: 14px;
    line-height: 1.3;
    padding: 7px 14px;
}

.galleryplus-btn.galleryplus-select-mode-btn.active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
}

body.galleryplus-selecting .galleryplus-item {
    cursor: pointer;
}

body.galleryplus-selecting .galleryplus-item > .galleryplus-checkbox-wrap {
    pointer-events: auto;
}

@media (max-width: 640px) {
    .galleryplus-selection-bar {
        position: sticky;
        top: 0;
        z-index: 20;
        margin: 0 0 12px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .galleryplus-selection-count {
        margin-left: 0;
    }

    .galleryplus-delete-btn {
        margin-left: auto;
        min-height: 40px;
        padding: 8px 16px;
        font-size: 15px;
    }

    body.galleryplus-selecting .galleryplus-item > .galleryplus-checkbox-wrap {
        opacity: 1;
        top: 10px;
        left: 10px;
    }

    body.galleryplus-selecting .galleryplus-item > .galleryplus-checkbox-wrap .galleryplus-checkbox {
        width: 24px;
        height: 24px;
        border-width: 2px;
        box-shadow: 0 1px 4px rgba(0,0,0,.35);
    }

    body.galleryplus-selecting .galleryplus-item > .galleryplus-checkbox-wrap .galleryplus-checkbox::after {
        left: 7px;
        top: 2px;
        width: 7px;
        height: 13px;
    }
}

.galleryplus-album-card {
    position: relative;
}

.galleryplus-album-card > .galleryplus-checkbox-wrap--album {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    margin: 0;
    opacity: 0;
    transition: opacity .25s ease;
}

.galleryplus-album-card:hover > .galleryplus-checkbox-wrap--album {
    opacity: 1;
}

.galleryplus-album-card > .galleryplus-checkbox-wrap--album .galleryplus-checkbox {
    background: rgba(255,255,255,0.85);
    border-color: rgba(0,0,0,0.3);
}

body.galleryplus-selecting .galleryplus-album-card > .galleryplus-checkbox-wrap--album {
    opacity: 1;
}

.galleryplus-album-card > .galleryplus-select-cb--album:checked + .galleryplus-checkbox {
    background: #d32f2f;
    border-color: #d32f2f;
}

.galleryplus-item > .galleryplus-checkbox-wrap .galleryplus-checkbox {
    background: rgba(255,255,255,0.85);
    border-color: rgba(0,0,0,0.3);
}

.galleryplus-item > .galleryplus-select-cb:checked + .galleryplus-checkbox {
    background: #d32f2f;
    border-color: #d32f2f;
}

.galleryplus-selection-count {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-left: auto;
}

.galleryplus-btn {
    display: inline-block;
    padding: 6px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.galleryplus-delete-btn {
    background: #d32f2f;
    color: #fff;
}

.galleryplus-delete-btn:hover {
    background: #b71c1c;
}

.galleryplus-delete-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.black-theme .galleryplus-selection-bar {
    background: #1c1c1c;
    border: 1px solid #333;
    color: #eee;
    box-shadow: none;
    border-radius: 10px;
}

.black-theme .galleryplus-select-all-label,
.black-theme .galleryplus-selection-count {
    color: #eee;
}

.black-theme .galleryplus-select-all-label .galleryplus-checkbox {
    background: #111;
    border-color: #666;
    box-shadow: none;
}

.black-theme .galleryplus-select-all-label > input[type="checkbox"]:checked + .galleryplus-checkbox {
    background: #d32f2f;
    border-color: #d32f2f;
}

/* --- Widget: Categories --- */
.galleryplus-widget-categories-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}
.galleryplus-widget-category-item {
    margin: 0;
    padding: 0;
    width: 100%;
}
.galleryplus-widget-category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: background 0.15s, color 0.15s;
    width: 100%;
    box-sizing: border-box;
}
.galleryplus-widget-category-item:first-child .galleryplus-widget-category-link {
    color: #ff5317;
}
.galleryplus-widget-category-link:hover {
    background: #f5f5f5;
    color: #ff5317;
}
.galleryplus-widget-category-link.active {
    color: #ff5317;
    font-weight: 600;
}
.galleryplus-widget-category-title {
    font-size: 14px;
}
.galleryplus-widget-category-count {
    font-size: 12px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

/* --- Tags --- */
.galleryplus-tags {
    margin-top: 6px;
    line-height: 1.6;
}
.galleryplus-tags a.galleryplus-tag-link,
.galleryplus-tags .tags_bar_link {
    display: inline-block;
    font-size: 12px;
    color: #666;
    background: #f0f0f0;
    padding: 2px 10px;
    border-radius: 12px;
    text-decoration: none;
    margin: 2px 4px 2px 0;
    transition: background 0.15s, color 0.15s;
}
.galleryplus-tags a.galleryplus-tag-link:hover,
.galleryplus-tags .tags_bar_link:hover {
    background: #e0e0e0;
    color: #333;
    text-decoration: none;
}
.galleryplus-tags--view {
    margin-bottom: 12px;
}
.galleryplus-tags--view a.galleryplus-tag-link,
.galleryplus-tags--view .tags_bar_link {
    font-size: 13px;
}
.galleryplus-album-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 2px;
    overflow: hidden;
    max-height: 40px;
    min-width: 0;
    width: 100%;
}
.galleryplus-album-tags a.galleryplus-tag-link,
.galleryplus-album-tags .tags_bar_link {
    font-size: 11px;
    color: #666;
    background: #f0f0f0;
    padding: 1px 8px;
    border-radius: 10px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}
.galleryplus-album-tags a.galleryplus-tag-link:hover,
.galleryplus-album-tags .tags_bar_link:hover {
    background: #e0e0e0;
    color: #333;
    text-decoration: none;
}
.galleryplus-album-cover .galleryplus-album-tags a.galleryplus-tag-link,
.galleryplus-album-cover .galleryplus-album-tags .tags_bar_link {
    color: rgba(255,255,255,.95);
    background: rgba(255,255,255,.22);
}
.galleryplus-album-cover .galleryplus-album-tags a.galleryplus-tag-link:hover,
.galleryplus-album-cover .galleryplus-album-tags .tags_bar_link:hover {
    color: #fff;
    background: rgba(255,255,255,.35);
}
.galleryplus-upload-item-tags {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.galleryplus-upload-item-tags:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.15rem rgba(0,123,255,.25);
}

.galleryplus-upload-dropzone.galleryplus-dropzone-compact {
    padding: 12px 16px;
    min-height: 0;
}
.galleryplus-upload-dropzone.galleryplus-dropzone-compact .galleryplus-upload-icon {
    display: none;
}
.galleryplus-upload-dropzone.galleryplus-dropzone-compact .galleryplus-upload-text {
    margin: 0;
    font-size: 14px;
}
.galleryplus-upload-dropzone.galleryplus-dropzone-compact .galleryplus-upload-hint {
    display: none;
}

.galleryplus-upload-item {
    position: relative;
    flex-wrap: wrap;
    align-items: flex-start;
}
.galleryplus-upload-item-coords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    align-items: center;
}
.galleryplus-upload-item-lat,
.galleryplus-upload-item-lon {
    display: none;
}
.galleryplus-upload-item-map-btn {
    white-space: nowrap;
}
.galleryplus-upload-item-remove {
    position: absolute;
    top: 4px;
    right: 6px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}
.galleryplus-upload-item-remove:hover {
    color: #c62828;
}
.galleryplus-upload-item-progress {
    flex-basis: 100%;
    margin-top: 4px;
}

.galleryplus-map-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.galleryplus-map-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
}
.galleryplus-map-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0,0,0,.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.galleryplus-map-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}
.galleryplus-map-modal-header strong {
    font-size: 15px;
    font-weight: 600;
    color: #222;
}
.galleryplus-map-modal-close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #888;
    padding: 0 4px;
}
.galleryplus-map-modal-close:hover {
    color: #c62828;
}
.galleryplus-map-modal-body {
    padding: 0;
}
.galleryplus-upload-map {
    width: 100%;
    height: 360px;
}
.galleryplus-map-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    background: #fafafa;
}
.galleryplus-map-modal-footer .button,
.galleryplus-map-modal-footer .button-submit,
.galleryplus-map-modal-footer .button-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border: none;
    border-radius: 10px;
    background: #ff5317;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none;
    appearance: none;
    -webkit-appearance: none;
}
.galleryplus-map-modal-footer .button:hover,
.galleryplus-map-modal-footer .button-submit:hover,
.galleryplus-map-modal-footer .button-cancel:hover {
    background: #e64a14;
    color: #fff;
}
.galleryplus-map-modal-footer .button-cancel {
    background: #6b7280;
}
.galleryplus-map-modal-footer .button-cancel:hover {
    background: #4b5563;
}

.black-theme .galleryplus-map-modal-dialog {
    background: #1e1e1e;
    border-color: #444;
    box-shadow: 0 16px 48px rgba(0,0,0,.6);
}
.black-theme .galleryplus-map-modal-header,
.black-theme .galleryplus-map-modal-footer {
    background: #222;
    border-color: #444;
}
.black-theme .galleryplus-map-modal-header strong {
    color: #eee;
}
.black-theme .galleryplus-map-modal-close {
    color: #aaa;
}
.black-theme .galleryplus-map-modal-close:hover {
    color: #ef5350;
}

/* Edit page */
.galleryplus-edit-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px;
}
.galleryplus-edit-photo {
    margin-bottom: 20px;
}
.galleryplus-edit-photo img {
    max-width: 100%;
    border-radius: 4px;
}
.galleryplus-edit-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}
.galleryplus-edit-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}
.galleryplus-edit-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 28px;
    padding-top: 8px;
}
.galleryplus-edit-field--exif input[readonly] {
    background: #f5f5f5;
    color: #555;
    cursor: default;
}
.galleryplus-edit-exif-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.galleryplus-edit-exif-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #333;
}
.galleryplus-edit-exif-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #c0392b;
    font-size: 13px;
    font-weight: 600;
}
.galleryplus-edit-exif-toggle input[type="checkbox"] {
    accent-color: #c0392b;
}
.galleryplus-edit-exif-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.galleryplus-edit-hint {
    display: block;
    margin-top: 4px;
    color: #888;
    font-size: 12px;
}

/* Edit page — black theme (цвета сайта) */
body.black-theme .galleryplus-edit-page .galleryplus-edit-field label,
body.black-theme .galleryplus-edit-page .galleryplus-edit-map-section h4,
body.black-theme .galleryplus-edit-page .galleryplus-edit-exif-header h3 {
    color: #ccc;
}

body.black-theme .galleryplus-edit-page .galleryplus-edit-field input,
body.black-theme .galleryplus-edit-page .galleryplus-edit-field textarea,
body.black-theme .galleryplus-edit-page .form-control {
    background: #222222 !important;
    border: 1px solid #3a3a3a !important;
    color: #eee !important;
    box-shadow: none !important;
    -webkit-text-fill-color: #eee !important;
    border-radius: 8px !important;
}

body.black-theme .galleryplus-edit-page .galleryplus-edit-field input::placeholder,
body.black-theme .galleryplus-edit-page .galleryplus-edit-field textarea::placeholder,
body.black-theme .galleryplus-edit-page .form-control::placeholder {
    color: #777 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #777 !important;
}

body.black-theme .galleryplus-edit-page .galleryplus-edit-field input:focus,
body.black-theme .galleryplus-edit-page .galleryplus-edit-field textarea:focus,
body.black-theme .galleryplus-edit-page .form-control:focus {
    border-color: #ff5317 !important;
    box-shadow: 0 0 0 2px rgba(255, 83, 23, .25) !important;
    outline: none !important;
    background: #222222 !important;
}

body.black-theme .galleryplus-edit-page .galleryplus-edit-field--exif input[readonly] {
    background: #1a1a1a !important;
    color: #999 !important;
    border-color: #333 !important;
    -webkit-text-fill-color: #999 !important;
}

body.black-theme .galleryplus-edit-page .galleryplus-edit-exif-section,
body.black-theme .galleryplus-edit-page .galleryplus-edit-map-section {
    color: #ddd;
}

/* Photo view */
.galleryplus-view-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 8px;
}
.galleryplus-view-nav--sidebar {
    display: flex;
    width: 100%;
    margin-bottom: 12px;
}
.galleryplus-view-nav--sidebar .galleryplus-nav-btn {
    flex: 1;
    text-align: center;
    justify-content: center;
}
@media (max-width: 640px) {
    .galleryplus-view-nav--sidebar {
        display: none;
    }
}
.galleryplus-nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid #ff5317;
    border-radius: 6px;
    background: #ff5317;
    color: #fff;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.galleryplus-nav-btn:hover {
    background: #e64a14;
    border-color: #e64a14;
    color: #fff;
}
.galleryplus-nav-btn:focus,
.galleryplus-nav-btn:focus-visible,
.galleryplus-nav-btn:active {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 83, 23, 0.55);
    color: #fff;
}

/* Map */
.galleryplus-map-wrap {
    max-width: 1280px;
    margin: 0 auto 24px;
    padding: 0 16px;
    box-sizing: border-box;
}
.galleryplus-map {
    width: 100%;
    height: 300px;
    border-radius: 6px;
    border: 1px solid #ddd;
    box-sizing: border-box;
}
.galleryplus-map-pin {
    background: none !important;
    border: none !important;
}
.galleryplus-map-pin svg {
    display: block;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35));
}
.galleryplus-map .leaflet-control-attribution,
.galleryplus-map-widget .leaflet-control-attribution {
    display: none !important;
}
.galleryplus-map-widget {
    width: 100%;
    min-height: 200px;
    border-radius: 6px;
    overflow: hidden;
    background: #e8eef5;
    position: relative;
    z-index: 0;
    isolation: isolate;
}
.galleryplus-map-widget .marker-cluster-small,
.galleryplus-map-widget .marker-cluster-medium,
.galleryplus-map-widget .marker-cluster-large,
.galleryplus-map .marker-cluster-small,
.galleryplus-map .marker-cluster-medium,
.galleryplus-map .marker-cluster-large {
    background-color: rgba(255, 83, 23, 0.55) !important;
}
.galleryplus-map-widget .marker-cluster-small div,
.galleryplus-map-widget .marker-cluster-medium div,
.galleryplus-map-widget .marker-cluster-large div,
.galleryplus-map .marker-cluster-small div,
.galleryplus-map .marker-cluster-medium div,
.galleryplus-map .marker-cluster-large div {
    background-color: rgba(255, 83, 23, 0.9) !important;
    color: #fff !important;
}
.widget .galleryplus-map-widget {
    margin: 0;
}
.galleryplus-map-popup .leaflet-popup-content-wrapper {
    text-align: center;
    padding: 0 !important;
    border-radius: 6px;
    overflow: hidden;
}
.galleryplus-map-popup .leaflet-popup-content {
    margin: 0 !important;
}
.galleryplus-map-popup-thumb {
    width: 120px;
    height: 90px;
    object-fit: cover;
    display: block;
    cursor: pointer;
}
.galleryplus-map-popup-link {
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    font-size: 13px;
}
.galleryplus-edit-map-section {
    margin-top: 16px;
}
.galleryplus-edit-map-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 10px;
    color: #333;
}
.galleryplus-edit-map-coords {
    display: none;
}
.galleryplus-edit-map-coords .galleryplus-edit-field {
    flex: 1;
}
/* ===== Full width in flex layout ===== */
/* Виджеты galleryplus растягиваются на всю ширину строки, даже если
   они размещены внутри flex-контейнера (например, в позиции "перед глубиномером") */
.icms-widget:has([class*="galleryplus-"]) {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    width: 100% !important;
}
/* Если такая обёртка сама лежит во flex-строке, разрешаем перенос,
   чтобы виджеты шли друг под другом, а не в одну строку */
.d-flex:has(.icms-widget [class*="galleryplus-"]):not(.flex-nowrap) {
    flex-wrap: wrap !important;
}
