* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f0f0f;
    color: #eee;
    min-height: 100vh;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 360px;
    padding: 2rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #1a1a1a;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #333;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 1rem;
    color: #fff;
}

.login-form input {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid #333;
    background: #222;
    color: #eee;
    font-size: 1rem;
}

.login-form button {
    padding: 0.75rem;
    border-radius: 8px;
    border: none;
    background: #4f46e5;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
}

.login-form button:hover {
    background: #4338ca;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: transform 0.3s;
}
.nav-left {
    display: flex;
    align-items: center;
}
.nav-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.nav-right-desktop {
    display: contents;
}

/* ── Bottom action bar (mobile) ── */

.bottom-nav {
    display: none;
}
.nav-hidden {
    pointer-events: none;
}
@media (max-width: 600px) {
    .nav-hidden.navbar {
        transform: translateY(-100%);
    }
    .nav-hidden.bottom-nav {
        transform: translateY(100%);
    }
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.nav-link {
    color: #aaa;
    text-decoration: none;
    font-size: 0.875rem;
}

.nav-link:hover {
    color: #fff;
}

.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: #222;
    border-radius: 8px;
    padding: 0.25rem;
}

.view-toggle button {
    padding: 0.4rem 1rem;
    border: none;
    background: transparent;
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.15s;
}

.view-toggle button.active {
    background: #4f46e5;
    color: #fff;
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

.timeline {
    padding: 1rem 0;
}

.timeline-year {
    margin-bottom: 0.5rem;
}

.year-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-radius: 8px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    transition: background 0.15s;
}

.year-header:hover {
    background: #222;
}

.year-count {
    font-size: 0.8rem;
    color: #666;
    font-weight: 400;
}

.timeline-months {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
}

.timeline-month {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 1rem;
    background: #222;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #333;
    transition: all 0.15s;
    min-width: 80px;
}

.timeline-month:hover {
    background: #2a2a2a;
    border-color: #4f46e5;
}

.month-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.month-count {
    font-size: 0.75rem;
    color: #888;
}

.grid-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
}

.back-btn {
    padding: 0.4rem 0.8rem;
    background: #222;
    border: 1px solid #333;
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
}

.back-btn:hover {
    background: #333;
}

.grid-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.grid-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    transition: transform 0.15s, border-color 0.15s;
    aspect-ratio: 1;
}

.grid-item:hover {
    transform: scale(1.02);
    border-color: #4f46e5;
    z-index: 2;
}

.grid-item .thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.folder-item {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    background: #1a1a1a;
}

.folder-icon {
    font-size: 3rem;
}

.item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    font-size: 0.75rem;
    display: flex;
    flex-direction: column;
}

.item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-date {
    color: #999;
    font-size: 0.7rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
}

.pagination button {
    padding: 0.4rem 1rem;
    background: #222;
    border: 1px solid #333;
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}

.pagination button:hover:not(:disabled) {
    background: #333;
}

.folder-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.folder-breadcrumbs button {
    padding: 0.3rem 0.6rem;
    background: transparent;
    border: 1px solid transparent;
    color: #888;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.folder-breadcrumbs button:hover,
.folder-breadcrumbs button.active {
    color: #fff;
    background: #222;
    border-color: #333;
}

.breadcrumb-sep {
    color: #555;
}

.viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-y;
}
.viewer-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: rgba(0,0,0,0.6);
}
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.viewer-swiper {
    width: 100%;
    height: 100%;
    touch-action: pan-y;
}
.viewer-swiper.is-video .swiper-button-next,
.viewer-swiper.is-video .swiper-button-prev {
    display: none;
}

.viewer-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.viewer-media {
    max-width: 95vw;
    max-height: 85vh;
    object-fit: contain;
}

.swiper-zoom-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.viewer-info {
    padding: 0.75rem 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #aaa;
    display: flex;
    gap: 1rem;
    justify-content: center;
    pointer-events: none;
}

.viewer-close,
.viewer-download,
.viewer-original {
    position: fixed;
    top: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 1010;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.15s;
}

.viewer-close { right: 1rem; }
.viewer-download { right: 3.5rem; }
.viewer-original { right: 6rem; }

.viewer-close:hover,
.viewer-download:hover,
.viewer-original:hover {
    background: rgba(0,0,0,0.75);
}

