


.photo-upload-input {
    display: none;
}


.photo-upload-btn {
    display: block;
    width: 100%;
    min-height: 52px;
    padding: 16px 20px;
    background-color: #0069a8;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: none;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
}

.photo-upload-btn:active,
.photo-upload-btn:focus {
    outline: none;
}
.photo-upload-btn:hover {
    scrollbar-color: initial;
}

.photo-upload-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}


.photo-upload-btn.photo-upload-loading {
    position: relative;
    padding-right: 44px;
}

.photo-upload-btn.photo-upload-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    right: 16px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: photo-upload-spinner 0.6s linear infinite;
}

@keyframes photo-upload-spinner {
    to {
        transform: rotate(360deg);
    }
}


.photo-upload-section {
    margin-top: 20px;
    margin-bottom: 80px;
}

.photo-upload-section-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}


.photo-gallery {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 15px;
}

.photo-gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: #f5f5f5;
}

.photo-gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.photo-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-gallery-item-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #dc3545;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.photo-gallery-item:hover .photo-gallery-item-delete {
    opacity: 1;
}

.photo-gallery-item-delete:hover {
    background-color: #dc3545;
    color: white;
}


.photo-gallery-empty {
    text-align: center;
    padding: 20px 10px;
    color: #999;
    font-size: 13px;
    line-height: 1.5;
    grid-column: 1 / -1;
    background-color: #f9f9f9;
    border-radius: 6px;
    border: 1px dashed #ddd;
}


.photo-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.photo-modal-overlay.active {
    display: flex;
}

.photo-modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.photo-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.photo-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.photo-modal-close:hover {
    color: #ccc;
}


@media (max-width: 768px) {
    .photo-gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
    
    .photo-upload-btn {
        width: 100%;
        min-height: 52px;
        padding: 16px 20px;
    }
    
    .photo-modal-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .photo-gallery {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
    }
}


.pswp-delete-btn {
    position: absolute !important;
    bottom: 20px !important;
    right: 20px !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    padding: 10px 20px !important;
    background-color: rgba(220, 38, 38, 0.85) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    z-index: 100 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    opacity: 1 !important;
}

.pswp-delete-btn:hover {
    background-color: rgba(185, 28, 28, 0.95) !important;
}



.pswp__counter {
    flex-shrink: 0;
    white-space: nowrap;
}

.pswp-caption-slot {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
    height: 60px;
    margin-right: auto;
    padding: 0 12px;
    overflow: hidden;
    color: #fff;
}


.pswp-action-bar {
    position: absolute;
    left: 20px;
    bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 130px);
    z-index: 100;
}





