.bambu-connection-modal[hidden] {
    display: none;
}

.bambu-connection-modal {
    inset: 0;
    position: fixed;
    z-index: 9999;
}

.bambu-connection-modal-backdrop {
    background: rgba(7, 17, 39, .72);
    inset: 0;
    position: absolute;
}

.bambu-connection-modal-dialog {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(7, 17, 39, .3);
    left: 50%;
    max-height: calc(100vh - 48px);
    max-width: 560px;
    overflow-y: auto;
    padding: 32px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 32px);
}

.bambu-connection-modal-dialog h2 {
    color: #071127;
    font-size: 22px;
    margin: 0 32px 6px 0;
}

.bambu-connection-modal-close {
    background: transparent;
    border: 0;
    color: #64748b;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    padding: 4px;
    position: absolute;
    right: 18px;
    top: 16px;
}

.bambu-connection-form {
    display: grid;
    gap: 12px;
}

.bambu-connection-form textarea {
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    min-height: 128px;
    padding: 12px;
    resize: vertical;
    width: 100%;
}

.bambu-connection-form button[type="submit"] {
    background: linear-gradient(90deg, #43b263 0%, #3b7ab5 50%, #814272 100%);
    border: 0;
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    justify-self: end;
    padding: 12px 20px;
}

.bambu-connection-form button:disabled {
    cursor: wait;
    opacity: .6;
}

.bambu-connection-form-error {
    color: #b42318;
    display: none;
}

.bambu-connection-form-error:not(:empty) {
    display: block;
}



.bambu-connection-modal-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .bambu-connection-modal-dialog {
        padding: 24px;
    }
}

/* Structured request form. */
.bambu-connection-to {
    margin: 0 0 20px;
    color: #64748b;
    font-size: 14px;
}

.bambu-connection-to strong {
    color: #0f172a;
}

.bambu-connection-form {
    gap: 16px;
}

.bambu-connection-field {
    display: grid;
    gap: 6px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
}

.bambu-connection-field em,
.bambu-connection-purposes em {
    color: #dc2626;
    font-style: normal;
}

.bambu-connection-form input[type="text"],
.bambu-connection-form input[type="tel"],
.bambu-connection-form input[type="url"],
.bambu-connection-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font: inherit;
    font-weight: 400;
}

.bambu-connection-form textarea {
    font: inherit;
    font-weight: 400;
}

.bambu-connection-form input:focus,
.bambu-connection-form select:focus,
.bambu-connection-form textarea:focus {
    border-color: #35ad68;
    outline: 2px solid #35ad6833;
}

.bambu-connection-counter {
    justify-self: end;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 400;
}

.bambu-connection-purposes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.bambu-connection-purposes legend {
    width: 100%;
    margin-bottom: 8px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
}

.bambu-connection-purposes label {
    position: relative; /* Keeps the hidden radio inside its chip, so focusing it never scrolls the dialog. */
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.bambu-connection-purposes input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.bambu-connection-purposes span {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    background: #fff;
    color: #334155;
    font-size: 13px;
    font-weight: 500; /* Same weight when selected: a bolder label made the chips change width and jump. */
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease, transform 120ms ease;
}

.bambu-connection-purposes label:hover span {
    border-color: #94a3b8;
}

.bambu-connection-purposes label:active span {
    transform: scale(0.97);
}

.bambu-connection-purposes input:checked + span {
    border-color: #35ad68;
    background: #ecfdf3;
    box-shadow: 0 0 0 3px #35ad681f;
    color: #166534;
}

.bambu-connection-purposes input:focus-visible + span {
    outline: 2px solid #35ad68;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .bambu-connection-purposes span {
        transition: none;
    }
}

.bambu-connection-about {
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
    background: #f8fafc;
}

.bambu-connection-about > p {
    display: grid;
    gap: 2px;
    margin: 0;
    color: #0f172a;
    font-size: 14px;
}

.bambu-connection-about small {
    color: #64748b;
    font-size: 12px;
}

.bambu-connection-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.bambu-connection-consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}

.bambu-connection-consent input {
    margin-top: 3px;
    accent-color: #35ad68;
}

.bambu-connection-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.bambu-connection-actions small {
    color: #64748b;
    font-size: 12px;
}

.bambu-connection-actions button[type="submit"] {
    flex: none;
}

.bambu-connection-success {
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 16px 0 4px;
    text-align: center;
}

.bambu-connection-success-icon {
    position: relative;
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
}

/* Success animation: the circle pops in, a ripple spreads, then the tick draws itself. */
.bambu-connection-success-icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: #16a34a;
    opacity: 0;
    animation: bambu-check-ripple 700ms ease-out 250ms;
}

