/* UASEX — галерея фото / відео */
:root {
    --gl-bg: transparent;
    --gl-surface: rgba(26, 11, 46, 0.92);
    --gl-surface-2: rgba(22, 10, 37, 0.98);
    --gl-accent: #bc13fe;
    --gl-accent-2: #7c4dff;
    --gl-accent-soft: rgba(188, 19, 254, 0.14);
    --gl-border: rgba(188, 19, 254, 0.22);
    --gl-text: #ffffff;
    --gl-muted: rgba(189, 166, 213, 0.88);
    --gl-success: #00ff88;
    --gl-danger: #ff4d4d;
    --gl-radius: 20px;
    --gl-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

.gallery-page {
    max-width: 1140px;
    margin: 0 auto;
    padding: 8px 16px 56px;
    animation: gl-page-in 0.45s ease;
    /* дозволяє дочірнім overflow-x скролитись, а не розтягувати сторінку */
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    box-sizing: border-box;
    overflow-x: clip;
}

@keyframes gl-page-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.gallery-page--upload {
    max-width: 860px;
}

/* ── Tabs ── */
.gallery-tabs {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 18px;
    background: rgba(26, 11, 46, 0.75);
    border: 1px solid rgba(188, 19, 254, 0.28);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
    min-width: 0;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: none;
}

.gallery-tabs::-webkit-scrollbar {
    display: none;
}

.gallery-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: var(--gl-surface);
    border: 1px solid var(--gl-border);
    color: var(--gl-muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-tab:hover {
    color: #fff;
    border-color: rgba(188, 19, 254, 0.45);
    background: rgba(188, 19, 254, 0.1);
}

.gallery-tab.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--gl-accent) 0%, var(--gl-accent-2) 100%);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(188, 19, 254, 0.35);
}

.gallery-tab.is-upload {
    border-color: rgba(188, 19, 254, 0.35);
}

.gallery-tab.is-cabinet {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
    color: #e8dff5;
}

.gallery-tab.is-cabinet:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

@media (max-width: 640px) {
    .gallery-tab.is-cabinet {
        margin-left: 0;
    }
}

/* ── Hero ── */
.gallery-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 22px;
    padding: 28px 24px;
    border-radius: 24px;
    border: 1px solid rgba(188, 19, 254, 0.35);
    background:
        radial-gradient(circle at 100% 0%, rgba(188, 19, 254, 0.28) 0%, transparent 52%),
        radial-gradient(circle at 0% 100%, rgba(124, 77, 255, 0.18) 0%, transparent 48%),
        linear-gradient(145deg, rgba(42, 8, 69, 0.95) 0%, rgba(22, 10, 37, 0.98) 100%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(188, 19, 254, 0.7), transparent);
}

.gallery-hero__icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, rgba(188, 19, 254, 0.25), rgba(124, 77, 255, 0.15));
    border: 1px solid rgba(188, 19, 254, 0.45);
    color: #f3e8ff;
    box-shadow: 0 0 24px rgba(188, 19, 254, 0.35);
}

.gallery-hero h1 {
    margin: 0 0 6px;
    font-size: clamp(1.35rem, 4vw, 1.85rem);
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #fff;
}

.gallery-hero p {
    margin: 0;
    color: var(--gl-muted);
    font-size: 14px;
    line-height: 1.45;
}

.gallery-hero__tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 60, 120, 0.14);
    border: 1px solid rgba(255, 80, 140, 0.35);
    color: #ffb8d9;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gallery-hero__lead {
    max-width: 640px;
    font-size: 15px !important;
    line-height: 1.55 !important;
    color: rgba(220, 200, 240, 0.92) !important;
}

.gallery-page.is-video .gallery-hero__tag {
    background: rgba(217, 70, 239, 0.16);
    border-color: rgba(217, 70, 239, 0.4);
    color: #f5d0fe;
}

.gallery-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.gallery-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--gl-muted);
    font-size: 12px;
    font-weight: 700;
}

.gallery-stat strong {
    color: #fff;
}

/* ── Categories ── */
.gallery-cats {
    margin-bottom: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    background: var(--gl-surface);
    border: 1px solid var(--gl-border);
    position: relative;
    overflow: hidden;
    max-width: 100%;
    min-width: 0;
}

.gallery-cats::after {
    content: '';
    position: absolute;
    top: 36px;
    right: 0;
    bottom: 8px;
    width: 36px;
    pointer-events: none;
    background: linear-gradient(to left, rgba(26, 11, 46, 0.98) 20%, transparent);
    border-radius: 0 18px 18px 0;
}