.swiper-button-next,
.swiper-button-prev {
    color: #fff !important;
}

.video-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    z-index: 3;
    pointer-events: none;
}
.video-badge-icon {
    font-size: 0.6rem;
}

.protected-badge {
    position: absolute;
    bottom: 2.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.75);
    color: #fbbf24;
    padding: 0.2rem 0.35rem;
    border-radius: 4px;
    font-size: 0.85rem;
    z-index: 3;
    pointer-events: none;
    line-height: 1;
}

.protected-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: #1a1a1a;
    color: #555;
    aspect-ratio: 1;
}

.upload-protected {
    margin: 0.25rem 0;
}
.upload-protected .conflict-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
}
.upload-protected input[type="checkbox"] {
    accent-color: #fbbf24;
}

/* ============================================================
   Tags & Search
   ============================================================ */

.search-input {
    padding: 0.4rem 0.8rem;
    border: 1px solid #555;
    border-radius: 6px;
    background: #222;
    color: #eee;
    font-size: 0.85rem;
    margin-left: auto;
    width: 200px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.25);
    outline: none;
}
.search-input::placeholder {
    color: #666;
}

.tag-chip {
    background: #2a2a2a;
    color: #aaa;
    border-radius: 4px;
    padding: 0.05rem 0.35rem;
    font-size: 0.65rem;
    white-space: nowrap;
    display: inline-block;
    line-height: 1.4;
}
.item-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-top: 1px;
}

.service-bar-tag-input {
    padding: 0.4rem 0.75rem;
    border: 1px solid #444;
    border-radius: 6px;
    background: #333;
    color: #eee;
    font-size: 0.85rem;
    flex: 2;
    max-width: 250px;
}
.service-bar-tag-input::placeholder {
    color: #888;
}
.service-tag-btn {
    background: #222 !important;
    border-color: #333 !important;
    color: #ccc !important;
    font-size: 0.8rem;
    padding: 0.4rem 0.7rem;
}

@media (max-width: 600px) {
    .search-input {
        width: 130px;
        font-size: 0.8rem;
    }
    .service-bar-tag-input {
        max-width: 160px;
        font-size: 0.8rem;
    }
    .service-tag-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }
}

.category-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.75rem 0;
}

.category-tabs button {
    padding: 0.4rem 1rem;
    border: none;
    background: #222;
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.15s;
}

.category-tabs button.active {
    background: #4f46e5;
    color: #fff;
}

.owner-select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #444;
    border-radius: 6px;
    background: #222;
    color: #ccc;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: 0.25rem;
    max-width: 140px;
}
.owner-select:focus {
    border-color: #4f46e5;
    outline: none;
}
.owner-select option {
    background: #1a1a1a;
    color: #ccc;
}

@media (max-width: 600px) {
    .owner-select {
        max-width: 100px;
        font-size: 0.75rem;
    }
}

.scan-banner {
    text-align: center;
    padding: 0.5rem 1rem;
    background: #4f46e5;
    color: #fff;
    font-size: 0.875rem;
    position: sticky;
    top: 52px;
    z-index: 99;
}

.plyr--video {
    --plyr-color-main: #4f46e5;
    --plyr-video-background: #000;
    --plyr-range-thumb-height: 14px;
    --plyr-range-track-height: 5px;
}
.plyr__video-wrapper {
    max-width: 95vw;
    max-height: 85vh;
}
.plyr__video-wrapper .plyr,
.plyr__video-wrapper video {
    max-height: 85vh;
}

