#ojicha-image-popup[hidden] {
    display: none !important;
}

#ojicha-image-popup {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2147483000;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 14px;
    padding: calc(14px + env(safe-area-inset-top, 0px))
        calc(14px + env(safe-area-inset-right, 0px))
        calc(14px + env(safe-area-inset-bottom, 0px))
        calc(14px + env(safe-area-inset-left, 0px));
    background: rgba(24, 21, 18, 0.76);
}

#ojicha-image-popup .ojicha-image-popup__panel {
    position: relative;
    flex: 0 0 auto;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 70px rgba(0, 0, 0, 0.38);
}

#ojicha-image-popup .ojicha-image-popup__image {
    display: block;
    width: auto;
    height: auto;
    max-width: calc(100vw - 28px);
    max-width: min(720px, calc(100vw - 28px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-height: calc(100vh - 28px);
    max-height: calc(100vh - 28px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - 28px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
}

#ojicha-image-popup .ojicha-image-popup__close {
    position: absolute;
    top: 8px;
    right: 8px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(43, 36, 30, 0.16);
    border-radius: 50%;
    background: #fff;
    color: #2b241e;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    font: normal 32px/1 Arial, sans-serif;
    text-shadow: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

#ojicha-image-popup .ojicha-image-popup__close:hover {
    background: #f5f0e9;
}

#ojicha-image-popup .ojicha-image-popup__close:focus {
    outline: 2px solid #3e342b;
    outline-offset: 2px;
}

#ojicha-image-popup .ojicha-image-popup__close:focus:not(:focus-visible) {
    outline: none;
}

html.ojicha-image-popup-open,
html.ojicha-image-popup-open body {
    overflow: hidden !important;
    overscroll-behavior: none;
}