.gallery-cats__label {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(188, 19, 254, 0.85);
}

.gallery-cats__scroll {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-bottom: 6px;
    margin: 0 -4px;
    padding-left: 4px;
    padding-right: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scroll-behavior: smooth;
}

.gallery-cats__scroll::-webkit-scrollbar {
    display: none;
}

/* ПК: видимий скролбар + grab-курсор */
@media (hover: hover) and (pointer: fine) {
    .gallery-cats__scroll,
    .gallery-tabs {
        scrollbar-width: thin;
        scrollbar-color: rgba(188, 19, 254, 0.65) rgba(255, 255, 255, 0.08);
        padding-bottom: 10px;
    }

    .gallery-cats__scroll::-webkit-scrollbar,
    .gallery-tabs::-webkit-scrollbar {
        display: block;
        height: 7px;
    }

    .gallery-cats__scroll::-webkit-scrollbar-track,
    .gallery-tabs::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.07);
        border-radius: 999px;
    }

    .gallery-cats__scroll::-webkit-scrollbar-thumb,
    .gallery-tabs::-webkit-scrollbar-thumb {
        background: linear-gradient(90deg, rgba(188, 19, 254, 0.75), rgba(124, 77, 255, 0.75));
        border-radius: 999px;
    }

    .gallery-cats__scroll.is-scrollable,
    .gallery-tabs.is-scrollable {
        cursor: grab;
    }

    .gallery-cats__scroll.is-scrollable.is-dragging,
    .gallery-tabs.is-scrollable.is-dragging {
        cursor: grabbing;
        user-select: none;
    }

    .gallery-page.is-video .gallery-cats__scroll::-webkit-scrollbar-thumb,
    .gallery-page.is-video .gallery-tabs::-webkit-scrollbar-thumb {
        background: linear-gradient(90deg, rgba(217, 70, 239, 0.8), rgba(99, 102, 241, 0.8));
    }

    .gallery-page.is-video .gallery-cats__scroll,
    .gallery-page.is-video .gallery-tabs {
        scrollbar-color: rgba(217, 70, 239, 0.65) rgba(255, 255, 255, 0.08);
    }
}

.gallery-pill {
    display: inline-flex;
    align-items: center;
    padding: 9px 15px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition: 0.2s ease;
    flex-shrink: 0;
}

.gallery-pill:hover {
    border-color: rgba(188, 19, 254, 0.35);
    background: rgba(188, 19, 254, 0.1);
}

.gallery-pill.is-active {
    background: #fff;
    color: #1a0829;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.15);
}

/* ── Filters ── */
.gallery-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    gap: 10px;
    margin-bottom: 24px;
    padding: 14px;
    border-radius: 18px;
    background: var(--gl-surface);
    border: 1px solid var(--gl-border);
}

.gallery-filters select {
    width: 100%;
    min-width: 0;
    background: rgba(13, 4, 21, 0.85);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 11px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s ease;
}

.gallery-filters select:focus {
    border-color: rgba(188, 19, 254, 0.45);
}

.gallery-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gl-accent), var(--gl-accent-2));
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 8px 22px rgba(188, 19, 254, 0.28);
    transition: filter 0.2s ease, transform 0.2s ease;
}

.gallery-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

/* ── Grid cards ── */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
}

.media-card {
    display: block;
    text-decoration: none;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(36, 16, 58, 0.95) 0%, rgba(22, 10, 37, 0.98) 100%);
    border: 1px solid rgba(188, 19, 254, 0.22);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.media-card:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: rgba(188, 19, 254, 0.65);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.48), 0 0 28px rgba(188, 19, 254, 0.18);
}

.media-card__thumb {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #000;
    overflow: hidden;
}

.media-card__thumb img,
.media-card__thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.media-card:hover .media-card__thumb img,
.media-card:hover .media-card__thumb video {
    transform: scale(1.06);
}

.media-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, transparent 45%);
    pointer-events: none;
}

.media-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    max-width: calc(100% - 20px);
    padding: 4px 9px;
    border-radius: 8px;
    background: rgba(188, 19, 254, 0.82);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(188, 19, 254, 0.88);
    color: #fff;
    font-size: 18px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    z-index: 2;
}

.media-card__lock {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    text-align: center;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
}

.media-card__lock i {
    font-size: 26px;
    opacity: 0.75;
}

.media-card__lock span {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    opacity: 0.9;
}

