.packmen-inpost-selector {
    border: 1px solid #dcdcde;
    border-radius: .5rem;
    margin: 1rem 0;
    padding: 1rem;
}

.packmen-inpost-selector h3 { margin: 0 0 .75rem; }

.packmen-inpost-selected {
    background: #f6f7f7;
    border-radius: .375rem;
    display: grid;
    gap: .125rem;
    margin-bottom: .875rem;
    padding: .875rem 1rem;
}

.packmen-inpost-selected strong,
.packmen-inpost-selected__address-line { display: block; }
.packmen-inpost-selected__code { font-size: 1.125rem; font-weight: 700; }
.packmen-inpost-selected--empty { color: #50575e; }

.packmen-inpost-selector .packmen-inpost-toggle {
    align-items: center;
    display: inline-flex;
    font-size: 1rem;
    font-weight: 700;
    justify-content: center;
    min-height: 3rem;
    min-width: 13rem;
    padding: .75rem 1.25rem;
}

.packmen-inpost-error { color: #b32d2e; font-weight: 600; }
.packmen-inpost-status { margin-bottom: 0; }

html.packmen-inpost-modal-open,
body.packmen-inpost-modal-open { overflow: hidden !important; }

body.packmen-inpost-modal-open {
    left: 0;
    position: fixed;
    right: 0;
    width: 100%;
}

.packmen-inpost-modal[hidden] { display: none !important; }

.packmen-inpost-modal {
    --packmen-inpost-viewport-height: 100dvh;
    align-items: center;
    display: flex;
    height: var(--packmen-inpost-viewport-height);
    inset: 0;
    justify-content: center;
    overflow: hidden;
    padding: 1.5rem;
    position: fixed;
    width: 100vw;
    z-index: 100000;
}

.packmen-inpost-modal,
.packmen-inpost-modal * { box-sizing: border-box; }

.packmen-inpost-modal__backdrop {
    background: rgba(17, 24, 39, .72);
    inset: 0;
    position: absolute;
}

.packmen-inpost-modal__dialog {
    background: #fff;
    border-radius: .75rem;
    box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, .32);
    display: flex;
    flex-direction: column;
    height: min(54rem, calc(var(--packmen-inpost-viewport-height) - 3rem));
    isolation: isolate;
    max-height: calc(var(--packmen-inpost-viewport-height) - 3rem);
    max-width: 74rem;
    min-height: 32rem;
    min-width: 0;
    overflow: hidden;
    position: relative;
    width: min(74rem, calc(100vw - 3rem));
}

.packmen-inpost-modal__header {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid #dcdcde;
    display: flex;
    flex: 0 0 auto;
    gap: 1rem;
    justify-content: space-between;
    min-height: 4.5rem;
    padding: .75rem 1rem .75rem 1.25rem;
}

.packmen-inpost-modal__header h2 { font-size: 1.25rem; line-height: 1.25; margin: 0; }
.packmen-inpost-modal__header p { color: #50575e; font-size: .875rem; margin: .2rem 0 0; }

.packmen-inpost-modal__close {
    align-items: center;
    background: #fff;
    border: 1px solid #8c8f94;
    border-radius: 999px;
    color: #1d2327;
    cursor: pointer;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 2rem;
    height: 2.75rem;
    justify-content: center;
    line-height: 1;
    padding: 0;
    width: 2.75rem;
}

.packmen-inpost-modal__close:focus-visible { outline: 3px solid #2271b1; outline-offset: 2px; }

.packmen-inpost-modal__focus-guard {
    height: 1px;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

.packmen-inpost-modal__status {
    background: #fff;
    flex: 0 0 auto;
    font-size: .875rem;
    min-height: 0;
    padding: 0 1.25rem;
}

.packmen-inpost-modal__status:not(:empty) { padding-bottom: .5rem; padding-top: .5rem; }
.packmen-inpost-modal__status--error { color: #b32d2e; font-weight: 600; }

.packmen-inpost-modal__widget {
    display: flex;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

.packmen-inpost-modal__widget > inpost-geowidget {
    display: block;
    flex: 1 1 auto;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    min-width: 0;
    overflow: hidden;
    width: 100% !important;
}

@media (max-width: 782px) {
    .packmen-inpost-selector .packmen-inpost-toggle { width: 100%; }
    .packmen-inpost-modal { align-items: stretch; padding: 0; }
    .packmen-inpost-modal__dialog {
        border-radius: 0;
        height: var(--packmen-inpost-viewport-height);
        max-height: var(--packmen-inpost-viewport-height);
        min-height: 0;
        width: 100vw;
    }
    .packmen-inpost-modal__header { min-height: 4rem; padding: .625rem .75rem .625rem 1rem; }
    .packmen-inpost-modal__header p { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
    .packmen-inpost-modal__dialog { animation: packmen-inpost-modal-in 160ms ease-out; }
    @keyframes packmen-inpost-modal-in {
        from { opacity: 0; transform: translateY(.75rem) scale(.99); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }
}
