.onepage-modal-deem {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.onepage-modal {
    width: 640px;
    max-width: 100%;
    max-height: 90vh;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.onepage-favorite-modal {
    width: 520px;
}

.onepage-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
}

.onepage-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.onepage-modal-close {
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.onepage-modal-close img {
    width: 24px;
    height: 24px;
}

.onepage-modal-body {
    padding: 20px;
    overflow-y: auto;
}

.onepage-modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 16px 20px 20px;
    border-top: 1px solid #eee;
}

.onepage-btn {
    min-width: 100px;
    height: 44px;
    border-radius: 5px;
    border: 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.onepage-btn.primary {
    background: #377dff;
    color: #fff;
}

.onepage-btn.primary:disabled {
    background: #c9d9ff;
    cursor: default;
}

.onepage-btn.secondary {
    background: #f3f3f3;
    color: #333;
}

.onepage-address-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.onepage-search-input {
    width: 100%;
    height: 48px;
    padding: 0 88px 0 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 15px;
    box-sizing: border-box;
}

.onepage-search-delete,
.onepage-search-submit {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.onepage-search-delete {
    right: 48px;
}

.onepage-search-submit {
    right: 14px;
}

.onepage-search-delete img,
.onepage-search-submit img {
    width: 22px;
    height: 22px;
}

.onepage-address-toolbar {
    margin-top: 14px;
}

.onepage-address-toolbar button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    color: #377dff;
    padding: 0;
}

.onepage-address-toolbar img {
    width: 18px;
    height: 18px;
}

.onepage-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 18px 0 10px;
}

.onepage-list-title {
    font-size: 15px;
    font-weight: 600;
}

.onepage-list-head button {
    border: 0;
    background: transparent;
    color: #888;
    font-size: 13px;
    cursor: pointer;
}

.onepage-address-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.onepage-address-list li {
    position: relative;
    padding: 14px 44px 14px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.onepage-address-list li.active {
    background: #f5f8ff;
}

.onepage-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #222;
}

.onepage-item-addr {
    margin-top: 4px;
    font-size: 13px;
    color: #666;
}

.onepage-item-bookmark,
.onepage-item-remove {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.onepage-item-bookmark img,
.onepage-item-remove img {
    width: 20px;
    height: 20px;
}

.onepage-address-empty {
    text-align: center;
    padding: 40px 0 20px;
    color: #888;
}

.onepage-address-empty img {
    width: 64px;
    height: 64px;
    margin-bottom: 12px;
}

.onepage-favorite-manage-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.onepage-favorite-manage-list li {
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.onepage-fav-title {
    font-size: 13px;
    color: #377dff;
    font-weight: 600;
}

.onepage-fav-name {
    margin-top: 6px;
    font-size: 15px;
    font-weight: 600;
}

.onepage-fav-addr {
    margin-top: 4px;
    font-size: 13px;
    color: #666;
}

.onepage-fav-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.onepage-fav-actions button {
    min-width: 64px;
    height: 34px;
    border: 1px solid #377dff;
    border-radius: 5px;
    background: #fff;
    color: #377dff;
    font-size: 13px;
    cursor: pointer;
}

.onepage-fav-actions button.danger {
    border-color: #ddd;
    color: #888;
}


/* Address dialogs stay inside the visible viewport, including iOS keyboard. */
#addressSearchModal, #favoriteManageModal, #favoriteEditorModal {
    inset: auto;
    top: var(--address-view-top, 0px);
    left: var(--address-view-left, 0px);
    width: var(--address-view-width, 100%);
    height: var(--address-view-height, 100vh);
    height: var(--address-view-height, 100dvh);
    overflow: hidden;
}

#addressSearchModal .onepage-modal,
#favoriteManageModal .onepage-modal,
#favoriteEditorModal .onepage-modal {
    max-height: 100%;
    min-height: 0;
    box-sizing: border-box;
}

#addressSearchModal .onepage-modal-header,
#addressSearchModal .onepage-modal-footer,
#favoriteManageModal .onepage-modal-header,
#favoriteManageModal .onepage-modal-footer,
#favoriteEditorModal .onepage-modal-header,
#favoriteEditorModal .onepage-modal-footer {
    flex-shrink: 0;
}

#addressSearchModal .onepage-modal-body,
#favoriteManageModal .onepage-modal-body,
#favoriteEditorModal .onepage-modal-body {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

.onepage-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    font-size: 32px;
    line-height: 1;
    color: #333;
    touch-action: manipulation;
}

.onepage-modal-close img {
    width: 28px;
    height: 28px;
}

.onepage-modal-close:focus-visible {
    outline: 2px solid #377dff;
    outline-offset: 2px;
}

@media (max-width: 767px) {

    #addressSearchModal .onepage-modal-header,
  #favoriteManageModal .onepage-modal-header,
  #favoriteEditorModal .onepage-modal-header {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    #addressSearchModal .onepage-modal-footer,
  #favoriteManageModal .onepage-modal-footer,
  #favoriteEditorModal .onepage-modal-footer {
        padding-top: 10px;
        padding-bottom: 10px;
    }
}

.onepage-favorite-editor label {
    display: block;
    margin: 10px 0;
    font-size: 14px;
}

.onepage-favorite-editor input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 44px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px;
    font-size: 16px;
}

.onepage-modal-deem *, .onepage-modal-deem *::before, .onepage-modal-deem *::after {
    box-sizing: border-box;
}

#addressSearchModal {
    z-index: 10003;
}

#favoriteEditorModal {
    z-index: 10002;
}

@media(max-width:959px) {
    .onepage-modal-deem {
        padding: 12px;
    }

    .onepage-modal {
        width: 100%;
    }

    .onepage-modal-header,.onepage-modal-body,.onepage-modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .onepage-modal-footer .onepage-btn {
        flex: 1 1 0;
        min-width: 0;
    }
}
