/* LumiList website wallpaper gallery */

:root {
    --wg-bg: #111723;
    --wg-surface: rgba(25, 33, 48, 0.9);
    --wg-surface-soft: rgba(36, 45, 63, 0.82);
    --wg-border: rgba(255, 255, 255, 0.12);
    --wg-border-strong: rgba(255, 255, 255, 0.2);
    --wg-text: #e7edf7;
    --wg-muted: #a8b6cc;
    --wg-accent: #05e57b;
    --wg-accent-hover: #03cd6c;
    --wg-pagination-surface: rgba(17, 24, 37, 0.95);
    --wg-shell-padding: clamp(14px, 2.4vw, 28px);
}

body.wallpaper-gallery-page {
    margin: 0;
    min-height: 100vh;
    color: var(--wg-text);
    background:
        radial-gradient(1100px 500px at 10% -20%, rgba(5, 229, 123, 0.16), transparent 70%),
        radial-gradient(900px 420px at 100% -10%, rgba(58, 109, 255, 0.15), transparent 68%),
        var(--wg-bg);
}

body.wallpaper-gallery-page.viewer-open {
    overflow: hidden;
}

.wallpaper-gallery-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(17, 23, 35, 0.82);
    border-bottom: 1px solid var(--wg-border);
}

.wallpaper-gallery-header-inner {
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding-left: var(--wg-shell-padding);
    padding-right: var(--wg-shell-padding);
    box-sizing: border-box;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.wallpaper-gallery-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wallpaper-gallery-header-actions .btn {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 9px;
}

.wallpaper-gallery-header-actions .btn svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.wallpaper-gallery-header-actions.hidden {
    display: none;
}

.wallpaper-gallery-main {
    padding: 32px 0 56px;
}

.wallpaper-gallery-content {
    width: 100%;
    padding: 0 var(--wg-shell-padding);
    box-sizing: border-box;
}

.wallpaper-gallery-filters {
    width: 100%;
    max-width: none;
    margin: 0 auto 18px;
    padding-left: var(--wg-shell-padding);
    padding-right: var(--wg-shell-padding);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.wallpaper-gallery-toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.wallpaper-gallery-category-row,
.wallpaper-gallery-theme-row,
.wallpaper-gallery-search-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wallpaper-gallery-theme-row.hidden,
.wallpaper-gallery-search-row.hidden {
    display: none;
}

.wallpaper-gallery-search-row {
    justify-content: space-between;
    min-width: 0;
    flex-wrap: nowrap;
}

.wallpaper-gallery-search-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    justify-content: flex-end;
    flex: 0 1 auto;
}

.wallpaper-gallery-theme-row {
    min-width: max-content;
}

.category-filter-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    width: 100%;
    justify-content: flex-start;
}

.category-filter-viewport {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    padding: 4px 0 3px;
    margin: -4px 0 -3px;
    scrollbar-width: none;
    display: flex;
    justify-content: flex-start;
}

.category-filter-viewport::-webkit-scrollbar {
    display: none;
}

.category-filter-control,
.theme-filter-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
}

.category-filter-control {
    min-width: max-content;
    justify-content: flex-start;
}

