/* The agency action stays below the existing primary profile action. */
#buddypress #item-header .member-header-actions.fsad-has-agency-link,
#buddypress #item-header #item-buttons.fsad-has-agency-link {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
#buddypress #item-header .member-header-actions:has(> .fsad-profile-agency-action),
#buddypress #item-header #item-buttons:has(> .fsad-profile-agency-action) {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}
#buddypress #item-header .member-header-actions-wrap.fsad-has-agency-actions { align-items: flex-start; }
#buddypress #item-header .fsad-profile-agency-action {
    display: block;
    float: none;
    margin: 0;
    padding: 0;
    width: 100%;
}
#buddypress #item-header a.fsad-profile-agency-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-sizing: border-box;
    width: 100%;
    max-width: 280px;
    min-height: 36px;
    padding: 8px 15px;
    border: 1px solid #d45e9f;
    border-radius: 999px;
    background: #d45e9f;
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    box-shadow: none;
    transition: background .18s ease, border-color .18s ease;
}
#buddypress #item-header a.fsad-profile-agency-button:hover {
    background: #bd4689;
    border-color: #bd4689;
    color: #fff;
}
#buddypress #item-header .fsad-profile-agency-button .fsad-icon {
    display: block;
    flex: 0 0 17px;
    width: 17px;
    height: 17px;
    margin: 0;
}
#buddypress #item-header .fsad-profile-agency-button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.fsad-agency-workers {
    clear: both;
    box-sizing: border-box;
    width: 100%;
    margin: 24px 0;
    padding: 12px;
    background: #fff;
    border: 1px solid #d6e5ec;
    border-radius: 14px;
}
#item-header .fsad-agency-workers { margin-top: 24px; }
.fsad-agency-workers-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.fsad-agency-worker-photo {
    position: relative;
    display: block;
    min-width: 0;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 10px;
    background: #f2f4f5;
}
.fsad-agency-workers .fsad-agency-worker-photo img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    border: 0;
    border-radius: inherit;
    object-fit: cover;
    transition: transform .18s ease;
}
.fsad-agency-worker-photo:hover img { transform: scale(1.04); }
.fsad-agency-worker-photo:focus-visible,
#buddypress #item-header a.fsad-profile-agency-button:focus-visible { outline: 3px solid #00aeef; outline-offset: 3px; }
@media (max-width: 1100px) {
    .fsad-agency-workers-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .fsad-agency-workers-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
}
@media (max-width: 480px) {
    .fsad-agency-workers { padding: 10px; border-radius: 12px; }
    .fsad-agency-workers-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .fsad-agency-worker-photo { border-radius: 8px; }
}
@media (prefers-reduced-motion: reduce) {
    .fsad-agency-workers .fsad-agency-worker-photo img { transition: none; }
}