.reader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a1a1a;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.reader-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #1a1a1a;
}
.reader-overlay .viewer-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
}
.book-icon {
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

@media (max-width: 600px) {
    .navbar {
        padding: 0.5rem 0.75rem;
        flex-wrap: nowrap;
        gap: 0.4rem;
    }
    .nav-left {
        display: none;
    }
    .nav-center {
        width: 100%;
    }
    .view-toggle {
        width: 100%;
    }
    .view-toggle button {
        flex: 1;
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    .nav-right-desktop {
        display: none;
    }
    .nav-brand {
        display: none;
    }
    .navbar {
        position: sticky;
        top: 0;
    }
    .scan-banner {
        position: sticky;
        top: 0;
    }
    .main-content {
        padding: 0.5rem;
        padding-bottom: 3.5rem;
    }
    .grid-items {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.5rem;
    }
    .grid-header {
        padding: 0.5rem 0;
    }
    .grid-header h3 {
        font-size: 0.9rem;
    }
    .timeline-month {
        min-width: 65px;
        padding: 0.4rem 0.6rem;
    }
    .month-name {
        font-size: 0.8rem;
    }
    .month-count {
        font-size: 0.7rem;
    }
    .year-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
    }
    .folder-breadcrumbs {
        gap: 0;
        font-size: 0.8rem;
    }
    .folder-breadcrumbs button {
        padding: 0.25rem 0.4rem;
        font-size: 0.8rem;
    }
.loading-more {
    text-align: center;
    padding: 1.5rem;
    color: #888;
    font-size: 0.9rem;
}

.pagination {
        padding: 1rem 0.5rem;
        gap: 0.5rem;
    }
    .pagination button {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    .category-tabs button {
        padding: 0.3rem 0.7rem;
        font-size: 0.8rem;
    }
    .upload-modal {
        width: 95%;
        padding: 1rem;
    }
    .upload-modal h2 {
        font-size: 1rem;
    }
    .picker-folders {
        max-height: 260px;
    }
    .picker-folder-btn {
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }
    .picker-selected {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    .upload-conflict {
        gap: 0.3rem;
    }
    .conflict-options {
        gap: 0.75rem;
    }
    .conflict-option {
        font-size: 0.8rem;
    }
    .nav-link.upload-btn {
        font-size: 0.85rem;
    }
    .nav-link {
        font-size: 0.8rem;
    }
    .viewer-media {
        max-width: 100vw;
        max-height: 80vh;
    }
    .viewer-info {
        padding: 0.5rem 1rem;
        font-size: 0.75rem;
        gap: 0.5rem;
    }
    .viewer-close,
    .viewer-download,
    .viewer-original {
        width: 36px;
        height: 36px;
        top: 3rem;
        font-size: 1rem;
    }
    .viewer-close { right: 0.5rem; }
    .viewer-download { right: 3rem; }
    .viewer-original { right: 5.5rem; }
    .swiper-button-next,
    .swiper-button-prev {
        transform: scale(0.8);
    }
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #1a1a1a;
        border-top: 1px solid #333;
        z-index: 100;
        transition: transform 0.3s;
    }
    .bottom-nav button,
    .bottom-nav a {
        flex: 1;
        padding: 0.65rem 0.4rem;
        background: transparent;
        border: none;
        color: #888;
        font-size: 1.2rem;
        cursor: pointer;
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }
    .bottom-nav button.service-active {
        color: #fbbf24;
    }
    .service-bar {
        bottom: 3rem;
    }
}

@media (max-width: 380px) {
    .grid-items {
        grid-template-columns: 1fr;
    }
    .picker-folders {
        max-height: 220px;
    }
    .view-toggle button {
        padding: 0.25rem 0.5rem;
        font-size: 0.72rem;
    }
    .nav-brand {
        font-size: 1rem;
    }
    .timeline-month {
        min-width: 55px;
        padding: 0.3rem 0.5rem;
    }
    .month-name {
        font-size: 0.75rem;
    }
    .item-name {
        font-size: 0.7rem;
    }
    .item-date {
        font-size: 0.65rem;
    }
    .viewer-media {
        max-width: 100vw;
        max-height: 75vh;
    }
    .viewer-info {
        padding: 0.4rem 0.75rem;
        font-size: 0.7rem;
    }
    .viewer-close,
    .viewer-download,
    .viewer-original {
        width: 32px;
        height: 32px;
        top: 2.8rem;
        font-size: 0.9rem;
    }
    .viewer-close { right: 0.4rem; }
    .viewer-download { right: 2.6rem; }
    .viewer-original { right: 4.8rem; }
    .swiper-button-next,
    .swiper-button-prev {
        transform: scale(0.7);
    }
}

.upload-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.upload-modal {
    background: #222;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 480px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}
.upload-modal h2 {
    margin: 0 0 1rem;
    font-size: 1.2rem;
}
.picker-selected {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    background: rgba(79, 70, 229, 0.15);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 8px;
    color: #a5b4fc;
    font-size: 0.9rem;
}
.picker-folders {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 360px;
    overflow-y: auto;
    margin: 0.5rem 0;
}
.picker-folder-btn {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #ccc;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
}
.picker-folder-btn:hover, .picker-folder-btn:active {
    border-color: #4f46e5;
    background: #252525;
}
.upload-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.upload-tabs button {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #444;
    border-radius: 6px;
    background: #333;
    color: #ccc;
    cursor: pointer;
    font-size: 0.9rem;
}
.upload-tabs button.active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}
.upload-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.upload-folder {
    padding: 0.5rem 0.75rem;
    border: 1px solid #444;
    border-radius: 6px;
    background: #333;
    color: #eee;
    font-size: 0.9rem;
}
.upload-folder::placeholder {
    color: #888;
}
.upload-zone {
    border: 2px dashed #555;
    border-radius: 8px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s;
}
.upload-zone.dragover {
    border-color: #4f46e5;
    background: rgba(79,70,229,0.1);
}
.upload-zone-text {
    color: #aaa;
    font-size: 0.9rem;
}
.upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.upload-submit {
    padding: 0.6rem;
    border: none;
    border-radius: 6px;
    background: #4f46e5;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
}
.upload-submit:disabled {
    opacity: 0.5;
    cursor: default;
}
.upload-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.upload-progress-bar {
    flex: 1;
    height: 8px;
    background: #4f46e5;
    border-radius: 4px;
    transition: width 0.3s;
}
.upload-progress span {
    color: #aaa;
    font-size: 0.85rem;
    min-width: 3em;
}
.upload-message {
    color: #4ade80;
    font-size: 0.9rem;
}
.upload-message.error {
    color: #f87171;
}
.nav-link.upload-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #4f46e5;
}

.upload-conflict {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.conflict-label {
    color: #aaa;
    font-size: 0.85rem;
}
.conflict-options {
    display: flex;
    gap: 1rem;
}
.conflict-option {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    color: #ccc;
    font-size: 0.9rem;
}
.conflict-option input[type="radio"] {
    accent-color: #4f46e5;
}
.upload-result {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.upload-result-summary {
    font-size: 0.9rem;
    color: #4ade80;
}
.upload-result-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.upload-result-row {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 0.2rem 0;
    border-bottom: 1px solid #333;
}
.upload-result-row:last-child {
    border-bottom: none;
}
.upload-result-row .result-original {
    color: #ddd;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.upload-result-row .result-action {
    color: #888;
    flex-shrink: 0;
}
.upload-result-row.renamed .result-action {
    color: #fbbf24;
}
.upload-result-row.skipped .result-action {
    color: #f87171;
}
.upload-result-row.saved .result-action {
    color: #4ade80;
}

/* ============================================================
   Service mode
   ============================================================ */

.nav-link.upload-btn.service-active {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.12);
    border-radius: 6px;
    padding: 0.3rem 0.7rem;
}

.item-check-overlay {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 5;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    pointer-events: none;
}
.item-check-overlay.checked {
    background: #4f46e5;
    border-color: #4f46e5;
}
.item-checkbox {
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
}

.grid-item.service-selected {
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.45);
    transform: scale(1.02);
    z-index: 3;
}

.service-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    z-index: 200;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.6);
}
.service-bar-count {
    color: #aaa;
    font-size: 0.9rem;
    flex: 1;
}
.service-bar-delete {
    padding: 0.5rem 1.25rem;
    background: #dc2626;
    border: none;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s;
}
.service-bar-delete:hover {
    background: #b91c1c;
}
.service-bar-move {
    padding: 0.5rem 1.25rem;
    background: #2563eb;
    border: none;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s;
    white-space: nowrap;
}
.service-bar-move:hover {
    background: #1d4ed8;
}
.service-bar-cancel {
    padding: 0.5rem 1.25rem;
    background: #333;
    border: 1px solid #444;
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s;
}
.service-bar-cancel:hover {
    background: #444;
}

@media (max-width: 600px) {
    .service-bar {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    .service-bar-count {
        width: 100%;
        font-size: 0.8rem;
    }
    .service-bar-delete,
    .service-bar-move,
    .service-bar-cancel {
        flex: 1;
        font-size: 0.8rem;
        padding: 0.4rem 0.5rem;
    }
    .nav-link.upload-btn.service-active {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
}
