.grid-container {
    flex: 1; padding: 30px; overflow-y: auto;
    display: grid;
    /* Responsive Grid: min 200px columns */
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-auto-rows: max-content;
    gap: 20px;
    padding-bottom: max(40px, calc(30px + env(safe-area-inset-bottom, 0px)));
}

.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: max(24px, env(safe-area-inset-top)) 16px calc(220px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(135deg, rgba(15,15,15,0.8) 0%, rgba(30,10,20,0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.login-card {
    width: min(100%, 400px);
    max-width: 400px;
    margin: clamp(18px, 8vh, 72px) auto 0;
    padding: 42px 32px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.03);
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    text-align: center;
    animation: floatUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.login-title {
    margin: 0 0 10px;
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(to right, #fff, #ff2a5f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-subtitle {
    margin-bottom: 30px;
    color: #888;
    font-size: 0.9rem;
}
.login-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.2);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.login-input:focus {
    border-color: #ff2a5f;
    box-shadow: 0 0 0 3px rgba(255, 42, 95, 0.16);
}
.login-input-password {
    margin-top: 15px;
    margin-bottom: 25px;
}
.login-submit {
    width: 100%;
    padding: 14px;
    border: 0;
    border-radius: 12px;
    background: #ff2a5f;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 5px 15px rgba(255, 42, 95, 0.3);
}
.login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 42, 95, 0.5);
}
.login-error {
    display: none;
    margin-top: 15px;
    margin-bottom: 0;
    color: #ff4444;
    font-size: 0.85rem;
}

.action-select {
    width: 180px;
    padding: 5px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #222;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
}
.action-input {
    display: none;
    width: 150px;
    margin-left: 10px;
    padding: 5px;
    border: 0;
    border-bottom: 1px solid #555;
    background: transparent;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
}
.selection-cancel-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #333;
}

.asset-manager-workspace {
    display: flex;
    flex: 1;
    min-height: 0;
}
.asset-manager-sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333;
    background: #0f0f0f;
}
.asset-manager-sidebar-head {
    padding: 15px;
    border-bottom: 1px solid #222;
}
.asset-manager-section-title {
    margin: 0 0 10px;
    color: #ccc;
}
.asset-manager-btn {
    width: 100%;
    padding: 6px;
    font-size: 0.8rem;
    border-color: #555;
    background: rgba(255, 42, 95, 0.1);
    color: #ff2a5f;
}
.tools-section-last {
    border-bottom: none;
}
.classification-status-text {
    margin-bottom: 15px;
    color: #666;
    font-size: 0.75rem;
    text-align: center;
}
.asset-manager-theme-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    overflow-y: auto;
    padding: 10px;
}
.asset-manager-empty {
    margin-top: 20px;
    color: #666;
    font-size: 0.85rem;
    text-align: center;
}
.asset-manager-empty-wide {
    grid-column: 1 / -1;
    margin-top: 50px;
}
.asset-manager-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #161616;
}
.asset-manager-main-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #222;
}
.asset-manager-main-title {
    margin: 0;
    color: #fff;
}
.asset-manager-main-btn {
    display: none;
    font-size: 0.85rem;
}
.asset-manager-items-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    align-content: flex-start;
    overflow-y: auto;
    padding: 20px;
}

