.lightbox-overlay {
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(0, 0, 0, .85);
    user-select: none;
    -webkit-user-select: none;
}

.lightbox-overlay.show { display: flex; }

.lightbox-img-wrap {
    position: relative;
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox-img {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    opacity: 0;
    cursor: grab;
    transform: scale(0);
    transition: opacity .35s ease, transform .35s ease;
}

.lightbox-img.loaded { opacity: 1; transform: scale(1); }
.lightbox-img.dragging { cursor: grabbing; transition: none; }

.lightbox-loading {
    position: absolute;
    z-index: 10002;
    top: 50%;
    left: 50%;
    display: none;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.lightbox-loading.show { display: block; }

.lightbox-loading-meter {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
}

.lightbox-loading-ring {
    display: block;
    width: 80px;
    height: 80px;
    transform: rotate(-90deg);
}

.lightbox-loading-ring-track,
.lightbox-loading-ring-value {
    fill: none;
    stroke-width: 4;
}

.lightbox-loading-ring-track { stroke: rgba(255, 255, 255, .16); }

.lightbox-loading-ring-value {
    stroke: #3880ff;
    stroke-linecap: round;
    stroke-dasharray: 163.36;
    stroke-dashoffset: 163.36;
    transition: stroke-dashoffset .18s ease-out;
}

.lightbox-loading-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    color: #fff;
    font-size: 17px;
    font-weight: 500;
    line-height: 24px;
    text-align: center;
    transform: translate(-50%, -50%);
}

.lightbox-loading-size {
    min-width: 160px;
    margin-top: 10px;
    color: rgba(255, 255, 255, .68);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .1px;
    line-height: 20px;
}

.lightbox-close {
    position: fixed;
    z-index: 10003;
    top: 20px;
    right: 20px;
    display: flex;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    outline: none;
    background: rgba(0, 0, 0, .48);
    cursor: pointer;
    transition: background .2s;
}

.lightbox-close svg { width: 20px; height: 20px; fill: #fff; }
.lightbox-close:hover { background: rgba(0, 0, 0, .64); }

.lightbox-app-guide {
    position: fixed;
    z-index: 10003;
    top: 20px;
    right: 72px;
    display: flex;
    height: 40px;
    padding: 0 16px;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 20px;
    outline: none;
    background: rgba(56, 128, 255, .9);
    color: #fff;
    font-size: 14px;
    line-height: 38px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
    box-sizing: border-box;
}

.lightbox-app-guide svg {
    width: 17px;
    height: 17px;
    margin-right: 7px;
    fill: currentColor;
}

.lightbox-app-guide:hover { background: rgba(44, 110, 219, .96); }
.lightbox-app-guide__mobile { display: none; }

.lightbox-toolbar {
    position: fixed;
    z-index: 10001;
    bottom: 60px;
    left: 50%;
    display: flex;
    padding: 6px 10px;
    align-items: center;
    border-radius: 24px;
    background: transparent;
    transform: translateX(-50%);
}

.lightbox-toolbar button {
    display: flex;
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    outline: none;
    background: rgba(0, 0, 0, .5);
    cursor: pointer;
    transition: background .2s;
}

.lightbox-toolbar button:hover { background: rgba(0, 0, 0, .7); }
.lightbox-toolbar button:disabled { opacity: .3; cursor: default; }
.lightbox-toolbar button:disabled:hover { background: rgba(0, 0, 0, .5); }
.lightbox-toolbar button svg { width: 16px; height: 16px; fill: #fff; }
.lightbox-toolbar .toolbar-divider { width: 1px; height: 16px; margin: 0 2px; }

.lightbox-thumb-strip {
    position: fixed;
    z-index: 10001;
    bottom: 0;
    left: 0;
    display: flex;
    width: 100%;
    padding: 8px 16px;
    overflow-x: auto;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    scroll-behavior: smooth;
}

.lightbox-thumb {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border: 2px solid transparent;
    border-radius: 4px;
    object-fit: cover;
    cursor: pointer;
    transition: border-color .15s;
}

.lightbox-thumb + .lightbox-thumb { margin-left: 6px; }
.lightbox-thumb:hover { border-color: rgba(255, 255, 255, .5); }
.lightbox-thumb.active { border-color: #3880ff; }
.main-pic-clickable { cursor: pointer; }

@media (max-width: 768px) {
    .lightbox-close { top: 12px; right: 12px; width: 36px; height: 36px; }
    .lightbox-app-guide { top: 12px; right: 58px; height: 36px; padding: 0 12px; border-radius: 18px; font-size: 13px; line-height: 34px; }
    .lightbox-app-guide svg { width: 15px; height: 15px; margin-right: 5px; }
    .lightbox-app-guide__desktop { display: none; }
    .lightbox-app-guide__mobile { display: inline; }
    .lightbox-toolbar { bottom: 56px; padding: 4px 8px; }
    .lightbox-toolbar button { width: 28px; height: 28px; }
    .lightbox-toolbar button svg { width: 14px; height: 14px; }
    .lightbox-thumb { width: 36px; height: 36px; }
    .lightbox-thumb-strip { padding: 6px 10px; }
}