.bambu-connection-success-icon svg {
    position: relative;
    z-index: 1;
    width: 64px;
    height: 64px;
    animation: bambu-check-pop 450ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.bambu-check-circle {
    fill: #ecfdf3;
    stroke: #16a34a;
    stroke-width: 2;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: bambu-check-stroke 500ms ease-out forwards;
}

.bambu-check-mark {
    fill: none;
    stroke: #16a34a;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 36;
    stroke-dashoffset: 36;
    animation: bambu-check-stroke 350ms ease-out 400ms forwards;
}

.bambu-connection-success > :not(.bambu-connection-success-icon) {
    animation: bambu-check-fade 400ms ease-out both;
}

.bambu-connection-success > :nth-child(2) { animation-delay: 450ms; }
.bambu-connection-success > :nth-child(3) { animation-delay: 520ms; }
.bambu-connection-success > :nth-child(4) { animation-delay: 590ms; }
.bambu-connection-success > :nth-child(5) { animation-delay: 660ms; }

@keyframes bambu-check-pop {
    0% { transform: scale(0.4); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes bambu-check-stroke {
    to { stroke-dashoffset: 0; }
}

@keyframes bambu-check-ripple {
    0% { transform: scale(0.8); opacity: 0.25; }
    100% { transform: scale(1.8); opacity: 0; }
}

@keyframes bambu-check-fade {
    0% { transform: translateY(6px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .bambu-connection-success-icon::after,
    .bambu-connection-success-icon svg,
    .bambu-connection-success > * {
        animation: none;
    }

    .bambu-check-circle,
    .bambu-check-mark {
        animation: none;
        stroke-dashoffset: 0;
    }
}

.bambu-connection-success h3 {
    margin: 8px 0 0;
    color: #0f172a;
    font-size: 20px;
}

.bambu-connection-success p {
    max-width: 420px;
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}

.bambu-connection-done {
    margin-top: 12px;
    padding: 10px 24px;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    background: #fff;
    color: #0f172a;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 600px) {
    .bambu-connection-grid {
        grid-template-columns: 1fr;
    }

    .bambu-connection-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

/* My connection requests page: site hero + list and side column, like Contact Us. */
.my-connections-page {
    background: #eef2f8;
    color: #0f172a;
}

.my-connections-page [hidden] {
    display: none !important;
}

.my-connections-container {
    width: calc(100% - (2 * var(--bambu-container-gutter, 24px)));
    max-width: var(--bambu-container-max-width, 1290px);
    margin-inline: auto;
}

.my-connections-section {
    padding: 48px 0 80px;
}

.my-connections-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 24px;
    align-items: start;
}

.my-connections-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.my-connections-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid #dbe4ee;
    border-radius: 9999px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.my-connections-tabs button span {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.my-connections-tabs button.is-active {
    border-color: #0f172a;
    background: #0f172a;
    color: #fff;
}

.my-connections-tabs button.is-active span {
    background: #ffffff26;
    color: #fff;
}

.my-connections-tabs button:disabled {
    opacity: 0.5;
    cursor: default;
}

.my-connections-list {
    display: grid;
    gap: 16px;
}

.my-connection {
    position: relative;
    padding: 24px 28px;
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
    transition: transform 220ms ease, box-shadow 220ms ease;
}

/* Hover: the card lifts slightly, its status bar widens and the thumbnail zooms in. */
.my-connection:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px -12px rgba(15, 23, 42, 0.18);
}

.my-connection::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: #cbd5e1;
    transition: width 220ms ease;
}

.my-connection:hover::before {
    width: 6px;
}

.my-connection.is-accepted::before {
    background: linear-gradient(180deg, #43b263 0%, #3ba295 100%);
}

.my-connection.is-rejected::before {
    background: #f59e0b;
}

.my-connection-head {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.my-connection-thumb {
    display: grid;
    flex: none;
    width: 56px;
    height: 56px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f1f5f9;
    color: #3ba295;
    font-size: 22px;
    font-weight: 700;
    place-items: center;
}

.my-connection-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease;
}

.my-connection:hover .my-connection-thumb img {
    transform: scale(1.08);
}

.my-connection-title {
    flex: 1;
    min-width: 0;
}

.my-connection-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.my-connection-id {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}

.my-connection-type {
    padding: 2px 8px;
    border-radius: 9999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 11px;
    font-weight: 600;
}

.my-connection-title h2,
.my-connection-title h3 {
    margin: 6px 0 4px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.35;
}

.my-connection-title h2 a,
.my-connection-title h3 a {
    color: #0f172a;
    text-decoration: none;
}

.my-connection-title h2 a:hover,
.my-connection-title h3 a:hover {
    color: #059669;
}

.my-connection-title p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
}

.my-connection-status {
    flex: none;
    padding: 5px 12px;
    border-radius: 9999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.is-accepted .my-connection-status {
    background: #dcfce7;
    color: #15803d;
}

.is-rejected .my-connection-status {
    background: #fef3c7;
    color: #b45309;
}

/* Progress: Sent → Reviewed → Result. */
.my-connection-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.my-connection-steps li {
    position: relative;
    padding-top: 22px;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
}

.my-connection-steps li::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 0;
    width: 10px;
    height: 10px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    background: #fff;
}

.my-connection-steps li::after {
    content: "";
    position: absolute;
    top: 9px;
    left: 16px;
    right: 6px;
    height: 2px;
    background: #e2e8f0;
}

.my-connection-steps li:last-child::after {
    display: none;
}

.my-connection-steps li.is-done {
    color: #0f172a;
}

.my-connection-steps li.is-done::before {
    border-color: #3ba295;
    background: #3ba295;
}

.my-connection-steps li.is-done::after {
    background: #3ba295;
}

.is-rejected .my-connection-steps li.is-done:last-child::before {
    border-color: #f59e0b;
    background: #f59e0b;
}

.my-connection-note {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    color: #334155;
    font-size: 14px;
    line-height: 1.6;
}

.my-connection-note p {
    margin: 0;
}

.my-connection-note p + p,
.my-connection-note small + p {
    margin-top: 6px;
}

.my-connection-note small {
    color: #94a3b8;
    font-size: 12px;
}

.my-connection-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

.my-connection-sent {
    flex: 1;
    min-width: 0;
    color: #475569;
    font-size: 14px;
}

.my-connection-sent summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #059669;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.my-connection-sent summary::-webkit-details-marker {
    display: none;
}

.my-connection-sent summary:hover {
    color: #047857;
}

/* Chevron that turns as the message opens. */
.my-connection-caret {
    width: 8px;
    height: 8px;
    margin-top: -3px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 240ms ease, margin 240ms ease;
}

.my-connection-sent[open] .my-connection-caret {
    margin-top: 3px;
    transform: rotate(-135deg);
}

.my-connection-sent-body {
    overflow: hidden;
}

.my-connection-sent-body p {
    margin: 10px 0 0;
    padding: 12px 14px;
    border-left: 3px solid #a7f3d0;
    border-radius: 0 10px 10px 0;
    background: #f8fafc;
}

.my-connection-link {
    display: inline-block;
    transition: color 160ms ease, transform 160ms ease;
}

.my-connection-link:hover {
    transform: translate(2px, -2px);
}

.my-connection-link {
    color: #0f172a;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.my-connection-link:hover {
    color: #059669;
}

/* Side column. */
.my-connections-side {
    display: grid;
    gap: 16px;
}

.my-connections-card {
    padding: 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
}

.my-connections-card h2 {
    margin: 0 0 16px;
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
}

.my-connections-summary dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

.my-connections-summary dl div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 10px;
    background: #f8fafc;
}

.my-connections-summary dt {
    color: #475569;
    font-size: 14px;
}

.my-connections-summary dd {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
}

.my-connections-summary .is-accepted dd {
    color: #15803d;
}

.my-connections-summary .is-rejected dd {
    color: #b45309;
}

.my-connections-how {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: how;
}

.my-connections-how li {
    position: relative;
    display: grid;
    gap: 2px;
    padding-left: 36px;
    counter-increment: how;
}

.my-connections-how li::before {
    content: counter(how);
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ecfdf5;
    color: #047857;
    font-size: 12px;
    font-weight: 700;
    place-items: center;
}

.my-connections-how strong {
    color: #0f172a;
    font-size: 14px;
}

.my-connections-how span {
    color: #64748b;
    font-size: 13px;
}

.my-connections-help {
    background: linear-gradient(135deg, #e0f2f1 0%, #e8eaf6 100%);
}

.my-connections-help p {
    margin: 0 0 12px;
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}

.my-connections-help a {
    color: #047857;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.my-connections-empty {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 56px 24px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06);
    text-align: center;
}

.my-connections-empty-icon {
    display: grid;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ecfdf5;
    color: #047857;
    place-items: center;
}

.my-connections-empty h2 {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: 20px;
}

.my-connections-empty p {
    max-width: 420px;
    margin: 0 0 8px;
    color: #64748b;
}

@media (prefers-reduced-motion: reduce) {
    .my-connection,
    .my-connection::before,
    .my-connection-thumb img,
    .my-connection-caret,
    .my-connection-link {
        transition: none;
    }

    .my-connection:hover,
    .my-connection:hover .my-connection-thumb img {
        transform: none;
    }
}

@media (max-width: 1024px) {
    .my-connections-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .my-connection {
        padding: 20px;
    }

    .my-connection-head {
        flex-wrap: wrap;
    }

    .my-connection-status {
        order: -1;
        margin-left: auto;
    }

    .my-connection-steps li {
        font-size: 11px;
    }
}