.right-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}
.right-sidebar-title {
    font-size: 1.2rem;
    font-weight: 700;
}
.tools-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.tools-btn {
    width: 100%;
    font-weight: 700;
}
.tools-btn-left {
    justify-content: flex-start;
}
.tools-btn-stack {
    margin-bottom: 5px;
}
.tools-btn-accent {
    border-color: #ff2a5f;
    color: #ff2a5f;
}
.tools-btn-cyan {
    border-color: #00c6ff;
    color: #00c6ff;
}
.tools-btn-amber {
    border-color: #f09819;
    color: #f09819;
}
.tools-btn-violet {
    border-color: #a461ff;
    color: #a461ff;
}
.tools-select,
.sync-input {
    width: 100%;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #151515;
    color: #fff;
    font-size: 0.74rem;
    outline: none;
}
.sync-status-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #333;
    background: rgba(0, 0, 0, 0.3);
}
.sync-status-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.sync-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #5cb85c;
    box-shadow: 0 0 8px #5cb85c;
    flex: 0 0 auto;
}
.sync-status-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
}
.sync-status-detail {
    font-size: 0.7rem;
    color: #888;
    text-align: right;
}
.sync-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}
.sync-selected-models {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}
.sync-btn {
    padding: 6px 8px;
    font-size: 0.75rem;
}
.sync-btn-full {
    width: 100%;
}
.sync-btn-flex {
    flex: 1;
}
.sync-btn-gap,
.sync-input-gap {
    margin-bottom: 8px;
}
.sync-btn-danger {
    border-color: #ff2a5f;
    color: #ff2a5f;
}
.sync-btn-muted {
    border-color: #666;
}
.sync-btn-reset {
    margin-bottom: 10px;
    border-color: #7a7a7a;
    color: #f0f0f0;
}
.sync-action-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.sync-filter-summary {
    margin: 0 0 10px;
    color: #8d8d8d;
    font-size: 0.7rem;
}
.sync-status-box {
    display: none;
}
.sync-status-line {
    margin: 0 0 5px;
    color: #fff;
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sync-progress-track {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    background: #333;
}
.sync-progress-bar {
    width: 0%;
    height: 100%;
    background: #ff2a5f;
    transition: width 0.3s ease;
}
.sync-stats-line {
    margin: 5px 0 0;
    color: #aaa;
    font-size: 0.7rem;
    text-align: right;
}

.vision-dropzone {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    padding: 20px;
    border: 2px dashed #555;
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
    color: #888;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.vision-dropzone-copy {
    margin: 0;
    pointer-events: none;
}
.vision-dropzone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.vision-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 10px;
    border-radius: 8px;
}

@media (max-width: 980px) {
    .sync-filter-grid,
    .sync-action-row {
        grid-template-columns: 1fr;
        flex-direction: column;
    }
    .sync-status-card {
        align-items: flex-start;
        flex-direction: column;
    }
    .sync-status-detail {
        text-align: left;
    }
}

.grid-item {
    position: relative;
    padding-bottom: 177.78%; /* 16:9 vertical portrait */
    background: var(--sidebar-bg); border-radius: 8px; overflow: hidden;
    cursor: pointer; border: 1px solid var(--border); transition: transform 0.2s, box-shadow 0.2s;
    user-select: none; -webkit-user-select: none;
}
.grid-item:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.grid-item img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.grid-tag-overlay {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 4;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-width: calc(100% - 20px);
    pointer-events: none;
}
.image-tag-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.66);
    border: 1px solid rgba(255,255,255,0.12);
    color: #f4f4f4;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}
.grid-tag-overlay .image-tag-chip[data-search-chip],
.swiper-tag-overlay .image-tag-chip[data-search-chip] {
    pointer-events: auto;
    cursor: pointer;
}
.image-tag-chip.flag {
    border-color: rgba(255, 42, 95, 0.35);
    background: rgba(255, 42, 95, 0.22);
}
.image-tag-chip.subtle {
    color: #cfcfcf;
}
.empty-state { grid-column: 1 / -1; color: var(--text-muted); text-align: center; margin-top: 50px;}

/* Selection Mode */
.grid-item .select-layer {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: transparent; display: none; z-index: 10;
}
.grid-item.selected .select-layer { display: block; background: transparent; border: 2px solid var(--accent); border-radius: 8px;}
.grid-item .check {
    position: absolute; top: 10px; right: 10px;
    width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff;
    display: none; justify-content: center; align-items: center; font-size: 14px;
    background: rgba(0,0,0,0.4);
}
#grid-container.selection-mode .grid-item .check { display: flex; }
.grid-item.selected .check { background: var(--accent); border-color: var(--accent); color: white; }


.floating-action-bar {
    position: relative;
    margin: 0 24px;
    background: rgba(20,20,20,0.96);
    padding: 0 24px;
    border-radius: 0 0 22px 22px;
    border: 1px solid rgba(255, 42, 95, 0.28);
    border-top: 0;
    display: flex; align-items: center; gap: 20px; z-index: 900;
    box-shadow: 0 12px 32px rgba(0,0,0,0.32);
    transition: 0.28s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    transform: translateY(-8px);
}
.floating-action-bar.visible {
    padding: 14px 24px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    max-height: 120px;
    transform: translateY(0);
}
.floating-action-bar strong { color: #fff; }
/* Fullscreen Swiper Modal */
.swiper-modal {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000;
    z-index: 3000; display: flex; flex-direction: column;
}
.swiper-body {
    flex: 1;
    min-height: 0;
    display: flex;
}
.swiper-close {
    position: absolute; top: 20px; left: 30px; z-index: 3010;
    background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; opacity: 0.6;
}
.swiper-close:hover { opacity: 1; }
.swiper-delete-btn {
    border-color: rgba(255, 42, 95, 0.4);
    color: #ff90ab;
}
.swiper-delete-btn:hover {
    border-color: var(--accent);
    color: #fff;
}

.swiper-layout {
    flex: 1; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; overscroll-behavior: contain;
    min-width: 0;
    cursor: default;
}
.swiper-layout.zoomable {
    cursor: grab;
}
.swiper-layout.dragging {
    cursor: grabbing;
}
.swiper-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.1); border: none; color: white;
    width: 50px; height: 50px; border-radius: 50%; font-size: 1.5rem;
    cursor: pointer; z-index: 3010; transition: 0.2s;
}
.swiper-nav:hover { background: rgba(255,255,255,0.3); }
.swiper-nav.prev { left: 20px; }
.swiper-nav.next { right: 20px; }

