.contactlist-block {
    display: flex;
    flex-direction: column;
    gap: 10px;

    margin-top: 40px;
    flex: 1;

    border-style: solid;
    border-width: 2px;
    border-color: var(--contacts-border);
    border-radius: 0px;

    padding: 20px;
    margin: 10px;
    top: 30px;
}

.contactlist-item {
    display: flex;

    align-items: center;
    gap: 10px;

    font-size: 15px;
    text-align: left;
}

.contactlist-item-input {
    flex: 1;
    min-width: 0;

    border: 1px solid var(--contactlist-item-border);
    border-radius: 0px;
    padding: 10px 12px;

    background: rgba(255, 255, 255, 0.08);
    color: inherit;
    font: inherit;
}

.contactlist-copy-button {
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0px;
    padding: 10px 12px;
    background: #26a349;
    color: white;
    cursor: pointer;
    font: inherit;
    transition: background 0.2s, border-color 0.2s;

    /* NEW: Prevent layout shift */
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 85px; /* Ensures space for "Copied!" */
    height: 40px;   /* Match your existing input height */
    position: relative;
}

/* THE FIX: An invisible element that forces the button to be wide enough for "Copied!" */
.contactlist-copy-button::after {
    content: "Copied!";
    height: 0;
    visibility: hidden;
    overflow: hidden;
    display: block;
    font-weight: bold; /* Match the font weight of your feedback text */
}

.contactlist-copy-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
}

.contactlist-header {
    margin-top: 0;
}

@media (max-width: 600px) {
    .contactlist-item {
        flex-direction: column;
        align-items: stretch;
    }

    .contactlist-copy-button {
        width: 100%;
    }
}