.note-photo-modal {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
}

    .note-photo-modal::backdrop {
        background: transparent;
    }

.pswp {
    z-index: 1600;
}

.note-photo-modal .pswp:not(.pswp--zoomed-in) .pswp__img {
    cursor: default;
}

.pswp__button--download[hidden] {
    display: none;
}

.note-photo-modal .pswp__top-bar {
    background: rgba(32, 33, 36, .68);
    padding-right: env(safe-area-inset-right);
}

    .note-photo-modal .pswp__top-bar::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 2px;
        background: linear-gradient(rgba(32, 33, 36, .68), transparent);
        pointer-events: none;
    }

    .note-photo-modal .pswp__top-bar > * {
        flex-shrink: 0;
    }

.note-photo-modal .pswp__button--arrow {
    width: 44px;
    height: 44px;
    margin-top: -22px;
    border-radius: 50%;
    background: rgba(32, 33, 36, .5);
    visibility: visible;
}

    .note-photo-modal .pswp__button--arrow:hover,
    .note-photo-modal .pswp__button--arrow:focus-visible {
        background: rgba(32, 33, 36, .7);
    }

    .note-photo-modal .pswp__button--arrow .pswp__icn {
        top: 6px;
        left: 6px;
        right: auto;
        width: 32px;
        height: 32px;
        margin-top: 0;
    }

.note-photo-modal .pswp__button--arrow--prev {
    left: max(12px, env(safe-area-inset-left));
}

.note-photo-modal .pswp__button--arrow--next {
    right: max(12px, env(safe-area-inset-right));
}

.note-photo-modal .pswp__button:focus-visible {
    outline: 2px solid #90caf9;
    outline-offset: -3px;
}

.pswp__customer-title {
    min-width: 0;
    flex: 1 1 0;
    padding: 10px 0 0 max(16px, env(safe-area-inset-left));
    color: var(--pswp-icon-color);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
}

.note-photo-customer-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.note-photo-total {
    display: block;
    font-size: 12px;
    font-weight: 400;
    opacity: .8;
}

.note-photo-caption {
    position: absolute;
    left: 50%;
    bottom: max(20px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 9px;
    background: rgba(32, 33, 36, .92);
    color: #fff;
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    cursor: pointer;
    visibility: hidden;
}

.note-photo-caption {
    border-width: 2px;
}

    .note-photo-caption.note-photo-caption-initial {
        border-color: #90caf9;
    }

.pswp--ui-visible .note-photo-caption {
    visibility: visible;
}

.note-photo-caption[hidden] {
    display: none;
}

.note-photo-caption-label {
    min-width: 0;
    overflow-wrap: anywhere;
}

    .note-photo-caption-label > * {
        display: block;
    }

.note-photo-caption strong {
    font-weight: 500;
}

.note-photo-caption-source,
.note-photo-caption-position {
    font-size: 12px;
    color: #d1d1d5;
}

.note-photo-caption svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    fill: none;
    stroke: #90caf9;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.note-photo-note {
    position: fixed;
    inset: 0;
    width: min(480px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: var(--mud-default-borderradius, 4px);
    background: var(--mud-palette-surface, #fff);
    color: var(--mud-palette-text-primary, #424242);
    box-shadow: 0 12px 48px rgba(0, 0, 0, .35);
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    overflow: hidden;
    touch-action: pan-y;
}

    .note-photo-note[open] {
        display: flex;
        flex-direction: column;
    }

    .note-photo-note::backdrop {
        background: rgba(0, 0, 0, .5);
    }

.note-photo-note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 8px 8px 8px 24px;
    border-bottom: 1px solid var(--mud-palette-divider, #e0e0e0);
}

    .note-photo-note-header h2 {
        margin: 0;
        font-size: 18px;
        font-weight: 500;
    }

.note-photo-note-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

    .note-photo-note-close:hover {
        background: var(--mud-palette-action-default-hover, rgba(0, 0, 0, .04));
    }

    .note-photo-note-close svg {
        width: 24px;
        height: 24px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
    }

.note-photo-note-body {
    min-height: 0;
    padding: 20px 24px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    overflow-wrap: anywhere;
    user-select: text;
}

.note-photo-note-created {
    font-weight: 500;
}

.note-photo-note-source,
.note-photo-note-updated {
    color: var(--mud-palette-text-secondary, #666);
    font-size: 12px;
}

.note-photo-note-source {
    margin-top: 4px;
}

.note-photo-note-text {
    margin-top: 20px;
    white-space: pre-wrap;
}

.note-photo-note-updated {
    margin-top: 20px;
    padding-top: 12px;
    border-top: 1px solid var(--mud-palette-divider, #e0e0e0);
}

.pswp.note-photo-note-open {
    touch-action: auto;
}

@media (max-width: 480px) {
    .pswp__customer-title {
        font-size: 13px;
    }

        .pswp__customer-title ~ .pswp__preloader {
            width: 24px;
        }

    .note-photo-caption {
        width: calc(100% - 24px);
        max-width: 400px;
        gap: 12px;
    }
}