.photo-upload-row {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: stretch;
}
.photo-upload-row .photo-upload-btn {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}
.photo-burst-btn {
    position: relative;
    flex: 0 0 52px;
    width: 52px;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 0;
    background: #fff;
    color: #0069a8;
    border: 1.5px solid #0069a8;
    border-radius: 6px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.photo-burst-btn:active { background: #eff6fb; }

.photo-burst-btn-label {
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}
.photo-burst-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #0069a8;
    color: #fff;
    border: 2px solid #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}
.photo-burst-tip {
    position: absolute;
    right: 0;
    bottom: 62px;
    padding: 8px 11px;
    border-radius: 8px;
    background: #1e293b;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
}
.photo-burst-tip::after {
    content: '';
    position: absolute;
    right: 19px;
    bottom: -6px;
    border: 6px solid transparent;
    border-bottom: 0;
    border-top-color: #1e293b;
}
.photo-burst-status { margin-top: 10px; }
.photo-burst-status[hidden] { display: none; }
.photo-burst-line,
.photo-burst-recover {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
}
.photo-burst-line + .photo-burst-line,
.photo-burst-line + .photo-burst-recover { margin-top: 4px; }
.photo-burst-line--wait { color: #b45309; }
.photo-burst-line--fail { color: #b91c1c; }
.photo-burst-recover {
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 6px;
    background: #f1f5f9;
}
.photo-burst-recover span { margin-right: auto; }
.photo-burst-link {
    padding: 2px 4px;
    background: none;
    border: 0;
    color: #0069a8;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.photo-burst-link--muted { color: #64748b; }
.photo-burst-spin,
.photo-burst-dialog .pb-spin {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #0069a8;
    border-top-color: transparent;
    border-radius: 50%;
    animation: photo-upload-spinner 0.7s linear infinite;
    flex-shrink: 0;
}


.photo-burst-dialog {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #000;
    color: #fff;
    overflow: hidden;
}
.photo-burst-dialog::backdrop { background: #000; }
.photo-burst-dialog .pb-root {
    position: absolute;
    inset: 0;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}
.photo-burst-dialog [hidden] { display: none !important; }
.photo-burst-dialog button { -webkit-tap-highlight-color: transparent; }
.photo-burst-dialog .pb-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #111;
    transform-origin: 50% 50%;
    touch-action: none;
}

.photo-burst-dialog .pb-zoom-hud {
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    color: #facc15;
    font-size: 22px;
    font-weight: 800;
    pointer-events: none;
    z-index: 7;
}
.photo-burst-dialog .pb-native {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 0 28px 180px;
    background: #111827;
    text-align: center;
}
.photo-burst-dialog .pb-native-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 0;
    background: #0069a8;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
}
.photo-burst-dialog .pb-native-msg {
    max-width: 320px;
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #cbd5e1;
}
.photo-burst-dialog .pb-flash {
    position: absolute;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 5;
}
.photo-burst-dialog .pb-flash--on { animation: pb-flash 0.28s ease-out; }
@keyframes pb-flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }
.photo-burst-dialog .pb-shade {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: calc(120px + env(safe-area-inset-top));
    background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
    pointer-events: none;
    z-index: 6;
}
.photo-burst-dialog .pb-top {
    position: absolute;
    left: 0;
    right: 0;
    top: env(safe-area-inset-top);
    height: 56px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px 0 18px;
    z-index: 10;
}

.photo-burst-dialog .pb-title {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.photo-burst-dialog .pb-title b {
    display: block;
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.photo-burst-dialog .pb-title span { font-size: 13px; opacity: 0.9; }
.photo-burst-dialog .pb-pill {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.photo-burst-dialog .pb-pill:disabled { opacity: 1; }
.photo-burst-dialog .pb-pill .pb-spin { border-color: #fff; border-top-color: transparent; }
.photo-burst-dialog .pb-pill--ok { background: rgba(22, 163, 74, 0.92); }
.photo-burst-dialog .pb-pill--wait { background: rgba(217, 119, 6, 0.95); }
.photo-burst-dialog .pb-pill--fail { background: rgba(220, 38, 38, 0.95); }
.photo-burst-dialog .pb-bar {
    position: absolute;
    left: 14px;
    right: 14px;
    top: calc(env(safe-area-inset-top) + 58px);
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    z-index: 10;
}
.photo-burst-dialog .pb-bar i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 2px;
    background: #fff;
    transition: width 0.25s linear;
}
.photo-burst-dialog .pb-banner {
    position: absolute;
    left: 14px;
    right: 14px;
    top: calc(env(safe-area-inset-top) + 70px);
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 251, 235, 0.97);
    color: #92400e;
    font-size: 13px;
    line-height: 1.45;
    z-index: 10;
}
.photo-burst-dialog .pb-paused {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 28px 160px;
    border: 0;
    background: rgba(17, 24, 39, 0.92);
    color: #fff;
    text-align: center;
    z-index: 7;
}
.photo-burst-dialog .pb-paused-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
}
.photo-burst-dialog .pb-paused b { font-size: 18px; }
.photo-burst-dialog .pb-paused-msg { font-size: 14px; line-height: 1.5; opacity: 0.9; }
.photo-burst-dialog .pb-undo {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: calc(env(safe-area-inset-bottom) + 216px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px 10px 14px;
    border-radius: 10px;
    background: #1e293b;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    font-size: 14px;
    z-index: 12;
}

.photo-burst-dialog .pb-has-zoom .pb-undo { bottom: calc(env(safe-area-inset-bottom) + 276px); }
.photo-burst-dialog .pb-undo-btn {
    padding: 4px 8px;
    border: 0;
    background: none;
    color: #7dd3fc;
    font-size: 14px;
    font-weight: 700;
}
.photo-burst-dialog .pb-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 0 calc(36px + env(safe-area-inset-bottom));
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.72) 22%, rgba(0, 0, 0, 0.88));
    z-index: 10;
}
.photo-burst-dialog .pb-note {
    margin: 0 16px 10px;
    font-size: 13px;
    text-align: center;
    opacity: 0.95;
}
.photo-burst-dialog .pb-strip {
    display: flex;
    gap: 8px;
    min-height: 56px;
    padding: 0 16px 14px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.photo-burst-dialog .pb-strip::-webkit-scrollbar { display: none; }
.photo-burst-dialog .pb-th {
    position: relative;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    padding: 0;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    background: #222;
}
.photo-burst-dialog .pb-th img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
}
.photo-burst-dialog .pb-th-ov {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}
.photo-burst-dialog .pb-th--up .pb-th-ov,
.photo-burst-dialog .pb-th--wait .pb-th-ov,
.photo-burst-dialog .pb-th--offline .pb-th-ov { background: rgba(0, 0, 0, 0.5); }
.photo-burst-dialog .pb-th--fail .pb-th-ov { background: rgba(0, 0, 0, 0.35); }
.photo-burst-dialog .pb-th-badge {
    position: absolute;
    right: 3px;
    bottom: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
}
.photo-burst-dialog .pb-th-badge--ok { background: #16a34a; }
.photo-burst-dialog .pb-th-badge--fail { background: #dc2626; }
.photo-burst-dialog .pb-th-ring {
    --p: 0%;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: conic-gradient(#fff 0 var(--p), rgba(255, 255, 255, 0.3) var(--p) 100%);
    -webkit-mask: radial-gradient(circle, transparent 9px, #000 10px);
    mask: radial-gradient(circle, transparent 9px, #000 10px);
}

.photo-burst-dialog .pb-zoomwrap {
    position: relative;
    height: 44px;
    margin: -4px 0 20px;
    touch-action: none;
}

.photo-burst-dialog .pb-zoom {
    display: flex;
    justify-content: center;
    gap: 6px;
    height: 44px;
}
.photo-burst-dialog .pb-zoomwrap--dial .pb-zoom { visibility: hidden; }
.photo-burst-dialog .pb-dial {
    position: absolute;
    left: 0;
    right: 0;
    top: -14px;
    height: 58px;
    overflow: hidden;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.55) 18%, rgba(0, 0, 0, 0.55) 82%, rgba(0, 0, 0, 0));
    pointer-events: none;
}

.photo-burst-dialog .pb-dial-ticks {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
}
.photo-burst-dialog .pb-dial-ticks i {
    position: absolute;
    bottom: 8px;
    width: 1px;
    height: 8px;
    margin-left: -0.5px;
    background: rgba(255, 255, 255, 0.55);
}
.photo-burst-dialog .pb-dial-ticks i.pb-dial-major {
    height: 14px;
    background: #fff;
}
.photo-burst-dialog .pb-dial-ticks i span {
    position: absolute;
    bottom: 17px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    font-style: normal;
    white-space: nowrap;
}
.photo-burst-dialog .pb-dial-needle {
    position: absolute;
    left: 50%;
    bottom: 4px;
    width: 2px;
    height: 24px;
    margin-left: -1px;
    background: #facc15;
}
.photo-burst-dialog .pb-dial-needle b {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: #facc15;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}
.photo-burst-dialog .pb-zoom-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
}
.photo-burst-dialog .pb-zoom-btn span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 4px;
    border-radius: 17px;
    background: rgba(0, 0, 0, 0.45);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}
.photo-burst-dialog .pb-zoom-btn--on span {
    min-width: 40px;
    height: 40px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #facc15;
    font-size: 14px;
}
.photo-burst-dialog .pb-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
}
.photo-burst-dialog .pb-count {
    width: 88px;
    font-size: 14px;
    font-weight: 600;
}
.photo-burst-dialog .pb-shutter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    padding: 0;
    border: 4px solid #fff;
    border-radius: 50%;
    background: transparent;
}
.photo-burst-dialog .pb-shutter i {
    display: block;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.08s ease;
}
.photo-burst-dialog .pb-shutter:active i { transform: scale(0.9); }
.photo-burst-dialog .pb-shutter--off { opacity: 0.45; }
.photo-burst-dialog .pb-done {
    width: 88px;
    min-height: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: #0069a8;
    font-size: 15px;
    font-weight: 700;
}
.photo-burst-dialog .pb-viewer {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    background: #000;
    z-index: 20;
}
.photo-burst-dialog .pb-viewer-top {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    margin-top: env(safe-area-inset-top);
    padding: 0 14px;
}
.photo-burst-dialog .pb-viewer-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}
.photo-burst-dialog .pb-viewer-index {
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 15px;
    pointer-events: none;
}
.photo-burst-dialog .pb-viewer-state {
    padding: 5px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 13px;
    font-weight: 700;
}
.photo-burst-dialog .pb-viewer-state--done { background: rgba(22, 163, 74, 0.92); }
.photo-burst-dialog .pb-viewer-state--offline { background: rgba(217, 119, 6, 0.95); }
.photo-burst-dialog .pb-viewer-state--fail { background: rgba(220, 38, 38, 0.95); }
.photo-burst-dialog .pb-viewer-img {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
    object-fit: contain;
}
.photo-burst-dialog .pb-viewer-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
}
.photo-burst-dialog .pb-viewer-actions .btn {
    flex: 1;
    height: 48px;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
}
.photo-burst-dialog .pb-viewer-del { background: #fff; color: #dc2626; }
.photo-burst-dialog .pb-viewer-close { background: rgba(255, 255, 255, 0.16); color: #fff; }