.media-card__body {
    padding: 13px 14px 14px;
}

.media-card__title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px;
    font-weight: 700;
}

.media-card__meta .views { color: #00d2ff; }
.media-card__meta .likes { color: #ff3d00; }
.media-card__meta .date {
    margin-left: auto;
    color: var(--gl-muted);
    font-size: 11px;
}

.media-card__cat {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gl-accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Pagination ── */
.gallery-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 40px 0 10px;
}

.gallery-pagination a,
.gallery-pagination span {
    min-width: 42px;
    height: 42px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--gl-surface);
    border: 1px solid var(--gl-border);
    color: #fff;
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
}

.gallery-pagination a.is-active {
    background: linear-gradient(135deg, var(--gl-accent), var(--gl-accent-2));
    border-color: transparent;
}

.gallery-pagination span.is-disabled {
    opacity: 0.35;
}

/* ── Empty ── */
.gallery-empty {
    text-align: center;
    padding: 70px 24px;
    border-radius: 24px;
    background: var(--gl-surface);
    border: 1px dashed var(--gl-border);
    color: var(--gl-muted);
}

.gallery-empty i {
    display: block;
    font-size: 42px;
    margin-bottom: 14px;
    opacity: 0.35;
}

.gallery-empty p {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.gallery-empty__hint {
    display: block;
    margin-top: 10px;
    font-size: 13px;
    color: var(--gl-muted);
    font-weight: 600;
}

/* ── Upload form ── */
.upload-shell {
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--gl-border);
    background: var(--gl-surface-2);
    box-shadow: var(--gl-shadow);
}

.upload-hero {
    padding: 28px 24px 22px;
    background:
        radial-gradient(circle at 100% 0%, rgba(188, 19, 254, 0.22) 0%, transparent 55%),
        linear-gradient(135deg, #2a0845 0%, #4a148c 100%);
    border-bottom: 1px solid var(--gl-border);
}

.upload-hero h1 {
    margin: 0 0 6px;
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
}

.upload-hero p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
}

.upload-body {
    padding: 24px;
}

.form-block {
    margin-bottom: 22px;
}

.form-block label {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-weight: 800;
    font-size: 13px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 13px 14px;
    color: #fff;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: rgba(188, 19, 254, 0.45);
    box-shadow: 0 0 0 3px rgba(188, 19, 254, 0.12);
}

.form-textarea {
    min-height: 90px;
    resize: vertical;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--gl-muted);
    line-height: 1.4;
}

.sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    padding: 14px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

.check-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 8px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.check-item:hover {
    background: rgba(188, 19, 254, 0.1);
}

.check-item input {
    width: 17px;
    height: 17px;
    accent-color: var(--gl-accent);
    cursor: pointer;
    flex-shrink: 0;
}

.check-item span {
    color: var(--gl-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
}

.file-drop {
    border: 2px dashed rgba(188, 19, 254, 0.28);
    border-radius: 18px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    background: rgba(188, 19, 254, 0.04);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.file-drop:hover {
    border-color: rgba(188, 19, 254, 0.55);
    background: rgba(188, 19, 254, 0.1);
    transform: translateY(-1px);
}

.file-drop i {
    display: block;
    font-size: 34px;
    color: var(--gl-accent);
    margin-bottom: 10px;
}

.file-drop__name {
    color: #fff;
    font-weight: 800;
    font-size: 14px;
}

.file-drop.is-selected .file-drop__name {
    color: var(--gl-success);
}

.btn-submit {
    width: 100%;
    min-height: 52px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--gl-accent), var(--gl-accent-2));
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(188, 19, 254, 0.32);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    filter: brightness(1.05);
}

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.flash-box {
    padding: 14px 16px;
    border-radius: 14px;
    margin-bottom: 18px;
    font-weight: 700;
    text-align: center;
    font-size: 14px;
}

.flash-box.is-error {
    background: rgba(255, 77, 77, 0.1);
    color: var(--gl-danger);
    border: 1px solid rgba(255, 77, 77, 0.25);
}

.flash-box.is-ok {
    background: rgba(0, 255, 136, 0.1);
    color: var(--gl-success);
    border: 1px solid rgba(0, 255, 136, 0.25);
}

.limit-box {
    padding: 24px;
    border-radius: 18px;
    text-align: center;
    line-height: 1.6;
    background: rgba(255, 82, 82, 0.08);
    border: 1px solid rgba(255, 82, 82, 0.22);
    color: #ffd7e5;
}

