.gallery-publish-overlay[hidden] {
    display: none !important;
}

.gallery-publish-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

body.gallery-publish-open {
    overflow: hidden;
}

.gallery-work-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
    margin-bottom: 12px;
    color: #fff;
}

.gallery-work-copy strong,
.gallery-work-copy span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-work-copy strong {
    font-size: 14px;
    line-height: 1.4;
}

.gallery-work-copy span {
    color: rgba(255, 255, 255, 0.76);
    font-size: 11px;
}

.favorite-card-title {
    display: block;
    overflow: hidden;
    color: var(--text-title, #111827);
    font-size: 14px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-gallery-modal {
    width: min(960px, 94vw) !important;
    max-width: 960px !important;
}

.profile-gallery-subtitle {
    margin-top: 5px;
    color: var(--text-muted, #7b8798);
    font-size: 12px;
}

.profile-gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.profile-gallery-toolbar > span {
    color: var(--text-muted, #7b8798);
    font-size: 12px;
}

.profile-gallery-toolbar > button {
    min-height: 36px;
    padding: 0 14px;
    color: #fff;
    background: linear-gradient(135deg, #5b5ce2, #7c3aed);
    border: 0;
    border-radius: 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 760;
    cursor: pointer;
}

.profile-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.profile-gallery-empty {
    grid-column: 1 / -1;
    display: grid;
    min-height: 220px;
    place-items: center;
    align-content: center;
    gap: 7px;
    color: var(--text-muted, #7b8798);
    background: var(--bg-element, #f5f7fa);
    border: 1px dashed var(--border-subtle, #dfe5ee);
    border-radius: 16px;
    font-size: 13px;
    text-align: center;
}

.profile-gallery-empty strong {
    color: var(--text-title, #1f2937);
    font-size: 15px;
}

.profile-gallery-empty.is-error {
    color: #ef4444;
}

.profile-gallery-card {
    min-width: 0;
    overflow: hidden;
    background: var(--bg-element, #f7f8fb);
    border: 1px solid var(--border-subtle, #e2e8f0);
    border-radius: 16px;
}

.profile-gallery-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    padding: 0;
    background: #e5e7eb;
    border: 0;
    cursor: pointer;
}

.profile-gallery-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease;
}

.profile-gallery-card:hover .profile-gallery-media img {
    transform: scale(1.025);
}

.profile-gallery-status {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 8px;
    color: #fff;
    background: #f59e0b;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 780;
}

.profile-gallery-status.is-published {
    background: #10b981;
}

.profile-gallery-status.is-rejected {
    background: #ef4444;
}

.profile-gallery-body {
    display: grid;
    gap: 9px;
    padding: 13px;
}

.profile-gallery-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.profile-gallery-card-head strong {
    min-width: 0;
    overflow: hidden;
    color: var(--text-title, #1f2937);
    font-size: 14px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-gallery-card-head span {
    flex: 0 0 auto;
    padding: 3px 6px;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 999px;
    font-size: 9px;
}

.profile-gallery-body p {
    min-height: 36px;
    margin: 0;
    overflow: hidden;
    color: var(--text-body, #667085);
    font-size: 11px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.profile-gallery-reason {
    padding: 7px 8px;
    color: #dc2626;
    background: rgba(239, 68, 68, 0.08);
    border-radius: 8px;
    font-size: 10px;
    line-height: 1.5;
}

.profile-gallery-meta,
.profile-gallery-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.profile-gallery-meta {
    color: var(--text-muted, #98a2b3);
    font-size: 10px;
}

.profile-gallery-actions button {
    flex: 1;
    min-height: 32px;
    color: var(--text-title, #344054);
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-subtle, #dfe5ee);
    border-radius: 9px;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.profile-gallery-actions button.danger {
    color: #dc2626;
}

.gallery-publish-dialog {
    width: min(920px, 100%);
    max-height: min(90vh, 820px);
    overflow: auto;
    color: #172033;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 24px;
    box-shadow: 0 32px 100px rgba(15, 23, 42, 0.28);
    animation: gallery-publish-enter 180ms ease-out;
}

.gallery-publish-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 24px 28px 20px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid #edf0f5;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.gallery-publish-head h2 {
    margin: 0;
    color: #111827;
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.gallery-publish-head p {
    margin: 7px 0 0;
    color: #738096;
    font-size: 13px;
    line-height: 1.6;
}

.gallery-publish-close {
    flex: 0 0 auto;
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    color: #64748b;
    background: #f4f6f9;
    border: 1px solid #e8ecf2;
    border-radius: 12px;
    cursor: pointer;
    transition: 150ms ease;
}

.gallery-publish-close:hover {
    color: #111827;
    background: #eceff4;
    transform: translateY(-1px);
}

.gallery-publish-close svg,
.gallery-publish-submit svg,
.gallery-publish-review-note svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gallery-publish-form {
    padding: 26px 28px 24px;
}

.gallery-publish-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.88fr) minmax(340px, 1.12fr);
    gap: 28px;
    align-items: start;
}

.gallery-publish-media-column,
.gallery-publish-fields {
    min-width: 0;
}

.gallery-publish-dropzone {
    position: relative;
    display: grid;
    min-height: 430px;
    overflow: hidden;
    place-items: center;
    background:
        radial-gradient(circle at 20% 15%, rgba(99, 102, 241, 0.14), transparent 34%),
        linear-gradient(145deg, #f8f9ff, #f5f7fb 65%, #f1f5f9);
    border: 1.5px dashed #c9d1df;
    border-radius: 20px;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.gallery-publish-dropzone:hover,
.gallery-publish-dropzone.is-dragging {
    background:
        radial-gradient(circle at 20% 15%, rgba(99, 102, 241, 0.2), transparent 38%),
        linear-gradient(145deg, #f7f7ff, #eef2ff 70%, #f1f5f9);
    border-color: #818cf8;
    transform: translateY(-1px);
}

.gallery-publish-dropzone.is-invalid {
    border-color: #ef4444;
    background: #fff7f7;
}

.gallery-publish-dropzone > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.gallery-publish-empty {
    display: grid;
    max-width: 250px;
    padding: 28px;
    place-items: center;
    text-align: center;
}

.gallery-publish-empty i {
    display: grid;
    width: 60px;
    height: 60px;
    margin-bottom: 18px;
    place-items: center;
    color: #4f46e5;
    background: #e9eaff;
    border: 1px solid #dcdfff;
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(79, 70, 229, 0.14);
}

.gallery-publish-empty svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gallery-publish-empty strong {
    color: #253047;
    font-size: 15px;
    line-height: 1.5;
}

.gallery-publish-empty small {
    margin-top: 9px;
    color: #8490a3;
    font-size: 12px;
    line-height: 1.6;
}

.gallery-publish-preview {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9edf3;
}

.gallery-publish-preview[hidden] {
    display: none !important;
}

.gallery-publish-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-publish-preview em {
    position: absolute;
    right: 12px;
    bottom: 12px;
    max-width: calc(100% - 24px);
    overflow: hidden;
    padding: 6px 10px;
    color: #fff;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    font-size: 11px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.gallery-publish-media-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 4px 0;
}

.gallery-publish-media-actions button {
    padding: 0;
    color: #4f46e5;
    background: none;
    border: 0;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.gallery-publish-media-actions span {
    color: #909bad;
    font-size: 11px;
    text-align: right;
}

.gallery-publish-fields {
    display: grid;
    gap: 18px;
}

.gallery-publish-field {
    position: relative;
    display: grid;
    gap: 8px;
}

.gallery-publish-field > span {
    color: #344054;
    font-size: 13px;
    font-weight: 750;
}

.gallery-publish-field > span em {
    color: #ef4444;
    font-style: normal;
}

.gallery-publish-field input,
.gallery-publish-field select,
.gallery-publish-field textarea {
    width: 100%;
    min-width: 0;
    color: #182033;
    background: #f8fafc;
    border: 1px solid #dfe5ee;
    border-radius: 13px;
    outline: none;
    font: inherit;
    font-size: 13px;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.gallery-publish-field input,
.gallery-publish-field select {
    min-height: 46px;
    padding: 0 42px 0 14px;
}

.gallery-publish-field select {
    padding-right: 14px;
}

.gallery-publish-field textarea {
    min-height: 158px;
    padding: 13px 14px 30px;
    line-height: 1.65;
    resize: vertical;
}

.gallery-publish-field input:focus,
.gallery-publish-field select:focus,
.gallery-publish-field textarea:focus {
    background: #fff;
    border-color: #818cf8;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.gallery-publish-field.is-invalid input,
.gallery-publish-field.is-invalid select,
.gallery-publish-field.is-invalid textarea {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08);
}

.gallery-publish-field > small {
    position: absolute;
    right: 12px;
    bottom: 14px;
    color: #98a2b3;
    font-size: 10px;
    pointer-events: none;
}

.gallery-publish-field > small b {
    color: inherit;
    font-weight: 650;
}

.gallery-publish-prompt-field > small {
    bottom: 11px;
}

.gallery-publish-privacy-options {
    display: grid;
    gap: 10px;
}

.gallery-publish-privacy-options label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
    padding: 12px 13px;
    background: #f8fafc;
    border: 1px solid #e3e8ef;
    border-radius: 13px;
    cursor: pointer;
}

.gallery-publish-privacy-options input[type="hidden"] {
    display: none;
}

.gallery-publish-privacy-options input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: #6366f1;
}

.gallery-publish-privacy-options span {
    display: grid;
    gap: 3px;
}

.gallery-publish-privacy-options strong {
    color: #344054;
    font-size: 12px;
}

.gallery-publish-privacy-options small {
    color: #7b8798;
    font-size: 11px;
    line-height: 1.55;
}

.gallery-publish-review-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    color: #64748b;
    background: #f7f8ff;
    border: 1px solid #e4e7ff;
    border-radius: 13px;
    font-size: 12px;
    line-height: 1.6;
}

.gallery-publish-review-note svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    color: #6366f1;
}

.gallery-publish-feedback {
    min-height: 20px;
    margin-top: 16px;
    color: #667085;
    font-size: 12px;
    line-height: 1.6;
}

.gallery-publish-feedback:empty {
    min-height: 0;
    margin-top: 0;
}

.gallery-publish-feedback.is-error {
    color: #dc2626;
}

.gallery-publish-feedback.is-success {
    color: #059669;
}

.gallery-publish-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding-top: 20px;
    border-top: 1px solid #edf0f5;
}

.gallery-publish-actions button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    border-radius: 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 780;
    cursor: pointer;
    transition: 150ms ease;
}

.gallery-publish-cancel {
    color: #5f6b7d;
    background: #f5f7fa;
    border: 1px solid #e5e9f0;
}

.gallery-publish-cancel:hover {
    color: #273244;
    background: #eef1f5;
}

.gallery-publish-submit {
    min-width: 138px;
    color: #fff;
    background: linear-gradient(135deg, #ff8a3d 0%, #ff5f57 52%, #f43f5e 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 24px rgba(244, 63, 94, 0.24);
}

.gallery-publish-submit:hover:not(:disabled) {
    filter: saturate(1.06) brightness(1.03);
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(244, 63, 94, 0.32);
}

.gallery-publish-submit:disabled {
    cursor: wait;
    opacity: 0.68;
}

.gallery-publish-submit.is-loading svg {
    animation: gallery-publish-spin 850ms linear infinite;
}

.gallery-publish-close:focus-visible,
.gallery-publish-actions button:focus-visible,
.gallery-publish-media-actions button:focus-visible,
.gallery-publish-dropzone:focus-within {
    outline: 3px solid rgba(99, 102, 241, 0.24);
    outline-offset: 2px;
}

html[data-theme="dark"] .gallery-publish-dialog,
body.dark-mode .gallery-publish-dialog {
    color: #e5e7eb;
    background: rgba(17, 24, 39, 0.98);
    border-color: rgba(148, 163, 184, 0.2);
}

html[data-theme="dark"] .gallery-publish-head,
body.dark-mode .gallery-publish-head {
    background: rgba(17, 24, 39, 0.94);
    border-color: #293244;
}

html[data-theme="dark"] .gallery-publish-head h2,
body.dark-mode .gallery-publish-head h2,
html[data-theme="dark"] .gallery-publish-empty strong,
body.dark-mode .gallery-publish-empty strong,
html[data-theme="dark"] .gallery-publish-field > span,
body.dark-mode .gallery-publish-field > span {
    color: #f8fafc;
}

html[data-theme="dark"] .gallery-publish-head p,
body.dark-mode .gallery-publish-head p,
html[data-theme="dark"] .gallery-publish-media-actions span,
body.dark-mode .gallery-publish-media-actions span {
    color: #94a3b8;
}

html[data-theme="dark"] .gallery-publish-close,
body.dark-mode .gallery-publish-close,
html[data-theme="dark"] .gallery-publish-cancel,
body.dark-mode .gallery-publish-cancel {
    color: #cbd5e1;
    background: #20293a;
    border-color: #303a4e;
}

html[data-theme="dark"] .gallery-publish-dropzone,
body.dark-mode .gallery-publish-dropzone {
    background:
        radial-gradient(circle at 20% 15%, rgba(99, 102, 241, 0.2), transparent 36%),
        linear-gradient(145deg, #1b2434, #151d2b 70%, #111827);
    border-color: #475569;
}

html[data-theme="dark"] .gallery-publish-field input,
html[data-theme="dark"] .gallery-publish-field select,
html[data-theme="dark"] .gallery-publish-field textarea,
body.dark-mode .gallery-publish-field input,
body.dark-mode .gallery-publish-field select,
body.dark-mode .gallery-publish-field textarea {
    color: #f8fafc;
    background: #171f2e;
    border-color: #344055;
}

html[data-theme="dark"] .gallery-publish-review-note,
body.dark-mode .gallery-publish-review-note {
    color: #aeb9c9;
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(129, 140, 248, 0.24);
}

html[data-theme="dark"] .gallery-publish-actions,
body.dark-mode .gallery-publish-actions {
    border-color: #293244;
}

@keyframes gallery-publish-enter {
    from { opacity: 0; transform: translateY(10px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@media (max-width: 760px) {
    .profile-gallery-modal {
        width: 100% !important;
        max-width: 100% !important;
    }

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

    .gallery-publish-overlay {
        align-items: end;
        padding: 0;
    }

    .gallery-publish-dialog {
        width: 100%;
        max-height: 96dvh;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 22px 22px 0 0;
    }

    .gallery-publish-head {
        padding: 19px 18px 16px;
    }

    .gallery-publish-head h2 {
        font-size: 21px;
    }

    .gallery-publish-head p {
        max-width: 280px;
        font-size: 12px;
    }

    .gallery-publish-form {
        padding: 18px;
    }

    .gallery-publish-layout {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .gallery-publish-dropzone {
        min-height: min(52vh, 360px);
    }

    .gallery-publish-media-actions span {
        max-width: 220px;
    }
}

@media (max-width: 420px) {
    .gallery-publish-overlay {
        background: rgba(15, 23, 42, 0.72);
    }

    .gallery-publish-head p {
        display: none;
    }

    .gallery-publish-dropzone {
        min-height: 290px;
    }

    .gallery-publish-media-actions span {
        display: none;
    }

    .gallery-publish-actions {
        position: sticky;
        bottom: -18px;
        margin-right: -18px;
        margin-left: -18px;
        padding: 16px 18px 18px;
        background: inherit;
    }

    .gallery-publish-actions button {
        flex: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-publish-dialog,
    .gallery-publish-submit,
    .gallery-publish-close,
    .gallery-publish-dropzone {
        animation: none;
        transition: none;
    }
}