.category-scroll-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--wg-border);
    background: rgba(17, 24, 37, 0.95);
    color: var(--wg-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.category-scroll-btn:hover:not(:disabled) {
    border-color: var(--wg-border-strong);
    color: #fff;
    transform: translateY(-1px);
}

.category-scroll-btn:disabled {
    opacity: 0.35;
    cursor: default;
    transform: none;
}

.category-scroll-btn.hidden {
    display: none;
}

.wallpaper-search-shell {
    width: min(100%, 360px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid var(--wg-border);
    border-radius: 999px;
    background: rgba(17, 24, 37, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.wallpaper-search-icon {
    width: 16px;
    height: 16px;
    color: rgba(231, 237, 247, 0.5);
    flex: 0 0 auto;
}

.wallpaper-sort-shell {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--wg-border);
    border-radius: 999px;
    background: rgba(17, 24, 37, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: var(--wg-text);
}

.wallpaper-sort-label {
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 700;
    color: rgba(231, 237, 247, 0.62);
}

.wallpaper-sort-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--wg-text);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    text-align: left;
}

.wallpaper-sort-trigger svg {
    width: 12px;
    height: 12px;
    color: rgba(231, 237, 247, 0.72);
    transition: transform 0.2s ease;
    flex: 0 0 auto;
    margin-left: auto;
}

.wallpaper-sort-shell.is-open .wallpaper-sort-trigger svg {
    transform: rotate(180deg);
}

.wallpaper-sort-current {
    white-space: nowrap;
}

.wallpaper-sort-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 204px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(18, 24, 37, 0.97);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 30;
}

.wallpaper-sort-menu.hidden {
    display: none;
}

.wallpaper-sort-option {
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border: none;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    background: transparent;
    color: var(--wg-text);
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    transition: background 0.2s ease, color 0.2s ease;
}

.wallpaper-sort-option:hover,
.wallpaper-sort-option:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.wallpaper-sort-option.active {
    background: rgba(5, 229, 123, 0.18);
    color: #d8ffe8;
}

.wallpaper-search-input {
    width: 100%;
    height: 38px;
    padding: 0;
    border: none;
    outline: none;
    border-radius: 999px;
    background: transparent;
    color: var(--wg-text);
    font-size: 14px;
    font-weight: 600;
}

.wallpaper-search-input::placeholder {
    color: rgba(231, 237, 247, 0.55);
}

.wallpaper-search-input::-webkit-search-cancel-button {
    cursor: pointer;
}

.gallery-filter-btn {
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--wg-border);
    background: var(--wg-surface-soft);
    color: var(--wg-muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.gallery-filter-btn:hover {
    border-color: var(--wg-border-strong);
    color: var(--wg-text);
    transform: translateY(-1px);
}

.gallery-filter-btn.active {
    background: var(--wg-accent);
    color: #0e1b17;
    border-color: rgba(5, 229, 123, 0.5);
    box-shadow: 0 8px 22px rgba(5, 229, 123, 0.22);
}

.theme-filter-shell {
    display: inline-flex;
    align-items: center;
    padding: 2px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(11, 16, 26, 0.92);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.theme-filter-control {
    gap: 2px;
}

.theme-filter-btn {
    min-width: 72px;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: rgba(231, 237, 247, 0.7);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.theme-filter-btn:hover {
    color: #fff;
}

.theme-filter-btn.active {
    background: rgba(255, 255, 255, 0.96);
    color: #101722;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.wallpaper-loading-state {
    min-height: 280px;
    margin-bottom: 14px;
    padding: 28px 24px;
    border: 1px solid var(--wg-border);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(21, 30, 45, 0.82), rgba(14, 21, 33, 0.92)),
        var(--wg-surface);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

.wallpaper-loading-state.hidden {
    display: none;
}

.wallpaper-loading-spinner {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--wg-accent);
    box-shadow: 0 0 0 1px rgba(5, 229, 123, 0.08);
    animation: wallpaper-loader-spin 0.9s linear infinite;
}

.wallpaper-loading-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.wallpaper-loading-copy {
    margin: 0;
    max-width: 420px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--wg-muted);
}

.wallpaper-card {
    position: relative;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    background: #0e1520;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
    isolation: isolate;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.wallpaper-card:hover,
.wallpaper-card:focus-visible,
.wallpaper-card:focus-within,
.wallpaper-card.is-active {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.wallpaper-card-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #111827;
    display: block;
    transition: transform 0.32s ease;
}

.wallpaper-card:hover .wallpaper-card-preview,
.wallpaper-card:focus-within .wallpaper-card-preview,
.wallpaper-card.is-active .wallpaper-card-preview {
    transform: scale(1.03);
}

.wallpaper-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 12px;
    background: linear-gradient(180deg, rgba(5, 10, 18, 0.02) 28%, rgba(5, 10, 18, 0.58) 68%, rgba(5, 10, 18, 0.9) 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

.wallpaper-card:hover .wallpaper-card-overlay,
.wallpaper-card:focus-within .wallpaper-card-overlay,
.wallpaper-card.is-active .wallpaper-card-overlay {
    opacity: 1;
    pointer-events: auto;
}

.wallpaper-card-overlay-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wallpaper-card-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.38);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wallpaper-card-actions {
    display: flex;
    gap: 8px;
}

.wallpaper-download-btn {
    flex: 1;
    height: 32px;
    border-radius: 10px;
    border: 1px solid rgba(5, 229, 123, 0.45);
    background: rgba(5, 229, 123, 0.16);
    color: #d8ffe8;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.wallpaper-download-btn:hover {
    background: var(--wg-accent);
    color: #0e1b17;
}

.wallpaper-preview-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    border: 1px solid var(--wg-border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--wg-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.wallpaper-preview-btn:hover {
    border-color: var(--wg-border-strong);
    background: rgba(255, 255, 255, 0.08);
}

.wallpaper-viewer {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
}

.wallpaper-viewer.hidden {
    display: none;
}

.wallpaper-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 10, 18, 0.84);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.wallpaper-viewer-dialog {
    position: relative;
    z-index: 1;
    width: min(1200px, 100%);
    max-height: calc(100vh - 56px);
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) 56px;
    gap: 18px;
    align-items: center;
}

.wallpaper-viewer-stage-shell {
    position: relative;
    min-width: 0;
    width: min(100%, 1100px);
    justify-self: center;
    max-width: 100%;
}

.wallpaper-viewer-stage {
    position: relative;
    min-width: 0;
    width: 100%;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(180deg, rgba(17, 24, 37, 0.96), rgba(9, 14, 24, 0.98)),
        #0d1320;
    box-shadow: 0 34px 80px rgba(0, 0, 0, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.wallpaper-viewer-image {
    width: auto;
    max-width: 100%;
    max-height: min(68vh, 860px);
    height: auto;
    display: block;
    background: #0d1320;
    opacity: 1;
    transition: opacity 0.18s ease;
}

.wallpaper-viewer-stage.is-loading .wallpaper-viewer-image {
    opacity: 0;
}

.wallpaper-viewer-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background:
        linear-gradient(180deg, rgba(16, 22, 34, 0.92), rgba(10, 15, 25, 0.96)),
        #0d1320;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.wallpaper-viewer-stage.is-loading .wallpaper-viewer-loading,
.wallpaper-viewer-stage.has-error .wallpaper-viewer-loading {
    opacity: 1;
}

.wallpaper-viewer-stage.has-error .wallpaper-viewer-loading-spinner {
    display: none;
}

.wallpaper-viewer-loading-spinner {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--wg-accent);
    animation: wallpaper-loader-spin 0.9s linear infinite;
}

.wallpaper-viewer-loading-text {
    margin: 0;
    max-width: 280px;
    font-size: 13px;
    font-weight: 700;
    color: rgba(231, 237, 247, 0.68);
    text-align: center;
}

.wallpaper-viewer-stage.has-error .wallpaper-viewer-loading-text {
    color: rgba(231, 237, 247, 0.88);
}

.wallpaper-viewer-close,
.wallpaper-viewer-nav {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(17, 24, 37, 0.84);
    color: var(--wg-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.26);
}

.wallpaper-viewer-close:hover,
.wallpaper-viewer-nav:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(23, 31, 47, 0.94);
}

.wallpaper-viewer-close {
    position: absolute;
    top: 14px;
    left: calc(100% + 14px);
    right: auto;
    z-index: 2;
    width: 30px;
    height: 30px;
    padding: 0;
}

.wallpaper-viewer-close svg {
    width: 12px;
    height: 12px;
}

.wallpaper-viewer-nav {
    font-size: 30px;
    line-height: 1;
}

.wallpaper-viewer-nav:disabled {
    opacity: 0.35;
    cursor: default;
    transform: none;
}

.wallpaper-viewer-footer {
    grid-column: 2;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-top: 16px;
}

.wallpaper-viewer-copy {
    min-width: 0;
}

.wallpaper-viewer-kicker {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: rgba(231, 237, 247, 0.62);
}

.wallpaper-viewer-title {
    margin: 0;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 800;
    line-height: 1.06;
    color: #fff;
}

.wallpaper-viewer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.wallpaper-viewer-action {
    min-height: 42px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--wg-text);
    background: rgba(255, 255, 255, 0.06);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.wallpaper-viewer-action:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.wallpaper-viewer-add-btn {
    border-color: rgba(5, 229, 123, 0.38);
    background: rgba(5, 229, 123, 0.16);
    color: #d8ffe8;
}

.wallpaper-viewer-add-btn:hover {
    background: var(--wg-accent);
    color: #0e1b17;
}

.wallpaper-grid-empty {
    margin: 30px 0 0;
    font-size: 14px;
    color: var(--wg-muted);
    text-align: center;
}

.wallpaper-grid-empty.hidden {
    display: none;
}

.wallpaper-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.wallpaper-pagination-top {
    justify-content: flex-end;
    margin-left: 16px;
    flex: 0 0 auto;
}

.wallpaper-pagination-bottom {
    justify-content: center;
    margin-top: 18px;
}

.wallpaper-pagination.hidden {
    display: none;
}

.wallpaper-pagination-btn,
.wallpaper-pagination-ellipsis {
    min-width: 34px;
    height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.wallpaper-pagination-btn {
    border: 1px solid var(--wg-border);
    background: var(--wg-pagination-surface);
    color: var(--wg-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.wallpaper-pagination-btn:hover:not(:disabled) {
    border-color: var(--wg-border-strong);
    color: #fff;
    transform: translateY(-1px);
}

.wallpaper-pagination-btn.active {
    background: var(--wg-accent);
    border-color: rgba(5, 229, 123, 0.5);
    color: #0e1b17;
    box-shadow: 0 8px 22px rgba(5, 229, 123, 0.22);
}

.wallpaper-pagination-btn:disabled {
    opacity: 0.42;
    cursor: default;
    transform: none;
}

.wallpaper-pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--wg-muted);
}

.wallpaper-gallery-footer {
    border-top: 1px solid var(--wg-border);
    background: rgba(10, 15, 25, 0.85);
    padding: 16px 0;
}

.wallpaper-gallery-footer-inner {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--wg-muted);
    font-size: 13px;
}

.wallpaper-gallery-footer-inner a:hover {
    color: #fff;
}

@media (max-width: 1024px) {
    .wallpaper-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1440px) {
    .wallpaper-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .wallpaper-gallery-toolbar {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .wallpaper-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .wallpaper-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .wallpaper-gallery-header-inner {
        height: auto;
        padding-top: 12px;
        padding-bottom: 12px;
        align-items: flex-start;
        flex-direction: column;
    }

    .wallpaper-gallery-header-actions {
        width: 100%;
    }

    .wallpaper-gallery-header-actions .btn {
        flex: 1;
    }

    .wallpaper-gallery-category-row,
    .wallpaper-gallery-theme-row,
    .wallpaper-gallery-search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .wallpaper-gallery-toolbar {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .category-filter-strip,
    .category-filter-viewport,
    .theme-filter-shell,
    .wallpaper-gallery-search-tools {
        width: 100%;
    }

    .wallpaper-search-shell {
        width: 100%;
    }

    .wallpaper-gallery-search-tools {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    .wallpaper-sort-shell {
        width: 100%;
        justify-content: space-between;
    }

    .wallpaper-sort-menu {
        left: 0;
        right: auto;
        min-width: 100%;
    }

    .wallpaper-pagination-top,
    .wallpaper-pagination-bottom {
        width: 100%;
        margin-left: 0;
    }

    .wallpaper-pagination-top {
        justify-content: flex-start;
    }

    .wallpaper-pagination-bottom {
        justify-content: center;
    }

    .theme-filter-control {
        width: 100%;
    }

    .theme-filter-btn {
        flex: 1;
        min-width: 0;
    }

    .wallpaper-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wallpaper-loading-state {
        min-height: 220px;
        padding: 24px 18px;
    }

    .wallpaper-viewer {
        padding: 14px;
    }

    .wallpaper-viewer-dialog {
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        gap: 10px;
        max-height: calc(100vh - 28px);
    }

    .wallpaper-viewer-stage-shell {
        width: 100%;
    }

    .wallpaper-viewer-stage {
        min-height: 220px;
    }

    .wallpaper-viewer-close,
    .wallpaper-viewer-nav {
        width: 42px;
        height: 42px;
    }

    .wallpaper-viewer-close {
        top: 10px;
        left: auto;
        right: 10px;
        width: 28px;
        height: 28px;
    }

    .wallpaper-viewer-close svg {
        width: 11px;
        height: 11px;
    }

    .wallpaper-viewer-nav {
        font-size: 24px;
    }

    .wallpaper-viewer-image {
        max-height: 56vh;
    }

    .wallpaper-viewer-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .wallpaper-viewer-actions {
        justify-content: stretch;
    }

    .wallpaper-viewer-action {
        width: 100%;
    }
}

@media (max-width: 520px) {
    :root {
        --wg-shell-padding: 12px;
    }

    .wallpaper-gallery-content {
        padding: 0 var(--wg-shell-padding);
    }

    .wallpaper-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@keyframes wallpaper-loader-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