.limit-box h3 {
    margin: 0 0 10px;
    color: #fff;
}

.limit-box a {
    color: var(--gl-success);
    font-weight: 800;
    text-decoration: none;
}

.limit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.limit-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 14px;
    font-weight: 800;
    text-decoration: none;
}

.limit-actions .is-verify {
    background: rgba(0, 255, 136, 0.12);
    color: #d9ffe6;
    border: 1px solid rgba(0, 255, 136, 0.35);
}

.limit-actions .is-primary {
    background: var(--gl-accent);
    color: #fff;
}

.limit-hint {
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(188, 19, 254, 0.08);
    border: 1px solid var(--gl-border);
    color: var(--gl-muted);
    font-size: 13px;
    line-height: 1.5;
}

.limit-hint a {
    color: var(--gl-success);
    font-weight: 800;
    text-decoration: none;
}

/* ── My gallery manage ── */
.manage-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}

.manage-card {
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    overflow: hidden;
    background: var(--gl-surface);
    border: 1px solid var(--gl-border);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.manage-card:hover {
    border-color: rgba(188, 19, 254, 0.4);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.manage-card__thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background: #000;
    overflow: hidden;
}

.manage-card__thumb img,
.manage-card__thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
}

.manage-card:hover .manage-card__thumb img,
.manage-card:hover .manage-card__thumb video {
    transform: scale(1.04);
}

.state-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
}

.state-pending {
    background: rgba(255, 193, 7, 0.18);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.state-public {
    background: rgba(0, 255, 136, 0.14);
    color: var(--gl-success);
    border: 1px solid rgba(0, 255, 136, 0.28);
}

.manage-card__body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.manage-card__stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gl-muted);
    font-weight: 700;
}

.manage-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-top: auto;
}

.manage-delete-form {
    margin: 0;
}

.btn-save {
    border: none;
    border-radius: 12px;
    padding: 11px;
    background: linear-gradient(135deg, var(--gl-accent), var(--gl-accent-2));
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.btn-del {
    width: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 77, 77, 0.25);
    background: rgba(255, 77, 77, 0.08);
    color: var(--gl-danger);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-del:hover {
    background: var(--gl-danger);
    color: #fff;
}

.check-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gl-muted);
    font-weight: 600;
    cursor: pointer;
}

.check-inline input {
    width: 16px;
    height: 16px;
    accent-color: var(--gl-accent);
}

/* Preloader вимкнено — контент одразу видимий */
#page-preloader {
    display: none !important;
}

.gallery-content,
#gallery-content {
    opacity: 1;
}

/* ── Video theme tweak ── */
.gallery-page.is-video {
    --gl-accent: #d946ef;
    --gl-accent-2: #6366f1;
}

.gallery-page.is-video .media-card__play {
    background: rgba(99, 102, 241, 0.9);
}

