











:is(.gallery-page, .gallery-move-overlay, .gallery-picker-overlay) {
    --gal-accent: #9b7650;
    --gal-accent-soft: rgba(155, 118, 80, 0.13);
    --gal-on-accent: #fff;

    --gal-ink: #403329;
    --gal-sub: #968477;
    --gal-muted: #b3a698;

    --gal-card: #fdfbf7;
    --gal-fill: #f3ede4;
    --gal-hair: #e8dfd3;
    --gal-line: #d8cbbb;

    --gal-page-bg: linear-gradient(180deg, #f8f2eb, #eee5da);
    
    --gal-skel-a: #f3ede4;
    --gal-skel-b: #fbf8f2;

    --gal-danger: #e53935;
    --gal-on-danger: #fff;
}




html[data-theme="mauve"] :is(.gallery-page, .gallery-move-overlay, .gallery-picker-overlay) {
    --gal-accent: #76566b;
    --gal-accent-soft: rgba(118, 86, 107, 0.13);
    --gal-ink: #29262b;
    --gal-sub: #817a80;
    --gal-muted: #aaa2a8;
    --gal-card: #fbfaf9;
    --gal-fill: #f0eeed;
    --gal-hair: #e5dfe2;
    --gal-line: #c8bcc3;
    --gal-page-bg: linear-gradient(180deg, #f6f3f4, #efecec);
    --gal-skel-a: #f0eeed;
    --gal-skel-b: #f8f5f6;
}


html[data-theme="cool"] :is(.gallery-page, .gallery-move-overlay, .gallery-picker-overlay) {
    --gal-accent: #5f879b;
    --gal-accent-soft: rgba(95, 135, 155, 0.13);
    --gal-ink: #293b45;
    --gal-sub: #778892;
    --gal-muted: #9fb0b8;
    --gal-card: #fbfdfe;
    --gal-fill: #eef3f6;
    --gal-hair: #dbe4e9;
    --gal-line: #b8c8d1;
    --gal-page-bg: linear-gradient(180deg, #f0f4f6, #e6edf0);
    --gal-skel-a: #eef3f6;
    --gal-skel-b: #f8fbfc;
}


html[data-theme="pink"] :is(.gallery-page, .gallery-move-overlay, .gallery-picker-overlay) {
    --gal-accent: #ad718b;
    --gal-accent-soft: rgba(173, 113, 139, 0.13);
    --gal-ink: #49323d;
    --gal-sub: #9a7e8a;
    --gal-muted: #bfa8b1;
    --gal-card: #fdfbfc;
    --gal-fill: #f7edf2;
    --gal-hair: #eedbe4;
    --gal-line: #d8bcc8;
    --gal-page-bg: linear-gradient(180deg, #fbf1f5, #f4e3ea);
    --gal-skel-a: #f7edf2;
    --gal-skel-b: #fcf5f8;
}


html[data-theme="geo"] :is(.gallery-page, .gallery-move-overlay, .gallery-picker-overlay) {
    --gal-accent: #74799c;
    --gal-accent-soft: rgba(116, 121, 156, 0.13);
    --gal-ink: #383a50;
    --gal-sub: #85869d;
    --gal-muted: #a7a8bd;
    --gal-card: #fbfbfd;
    --gal-fill: #eff0f5;
    --gal-hair: #e0e1ea;
    --gal-line: #c2c3d4;
    --gal-page-bg:
        linear-gradient(rgba(85, 88, 125, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(85, 88, 125, 0.045) 1px, transparent 1px),
        #f0f1f5;
    --gal-page-bg-size: 28px 28px;
    --gal-skel-a: #eff0f5;
    --gal-skel-b: #f8f8fc;
}


html[data-theme="clean"] :is(.gallery-page, .gallery-move-overlay, .gallery-picker-overlay) {
    --gal-accent: #666;
    --gal-accent-soft: rgba(102, 102, 102, 0.1);
    --gal-ink: #292929;
    --gal-sub: #808080;
    --gal-muted: #ababab;
    --gal-card: #fff;
    --gal-fill: #f5f5f5;
    --gal-hair: #e3e3e3;
    --gal-line: #c6c6c6;
    --gal-page-bg: #f4f4f5;
    --gal-skel-a: #f5f5f5;
    --gal-skel-b: #fafafa;
}


html[data-theme="dark"] :is(.gallery-page, .gallery-move-overlay, .gallery-picker-overlay) {
    --gal-accent: #e0b07a;
    --gal-accent-soft: rgba(224, 176, 122, 0.16);
    --gal-on-accent: #2b2228;

    --gal-ink: #eceaec;
    --gal-sub: #a6a0a6;
    --gal-muted: #7d767d;

    --gal-card: #262429;
    --gal-fill: #2e2c32;
    --gal-hair: rgba(255, 255, 255, 0.11);
    --gal-line: rgba(255, 255, 255, 0.2);

    --gal-page-bg: linear-gradient(180deg, #232127, #1a191e);
    --gal-skel-a: #2e2c32;
    --gal-skel-b: #3a3840;

    --gal-danger: #d98b8d;
    --gal-on-danger: #2b2228;
}


.gallery-page {
    background: var(--gal-page-bg);
    background-size: var(--gal-page-bg-size, auto);
    color: var(--gal-ink);
}

.gallery-page .screen-header {
    background: transparent;
    border-bottom-color: var(--gal-hair);
}


.gallery-list-card {
    padding: 0;
}

.gallery-album-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--gal-hair);
}

.gallery-album-row:active {
    background: var(--gal-fill);
}


.gallery-album-cover {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    background: var(--gal-fill);
    color: var(--gal-muted);
}

.gallery-album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 !important;   
}

.gallery-album-cover svg {
    width: 24px;
    height: 24px;
}

.gallery-album-meta {
    flex: 1;
    min-width: 0;
}

.gallery-album-name {
    overflow: hidden;
    color: var(--gal-ink);
    font-size: 15px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-album-count {
    margin-top: 2px;
    color: var(--gal-sub);
    font-size: 12px;
}

.gallery-album-chevron {
    flex: none;
    color: var(--gal-muted);
    font-size: 18px;
}


.gallery-add-album {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    color: var(--gal-accent);
}

.gallery-add-icon {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px dashed var(--gal-line);
    border-radius: 14px;
    box-sizing: border-box;
    font-size: 22px;
}

.gallery-add-text {
    font-size: 15px;
    font-weight: 600;
}


.gallery-add-btn {
    width: 100%;
    margin-bottom: 16px;
    padding: 10px;
    border: none;
    border-radius: 16px;
    color: var(--gal-on-accent);
    background: var(--gal-accent);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.gallery-add-btn:active {
    opacity: 0.9;
}

.gallery-note {
    margin-bottom: 12px;
    color: var(--gal-sub);
    font-size: 13px;
}

.gallery-empty {
    padding: 34px 0;
    color: var(--gal-sub);
    text-align: center;
}

.gallery-empty svg {
    width: 40px;
    height: 40px;
    margin-bottom: 10px;
    color: var(--gal-muted);
}

.gallery-empty p {
    font-size: 13px;
}



.gallery-img-ph {
    width: 100%;
    height: 100%;
    background: linear-gradient(100deg, var(--gal-skel-a) 30%, var(--gal-skel-b) 50%, var(--gal-skel-a) 70%);
    background-size: 220% 100%;
    animation: gallery-skeleton 1.3s ease-in-out 6;
}

@keyframes gallery-skeleton {
    from { background-position: 220% 0; }
    to { background-position: -220% 0; }
}


.gallery-album-cover img,
.gallery-tile img {
    animation: gallery-img-in 0.18s ease;
}

@keyframes gallery-img-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gallery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
}

.gallery-tile {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    background: var(--gal-fill);
}


.gallery-tile-btn {
    position: absolute;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.gallery-tile-btn--tr { top: 4px; right: 4px; }
.gallery-tile-btn--tl { top: 4px; left: 4px; }
.gallery-tile-btn--br { bottom: 4px; right: 4px; }

.gallery-tile-btn--danger {
    color: var(--gal-on-danger);
    background: var(--gal-danger);
    font-size: 14px;
}

.gallery-pet-btn {
    position: absolute;
    bottom: 4px;
    left: 4px;
    width: auto;
    height: 24px;
    padding: 0 8px;
    border: none;
    border-radius: 4px;
    color: #fff;
    background: rgba(255, 152, 0, 0.85);
    cursor: pointer;
    font-size: 10px;
    font-weight: 600;
    line-height: 24px;
}


.gallery-image-preview {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.gallery-preview-img {
    max-width: 90%;
    max-height: 85%;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    object-fit: contain;
    cursor: default;
    transition: opacity 0.2s;
}

.gallery-preview-loading {
    position: absolute;
    color: #fff;
    font-size: 14px;
}


.gallery-move-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.gallery-move-panel {
    width: 280px;
    max-height: 60%;
    padding: 20px;
    overflow-y: auto;
    border-radius: 20px;
    background: var(--gal-card);
    color: var(--gal-ink);
}

.gallery-move-title {
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.gallery-move-target {
    margin-bottom: 6px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--gal-fill);
    cursor: pointer;
    font-size: 14px;
}

.gallery-move-target:active {
    background: var(--gal-accent-soft);
}

.gallery-move-cancel {
    margin-top: 6px;
    padding: 10px 14px;
    border-radius: 12px;
    color: var(--gal-sub);
    cursor: pointer;
    text-align: center;
    font-size: 14px;
}


.gallery-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
}

.gallery-picker-panel {
    width: 300px;
    max-height: 70%;
    padding: 16px;
    overflow-y: auto;
    border-radius: 20px;
    background: var(--gal-card);
    color: var(--gal-ink);
}

.gallery-picker-title {
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.gallery-picker-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
}

.gallery-picker-item {
    aspect-ratio: 1;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 8px;
    background: var(--gal-fill);
    cursor: pointer;
}

.gallery-picker-cancel {
    margin-top: 8px;
    padding: 10px 14px;
    color: var(--gal-sub);
    cursor: pointer;
    text-align: center;
    font-size: 14px;
}