.swiper-track {
    display: flex; height: 100%; height: 90vh; width: 100%;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}
.swiper-slide {
    min-width: 100%; display: flex; justify-content: center; align-items: center;
    padding: 0 20px; /* Space for edge arrows */
}
/* This is the magic for Uncropped Full Screen! */
.swiper-slide img {
    max-width: 100%; max-height: 100%;
    object-fit: contain; box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    transform-origin: center center;
    transition: transform 0.18s ease-out;
    will-change: transform;
    -webkit-user-drag: none;
    user-select: none;
}
.swiper-sidebar {
    width: 360px;
    flex: 0 0 360px;
    border-left: 1px solid rgba(255,255,255,0.08);
    background: rgba(10,10,10,0.94);
    padding: 84px 18px 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.swiper-side-card {
    background: rgba(18,18,18,0.9);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.swiper-side-title {
    margin: 0;
    color: #ff2a5f;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
}
.swiper-meta-content {
    font-size: 0.8rem;
    color: #ccc;
    line-height: 1.5;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.swiper-tag-overlay {
    position: absolute;
    left: 30px;
    bottom: 30px;
    z-index: 3020;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    max-height: 200px;
    pointer-events: none; /* 스와이프 차단 방지 */
}
.swiper-tag-overlay:empty {
    display: none;
}
.swiper-tag-overlay .tag-flags,
.swiper-tag-overlay .tag-keywords {
    position: static !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    max-width: 100% !important;
    pointer-events: auto; /* 칩 검색 클릭 기능 보존 */
}
.swiper-tag-overlay .image-tag-chip {
    min-height: 30px;
    padding: 0 12px;
    font-size: 0.78rem;
}

/* Swiper Sidebar / Inspector Panel 내부에서의 오버레이 태그 절대 좌표 무력화 */
.swiper-sidebar .tag-flags,
.swiper-sidebar .tag-keywords,
.seaart-meta-box .tag-flags,
.seaart-meta-box .tag-keywords {
    position: static !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
}
.review-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.review-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.03);
    color: #d5d5d5;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.18s ease;
}
.review-chip.active {
    border-color: rgba(255, 42, 95, 0.45);
    background: rgba(255, 42, 95, 0.18);
    color: #fff;
}
.review-summary {
    color: #bcbcbc;
    font-size: 0.78rem;
    line-height: 1.5;
}
.swiper-panel-spaced {
    margin-top: 15px;
}
.swiper-input {
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: #1a1a1a;
    color: #fff;
    font-size: 0.85rem;
}
.swiper-input-gap-sm {
    margin-bottom: 8px;
}
.swiper-input-gap-md {
    margin-bottom: 10px;
}
.swiper-textarea {
    resize: vertical;
}
.swiper-textarea-fixed {
    resize: none;
}
.swiper-action-btn {
    width: 100%;
}
.swiper-action-btn-accent {
    border-color: #ff2a5f;
    color: #ff2a5f;
}
.swiper-status-line {
    color: #aaa;
    font-size: 0.75rem;
    text-align: center;
}
.swiper-favorite-btn {
    color: #ff2a5f;
    border-color: #ff2a5f;
}
.swiper-review-card textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #171717;
    color: #fff;
    font-size: 0.84rem;
    resize: vertical;
}
.swiper-lipsync-card textarea {
    min-height: 120px;
}

.swiper-footer {
    height: 60px; border-top: 1px solid rgba(255,255,255,0.1); display: flex;
    justify-content: space-between; align-items: center; padding: 0 30px;
}