@media (max-width: 900px) {
    .gallery-filters {
        grid-template-columns: 1fr 1fr;
    }

    .gallery-filters .gallery-btn {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 640px) {
    .gallery-page {
        padding: 4px 10px 36px;
        padding-bottom: calc(36px + env(safe-area-inset-bottom, 0px));
    }

    .gallery-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding: 10px 12px;
        margin-bottom: 14px;
        border-radius: 16px;
    }

    .gallery-tabs::-webkit-scrollbar {
        display: none;
    }

    .gallery-tab {
        flex-shrink: 0;
        scroll-snap-align: start;
        min-height: 44px;
        padding: 0 14px;
        font-size: 12px;
    }

    .gallery-tab.is-cabinet {
        margin-left: 0;
        width: auto;
    }

    .gallery-hero {
        padding: 20px 16px;
        border-radius: 20px;
        margin-bottom: 14px;
    }

    .gallery-hero__icon {
        width: 44px;
        height: 44px;
        font-size: 20px;
        margin-bottom: 10px;
    }

    .gallery-hero h1 {
        font-size: 1.25rem;
        line-height: 1.2;
    }

    .gallery-hero__lead {
        font-size: 13px !important;
        line-height: 1.5 !important;
    }

    .gallery-stats {
        gap: 6px;
        margin-top: 12px;
    }

    .gallery-stat {
        padding: 6px 10px;
        font-size: 11px;
    }

    .gallery-cats {
        padding: 12px;
        margin-bottom: 12px;
        border-radius: 16px;
    }

    .gallery-cats__scroll {
        margin: 0 -4px;
        padding: 0 4px 6px;
    }

    .gallery-pill {
        padding: 8px 12px;
        font-size: 11px;
    }

    .gallery-filters {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 8px;
        border-radius: 16px;
    }

    .gallery-filters--video {
        grid-template-columns: 1fr;
    }

    .gallery-filters select {
        min-height: 46px;
        font-size: 14px;
    }

    .gallery-btn {
        width: 100%;
        min-height: 48px;
        font-size: 14px;
    }

    .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .media-card {
        border-radius: 16px;
    }

    .media-card__thumb {
        aspect-ratio: 3 / 4;
    }

    .media-card__body {
        padding: 8px 9px 10px;
    }

    .media-card__title {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .media-card__meta {
        gap: 6px;
        padding-bottom: 6px;
        margin-bottom: 6px;
        font-size: 10px;
    }

    .media-card__meta .date {
        display: none;
    }

    .media-card__cat {
        font-size: 9px;
    }

    .media-card__play {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }

    .gallery-pagination {
        gap: 6px;
        margin-top: 28px;
    }

    .gallery-pagination a,
    .gallery-pagination span {
        min-width: 38px;
        height: 38px;
        font-size: 12px;
        border-radius: 10px;
    }

    .manage-grid {
        grid-template-columns: 1fr;
    }

    .upload-body {
        padding: 16px;
    }

    .upload-hero {
        padding: 22px 18px 18px;
    }

    .upload-hero h1 {
        font-size: 1.25rem;
    }

    .sections-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
        padding: 10px;
    }

    .check-item span {
        font-size: 11px;
    }

    .file-drop {
        padding: 28px 16px;
    }

    .btn-submit {
        min-height: 50px;
        font-size: 14px;
    }

    .gallery-empty {
        padding: 48px 18px;
        border-radius: 18px;
    }
}

/* ── Success page ── */
.gallery-success {
    max-width: 560px;
    margin: 48px auto 72px;
    padding: 44px 32px;
    text-align: center;
    border-radius: 28px;
    border: 1px solid var(--gl-border);
    background:
        radial-gradient(circle at 50% 0%, rgba(0, 255, 136, 0.12) 0%, transparent 55%),
        var(--gl-surface-2);
    box-shadow: var(--gl-shadow);
}

.gallery-success__icon {
    font-size: 64px;
    color: var(--gl-success);
    margin-bottom: 18px;
    text-shadow: 0 0 24px rgba(0, 255, 136, 0.35);
}

.gallery-success h1 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 1.6rem;
    font-weight: 900;
}

.gallery-success p {
    margin: 0;
    color: var(--gl-muted);
    font-size: 1rem;
    line-height: 1.6;
}

.gallery-success__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
}

.gallery-success__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 14px;
    font-weight: 800;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.2s ease, background 0.2s ease;
}

.gallery-success__btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
}

.gallery-success__btn.is-primary {
    background: linear-gradient(135deg, var(--gl-accent), var(--gl-accent-2));
    border-color: transparent;
    box-shadow: 0 8px 22px rgba(188, 19, 254, 0.3);
}

.gallery-page.is-video .gallery-success__btn.is-primary {
    box-shadow: 0 8px 22px rgba(217, 70, 239, 0.3);
}

/* Відео: фільтри без «Хто на фото» */
.gallery-filters--video {
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
}

/* ===== Секс-історії ===== */
.gallery-hero--story .gallery-hero__icon {
    color: #f0abfc;
}

.story-list {
    display: grid;
    gap: 16px;
}

.story-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    border-radius: 20px;
    border: 1px solid rgba(188, 19, 254, 0.16);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    overflow: hidden;
}

.story-card:has(.story-card__photo) {
    grid-template-columns: 140px minmax(0, 1fr);
}

.story-card__photo img {
    width: 100%;
    height: 100%;
    min-height: 140px;
    object-fit: cover;
    display: block;
}

.story-card__body {
    padding: 18px 20px;
    min-width: 0;
}

.story-card__top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.story-card__cat {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    color: #f5d7ff;
    background: rgba(188, 19, 254, 0.14);
    text-decoration: none;
}

.story-card__date {
    font-size: 12px;
    color: var(--gl-muted);
}

.story-card__title {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.25;
}

.story-card__title a {
    color: #fff;
    text-decoration: none;
}

.story-card__title a:hover {
    color: #f0abfc;
}

.story-card__excerpt {
    margin: 0 0 14px;
    color: #d8c8ea;
    line-height: 1.6;
    font-size: 14px;
}

.story-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: var(--gl-muted);
    margin-bottom: 12px;
}

.story-card__author {
    color: #f3e8ff;
    font-weight: 700;
}

.story-card__more {
    font-size: 13px;
    font-weight: 800;
    color: var(--gl-accent-2);
    text-decoration: none;
}

.story-stars {
    display: inline-flex;
    gap: 2px;
    color: #ffd76a;
}

.story-stars--sm {
    font-size: 11px;
}

.story-form__body {
    min-height: 280px;
}

.form-label {
    display: block;
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 800;
    color: #eadcf8;
}

.form-req {
    font-size: 11px;
    color: var(--gl-muted);
    font-weight: 600;
}

.story-manage-list {
    display: grid;
    gap: 16px;
}

.story-manage-card {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(188, 19, 254, 0.16);
    background: rgba(255, 255, 255, 0.03);
}

.story-manage-card__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.story-manage-card__cat {
    margin-left: 8px;
    font-size: 12px;
    color: var(--gl-muted);
}

.story-manage-card__open {
    font-size: 13px;
    font-weight: 700;
    color: var(--gl-accent-2);
    text-decoration: none;
}

.story-manage-card__excerpt {
    margin: 10px 0;
    font-size: 13px;
    color: var(--gl-muted);
    line-height: 1.5;
}

.story-manage-card__stats {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--gl-muted);
    margin-top: 8px;
}

.story-breadcrumb {
    margin-bottom: 16px;
    font-size: 13px;
}

.story-breadcrumb a {
    color: var(--gl-muted);
    text-decoration: none;
}

.story-breadcrumb a:hover {
    color: #fff;
}

.story-view__head {
    margin-bottom: 22px;
}

.story-view__cat {
    display: inline-flex;
    margin-bottom: 10px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(188, 19, 254, 0.14);
    color: #f5d7ff;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.story-view__head h1 {
    margin: 0 0 12px;
    font-size: clamp(26px, 4vw, 38px);
    line-height: 1.15;
}

.story-view__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--gl-muted);
    font-size: 13px;
}

.story-view__photo {
    margin: 0 0 24px;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(188, 19, 254, 0.16);
}

.story-view__photo img {
    width: 100%;
    max-height: 520px;
    object-fit: cover;
    display: block;
}

.story-view__body {
    font-size: 16px;
    line-height: 1.75;
    color: #efe6f8;
    margin-bottom: 28px;
    white-space: normal;
}

.story-rating-box,
.story-comments {
    margin-top: 28px;
    padding: 22px;
    border-radius: 18px;
    border: 1px solid rgba(188, 19, 254, 0.16);
    background: rgba(0, 0, 0, 0.18);
}

.story-rating-box h2,
.story-comments h2 {
    margin: 0 0 14px;
    font-size: 20px;
}

.story-rating-display {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.story-rating-value {
    font-size: 24px;
    font-weight: 900;
    color: #ffd76a;
}

.story-rating-count {
    color: var(--gl-muted);
    font-size: 13px;
}

.story-rate-stars {
    display: flex;
    gap: 6px;
}

.story-rate-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 215, 106, 0.25);
    background: rgba(255, 215, 106, 0.06);
    color: #8a7340;
    cursor: pointer;
}

.story-rate-btn.is-on {
    background: rgba(255, 215, 106, 0.18);
    color: #ffd76a;
    border-color: rgba(255, 215, 106, 0.45);
}

.story-comment-form textarea {
    width: 100%;
    min-height: 110px;
    margin-bottom: 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    padding: 14px;
    box-sizing: border-box;
}

.story-comment-list {
    margin-top: 18px;
    display: grid;
    gap: 12px;
}

.story-comment {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.story-comment__head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--gl-muted);
}

.story-comment__head strong {
    color: #fff;
}

.story-comment-delete button {
    border: none;
    background: none;
    color: #ff8a8a;
    cursor: pointer;
    font-size: 12px;
    padding: 0;
}

.story-comment-login,
.story-rating-hint {
    color: var(--gl-muted);
    font-size: 14px;
}

.story-ad-box {
    margin-top: 20px;
    padding: 16px;
    border-radius: 14px;
    border: 1px dashed rgba(188, 19, 254, 0.25);
}

.story-ad-box__label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gl-accent-2);
    margin-bottom: 6px;
}

.story-ad-box__link {
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

@media (max-width: 720px) {
    .story-card:has(.story-card__photo) {
        grid-template-columns: 1fr;
    }

    .story-card__photo img {
        min-height: 180px;
    }
}
